From: Joey Hess Date: Tue, 17 Aug 2010 21:30:50 +0000 (-0400) Subject: Remove environment variables used by tar, gz, and bzip2, to avoid local environment... X-Git-Tag: 1.11~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5393391554a12e6f0f66eb21730233de9756c9d4;p=tools%2Fpristine-tar.git 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) --- diff --git a/debian/changelog b/debian/changelog index d231a01..55a7e8f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 Fri, 23 Jul 2010 19:16:33 -0400 diff --git a/pristine-bz2 b/pristine-bz2 index f43a0f0..f0e226a 100755 --- a/pristine-bz2 +++ b/pristine-bz2 @@ -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; diff --git a/pristine-gz b/pristine-gz index dbaf936..81afec8 100755 --- a/pristine-gz +++ b/pristine-gz @@ -94,6 +94,8 @@ use Pristine::Tar::Delta; use Pristine::Tar::Formats; use File::Basename qw/basename/; +delete $ENV{GZIP}; + dispatch( commands => { usage => [\&usage], diff --git a/pristine-tar b/pristine-tar index e1621ab..7bdd093 100755 --- a/pristine-tar +++ b/pristine-tar @@ -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(