aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Marc-Antoine Perennou <Marc-Antoine@Perennou.com> 2012-06-25 11:29:21 +0200
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2012-06-25 20:15:24 +0100
commitea250af0b4a4da3156915308b91d5382252df318 (patch)
tree82db567fce681e82c791b60bfa837fcf89a0f962
parente01efaa3f85a63f69134392cb92064bf59c7a609 (diff)
downloadpaludis-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.cc22
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 46ac176..985f478 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);