| 148 | |
| 149 | |
| 150 | Future<Nothing> untar( |
| 151 | const Path& input, |
| 152 | const Option<Path>& directory) |
| 153 | { |
| 154 | vector<string> argv = { |
| 155 | "tar", |
| 156 | "-x", // Extract/unarchive. |
| 157 | "-f", // Input file to extract/unarchive. |
| 158 | input |
| 159 | }; |
| 160 | |
| 161 | // Add additional flags. |
| 162 | if (directory.isSome()) { |
| 163 | argv.emplace_back("-C"); |
| 164 | argv.emplace_back(directory.get()); |
| 165 | } |
| 166 | |
| 167 | return launch("tar", argv) |
| 168 | .then([]() { return Nothing(); }); |
| 169 | } |
| 170 | |
| 171 | |
| 172 | Future<string> sha512(const Path& input) |