Remove environment variables used by tar, gz, and bzip2, to avoid local environment...
authorJoey Hess <joey@kitenet.net>
Tue, 17 Aug 2010 21:30:50 +0000 (17:30 -0400)
committerJoey Hess <joey@kitenet.net>
Tue, 17 Aug 2010 21:30:50 +0000 (17:30 -0400)
debian/changelog
pristine-bz2
pristine-gz
pristine-tar

index d231a01..55a7e8f 100644 (file)
@@ -2,6 +2,9 @@ pristine-tar (1.04) UNRELEASED; urgency=low
 
   * pristine-gz gengz: Bugfix: Always remove uncompressed input file.
   * Large refactoring and modularization.
+  * Remove environment variables used by tar, gz, and bzip2, to avoid
+    local environment settings possibly breaking things.
+    Closes: #498760 (probably; thanks Ralph Lange for analysis)
 
  -- Joey Hess <joeyh@debian.org>  Fri, 23 Jul 2010 19:16:33 -0400
 
index f43a0f0..f0e226a 100755 (executable)
@@ -88,6 +88,9 @@ use Pristine::Tar::Formats;
 use File::Basename qw/basename/;
 use IO::Handle;
 
+delete $ENV{BZIP};
+delete $ENV{BZIP2};
+
 my @supported_bzip2_programs = qw(bzip2 pbzip2 zgz);
 
 my $try=0;
index dbaf936..81afec8 100755 (executable)
@@ -94,6 +94,8 @@ use Pristine::Tar::Delta;
 use Pristine::Tar::Formats;
 use File::Basename qw/basename/;
 
+delete $ENV{GZIP};
+
 dispatch(
        commands => {
                usage => [\&usage],
index e1621ab..7bdd093 100755 (executable)
@@ -176,6 +176,10 @@ use Cwd qw{getcwd abs_path};
 # depending on the locale.
 $ENV{LANG}='C';
 
+# Don't let environment change tar's behavior.
+delete $ENV{TAR_OPTIONS};
+delete $ENV{TAPE}
+
 my $message;
 
 dispatch(