Преглед изворни кода

dpkg-source/3.0 (quilt): use absolute path names with quilt

* scripts/Dpkg/Source/Package/V3/quilt.pm: Use absolute path names
when giving directories and filenames to quilt to avoid any
problems due to quilt's feature of trying relative paths in parent
directories too.
Raphael Hertzog пре 18 година
родитељ
комит
99d871ef65
2 измењених фајлова са 17 додато и 2 уклоњено
  1. 7 0
      ChangeLog
  2. 10 2
      scripts/Dpkg/Source/Package/V3/quilt.pm

+ 7 - 0
ChangeLog

@@ -1,3 +1,10 @@
+2008-06-08  Raphael Hertzog  <hertzog@debian.org>
+
+	* scripts/Dpkg/Source/Package/V3/quilt.pm: Use absolute path names
+	when giving directories and filenames to quilt to avoid any
+	problems due to quilt's feature of trying relative paths in parent
+	directories too.
+
 2008-06-07  Raphael Hertzog  <hertzog@debian.org>
 
 	* scripts/Dpkg/Source/Patch.pm (analyze): Accept unexpected

+ 10 - 2
scripts/Dpkg/Source/Package/V3/quilt.pm

@@ -101,8 +101,12 @@ sub get_patches {
 sub run_quilt {
     my ($self, $dir, $params, %more_opts) = @_;
     $params = [ $params ] unless ref($params) eq "ARRAY";
+    my $absdir = $dir;
+    unless (File::Spec->file_name_is_absolute($absdir)) {
+        $absdir = File::Spec->rel2abs($dir);
+    }
     my %opts = (
-        env => { QUILT_PATCHES => 'debian/patches' },
+        env => { QUILT_PATCHES => "$absdir/debian/patches" },
         'chdir' => $dir,
         'exec' => [ 'quilt', '--quiltrc', '/dev/null', @$params ],
         %more_opts
@@ -214,6 +218,10 @@ sub register_autopatch {
     $series ||= File::Spec->catfile($dir, "debian", "patches", "series");
     my $applied = File::Spec->catfile($dir, "debian", "patches", ".dpkg-source-applied");
     my $patch = File::Spec->catfile($dir, "debian", "patches", $auto_patch);
+    my $absdir = $dir;
+    unless (File::Spec->file_name_is_absolute($absdir)) {
+        $absdir = File::Spec->rel2abs($dir);
+    }
     if (-e $patch) {
         # Add auto_patch to series file
         if (not $has_patch) {
@@ -228,7 +236,7 @@ sub register_autopatch {
                 # again with quilt this time
                 my $patch_obj = Dpkg::Source::Patch->new(filename => $patch);
                 $patch_obj->apply($dir, add_options => ['-R', '-E']);
-                $self->run_quilt($dir, ['import', "debian/patches/$auto_patch"],
+                $self->run_quilt($dir, ['import', "$absdir/debian/patches/$auto_patch"],
                                  wait_child => 1, to_file => '/dev/null');
                 $self->run_quilt($dir, ['push'], wait_child => 1, to_file => '/dev/null');
             } else {