From: Raphael Hertzog Date: Sun, 8 Jun 2008 19:03:24 +0000 (+0200) Subject: dpkg-source/3.0 (quilt): use absolute path names with quilt X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=99d871ef65a051c19d330cdbda16ca9470123897;p=dpkg 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. --- diff --git a/ChangeLog b/ChangeLog index 59f5007b..a7ada4ab 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-06-08 Raphael Hertzog + + * 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 * scripts/Dpkg/Source/Patch.pm (analyze): Accept unexpected diff --git a/scripts/Dpkg/Source/Package/V3/quilt.pm b/scripts/Dpkg/Source/Package/V3/quilt.pm index 7f3fae40..f97794a1 100644 --- a/scripts/Dpkg/Source/Package/V3/quilt.pm +++ b/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 {