diff options
author | 2012-06-25 11:29:21 +0200 | |
---|---|---|
committer | 2012-06-25 20:15:24 +0100 | |
commit | ea250af0b4a4da3156915308b91d5382252df318 (patch) | |
tree | 82db567fce681e82c791b60bfa837fcf89a0f962 | |
parent | e01efaa3f85a63f69134392cb92064bf59c7a609 (diff) | |
download | paludis-ea250af0b4a4da3156915308b91d5382252df318.tar.gz paludis-ea250af0b4a4da3156915308b91d5382252df318.tar.xz |
strip_tar_corruption: support sparse files
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
-rw-r--r-- | paludis/repositories/e/ebuild/utils/strip_tar_corruption.cc | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/paludis/repositories/e/ebuild/utils/strip_tar_corruption.cc b/paludis/repositories/e/ebuild/utils/strip_tar_corruption.cc index 46ac176d5..985f478e0 100644 --- a/paludis/repositories/e/ebuild/utils/strip_tar_corruption.cc +++ b/paludis/repositories/e/ebuild/utils/strip_tar_corruption.cc @@ -82,6 +82,28 @@ int main(int, char * argv[]) records_to_skip = 0; break; + case 'S': + { + std::string s(&buf[124], 12); + std::stringstream ss(s); + if (! (ss >> std::oct >> records_to_skip)) + { + std::cerr << argv[0] << ": Unable to determine how many records to skip from '" << s << "'" << std::endl; + return EXIT_FAILURE; + } + + if (buf[482]) /* isextended */ + { + do + { + std::cout.write(buf, 512); + std::cin.read(buf, 512); + } while (buf[504]); /* isextended */ + } + + records_to_skip = (records_to_skip + 511) / 512; + } + default: { std::string s(&buf[124], 12); |