Forráskód Böngészése

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.
Raphael Hertzog 18 éve
szülő
commit
0b9601ef29
2 módosított fájl, 3 hozzáadás és 0 törlés
  1. 2 0
      scripts/Dpkg/Source/Archive.pm
  2. 1 0
      scripts/Dpkg/Source/Patch.pm

+ 2 - 0
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'};

+ 1 - 0
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
     );