From e026bc3b05ca45c2d855d0a38820034ab4ef3c4c Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 1 Nov 2017 18:43:11 +0100 Subject: fetchMercurial: Don't fetch hashes we already have --- src/libutil/util.hh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/libutil/util.hh') diff --git a/src/libutil/util.hh b/src/libutil/util.hh index 63a93f2ca6a7..a3494e09b09b 100644 --- a/src/libutil/util.hh +++ b/src/libutil/util.hh @@ -245,6 +245,23 @@ string runProgram(Path program, bool searchPath = false, const Strings & args = Strings(), const std::experimental::optional & input = {}); +struct RunOptions +{ + Path program; + bool searchPath = true; + Strings args; + std::experimental::optional input; + bool _killStderr = false; + + RunOptions(const Path & program, const Strings & args) + : program(program), args(args) { }; + + RunOptions & killStderr(bool v) { _killStderr = true; return *this; } +}; + +std::pair runProgram(const RunOptions & options); + + class ExecError : public Error { public: -- cgit 1.4.1