diff options
author | eldritch horrors <pennae@lix.systems> | 2024-06-23 15:19:47 +0200 |
---|---|---|
committer | eldritch horrors <pennae@lix.systems> | 2024-06-23 17:29:40 +0000 |
commit | d477b34d1df3b471f8132525b0a008bbd03ddb6d (patch) | |
tree | dbf58b2cfd0f5ed0944ca62dcfc7cd73b34b5dee /src/libfetchers | |
parent | 2bbdaf0b19066ea1764e8d5810c2b250dbf0a850 (diff) |
libutil: remove runProgram2 stdin functionality
this was only used in one place, and that place has been rewritten to
use a temporary file instead. keeping this around is not very helpful
at this time, and in any case we'd be better off rewriting subprocess
handling in rust where we not only have a much safer library for such
things but also async frameworks necessary for this easily available.
Change-Id: I6f8641b756857c84ae2602cdf41f74ee7a1fda02
Diffstat (limited to 'src/libfetchers')
-rw-r--r-- | src/libfetchers/git.cc | 8 | ||||
-rw-r--r-- | src/libfetchers/mercurial.cc | 3 |
2 files changed, 5 insertions, 6 deletions
diff --git a/src/libfetchers/git.cc b/src/libfetchers/git.cc index f2d577914..a06bc86b2 100644 --- a/src/libfetchers/git.cc +++ b/src/libfetchers/git.cc @@ -358,7 +358,7 @@ struct GitInputScheme : InputScheme args.push_back(destDir); - runProgram("git", true, args, {}, true); + runProgram("git", true, args, true); } std::optional<Path> getSourcePath(const Input & input) const override @@ -589,7 +589,7 @@ struct GitInputScheme : InputScheme : ref == "HEAD" ? *ref : "refs/heads/" + *ref; - runProgram("git", true, { "-C", repoDir, "--git-dir", gitDir, "fetch", "--quiet", "--force", "--", actualUrl, fmt("%s:%s", fetchRef, fetchRef) }, {}, true); + runProgram("git", true, { "-C", repoDir, "--git-dir", gitDir, "fetch", "--quiet", "--force", "--", actualUrl, fmt("%s:%s", fetchRef, fetchRef) }, true); } catch (Error & e) { if (!pathExists(localRefFile)) throw; warn("could not update local clone of Git repository '%s'; continuing with the most recent version", actualUrl); @@ -656,7 +656,7 @@ struct GitInputScheme : InputScheme // everything to ensure we get the rev. Activity act(*logger, lvlTalkative, actUnknown, fmt("making temporary clone of '%s'", repoDir)); runProgram("git", true, { "-C", tmpDir, "fetch", "--quiet", "--force", - "--update-head-ok", "--", repoDir, "refs/*:refs/*" }, {}, true); + "--update-head-ok", "--", repoDir, "refs/*:refs/*" }, true); } runProgram("git", true, { "-C", tmpDir, "checkout", "--quiet", input.getRev()->gitRev() }); @@ -683,7 +683,7 @@ struct GitInputScheme : InputScheme { Activity act(*logger, lvlTalkative, actUnknown, fmt("fetching submodules of '%s'", actualUrl)); - runProgram("git", true, { "-C", tmpDir, "submodule", "--quiet", "update", "--init", "--recursive" }, {}, true); + runProgram("git", true, { "-C", tmpDir, "submodule", "--quiet", "update", "--init", "--recursive" }, true); } filter = isNotDotGitDirectory; diff --git a/src/libfetchers/mercurial.cc b/src/libfetchers/mercurial.cc index 6015f8ec7..b4150e9df 100644 --- a/src/libfetchers/mercurial.cc +++ b/src/libfetchers/mercurial.cc @@ -28,10 +28,9 @@ static RunOptions hgOptions(const Strings & args) } // runProgram wrapper that uses hgOptions instead of stock RunOptions. -static std::string runHg(const Strings & args, const std::optional<std::string> & input = {}) +static std::string runHg(const Strings & args) { RunOptions opts = hgOptions(args); - opts.input = input; auto res = runProgram(std::move(opts)); |