[Reproducible-commits] [dpkg] 55/90: Dpkg::Source::Archive: Future-proof tar invocations

Jérémy Bobbio lunar at moszumanska.debian.org
Sat Aug 29 18:26:15 UTC 2015


This is an automated email from the git hooks/post-receive script.

lunar pushed a commit to branch pu/reproducible_builds
in repository dpkg.

commit 02e2060504f1c8dbbe5dec8211beaf945350c789
Author: Guillem Jover <guillem at debian.org>
Date:   Mon Jul 13 16:33:58 2015 +0200

    Dpkg::Source::Archive: Future-proof tar invocations
    
    The function options should come before any other option. And at least
    the --owner and --group options might become positional in the same way
    --no-recursion did with tar > 1.28, according to upstream. Suffle
    options around to make sure this does not cause any problems in the
    future.
---
 debian/changelog               |  3 +++
 scripts/Dpkg/Source/Archive.pm | 10 +++++-----
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 99d8872..5ecfaa4 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -53,6 +53,9 @@ dpkg (1.18.2) UNRELEASED; urgency=low
     - Allow colons (:) in added filenames in Dpkg::Dist::Files, which can be
       present when the upstream version contains colons. Regression introduced
       in dpkg 1.18.0. Reported by Jakub Wilk <jwilk at debian.org>.
+    - Future-proof tar invocations in Dpkg::Source::Archive for options that
+      might become positional in the future, and by always placing function
+      options first.
   * Documentation:
     - Fix grammar in dpkg-architecture(1).
       Thanks to Chris Lamb <lamby at debian.org>. Closes: #787616
diff --git a/scripts/Dpkg/Source/Archive.pm b/scripts/Dpkg/Source/Archive.pm
index 2af113a..0490fc7 100644
--- a/scripts/Dpkg/Source/Archive.pm
+++ b/scripts/Dpkg/Source/Archive.pm
@@ -48,9 +48,9 @@ sub create {
     $spawn_opts{from_pipe} = \*$self->{tar_input};
     # Call tar creation process
     $spawn_opts{delete_env} = [ 'TAR_OPTIONS' ];
-    $spawn_opts{exec} = [ 'tar', '--null', '-T', '-', '--numeric-owner',
-                            '--owner', '0', '--group', '0', '--format=gnu',
-                            @{$opts{options}}, '-cf', '-' ];
+    $spawn_opts{exec} = [ 'tar', '-cf', '-', '--format=gnu', '--null',
+                          '--numeric-owner', '--owner=0', '--group=0',
+                          @{$opts{options}}, '-T', '-' ];
     *$self->{pid} = spawn(%spawn_opts);
     *$self->{cwd} = getcwd();
 }
@@ -126,8 +126,8 @@ sub extract {
 
     # Call tar extraction process
     $spawn_opts{delete_env} = [ 'TAR_OPTIONS' ];
-    $spawn_opts{exec} = [ 'tar', '--no-same-owner', '--no-same-permissions',
-                            @{$opts{options}}, '-xf', '-' ];
+    $spawn_opts{exec} = [ 'tar', '-xf', '-', '--no-same-permissions',
+                          '--no-same-owner', @{$opts{options}} ];
     spawn(%spawn_opts);
     $self->close();
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/dpkg.git



More information about the Reproducible-commits mailing list