From 0b9601ef293d0a5db49c5bf19e83e04717c7d864 Mon Sep 17 00:00:00 2001 From: Raphael Hertzog Date: Sun, 24 Feb 2008 21:48:34 +0100 Subject: [PATCH] Dpkg::Source::Archive/Patch: small tweaks * scripts/Dpkg/Source/Archive.pm (create): Offer possibility to chdir before calling tar. This is required to create tar achives that do not encode the full path to the location of the directory that we want to integrate. * scripts/Dpkg/Source/Patch.pm (apply): Make sure to remove POSIXLY_CORRECT while calling patch to avoid unexpected changes in his behaviour. --- scripts/Dpkg/Source/Archive.pm | 2 ++ scripts/Dpkg/Source/Patch.pm | 1 + 2 files changed, 3 insertions(+) diff --git a/scripts/Dpkg/Source/Archive.pm b/scripts/Dpkg/Source/Archive.pm index b378a963..6be46924 100644 --- a/scripts/Dpkg/Source/Archive.pm +++ b/scripts/Dpkg/Source/Archive.pm @@ -37,6 +37,8 @@ sub create { my ($self, %opts) = @_; $opts{"options"} ||= []; my %fork_opts; + # Possibly run tar from another directory + $fork_opts{"chdir"} = $opts{"chdir"} if $opts{"chdir"}; # Redirect input/output appropriately $fork_opts{"to_handle"} = $self->open_for_write(); $fork_opts{"from_pipe"} = \$self->{'tar_input'}; diff --git a/scripts/Dpkg/Source/Patch.pm b/scripts/Dpkg/Source/Patch.pm index f8657b43..81974677 100644 --- a/scripts/Dpkg/Source/Patch.pm +++ b/scripts/Dpkg/Source/Patch.pm @@ -381,6 +381,7 @@ sub apply { 'exec' => [ 'patch', @{$opts{"options"}} ], 'chdir' => $destdir, 'env' => { LC_ALL => 'C', LANG => 'C' }, + 'delete_env' => [ 'POSIXLY_CORRECT' ], # ensure expected patch behaviour 'wait_child' => 1, 'from_handle' => $diff_handle ); -- 2.39.5