]> err.no Git - dpkg/commitdiff
dpkg-source/3.0 (quilt): use absolute path names with quilt
authorRaphael Hertzog <hertzog@debian.org>
Sun, 8 Jun 2008 19:03:24 +0000 (21:03 +0200)
committerRaphael Hertzog <hertzog@debian.org>
Sun, 8 Jun 2008 23:04:16 +0000 (01:04 +0200)
* 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.

ChangeLog
scripts/Dpkg/Source/Package/V3/quilt.pm

index 59f5007be287a7830a5a971dfe3e2fdbcf807373..a7ada4ab8d84a134cbafc2fec397d54076fd58fa 100644 (file)
--- a/ChangeLog
+++ b/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
index 7f3fae40a36acd68c82c103b24ef5390dc1eb2a5..f97794a146dbe406fc3a43346cd034bfce009a2e 100644 (file)
@@ -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 {