]> err.no Git - dpkg/commitdiff
Dpkg::Source::Archive/Patch: small tweaks
authorRaphael Hertzog <hertzog@debian.org>
Sun, 24 Feb 2008 20:48:34 +0000 (21:48 +0100)
committerRaphael Hertzog <hertzog@debian.org>
Sun, 24 Feb 2008 20:48:34 +0000 (21:48 +0100)
* 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
scripts/Dpkg/Source/Patch.pm

index b378a96392f2af56e62f766884746bd67192b297..6be46924eb5a151faa784bf478faed83a93c547a 100644 (file)
@@ -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'};
index f8657b43055e1c1771552a28aeaa9ae19b84eaf9..81974677b7ef6169e8546502df8746d775faf7d7 100644 (file)
@@ -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
     );