The following commit has been merged in the master branch:
commit 8d33547ae6e6d6d83e44b4db2eeb863f7ebb17da
Author: Raphaël Hertzog <[email protected]>
Date:   Fri Dec 23 14:52:34 2011 +0100

    dpkg-source: fix issue with relative filename given to --commit
    
    With the “3.0 (quilt)” source format, dpkg-source would happily ignore the
    patch-file parameter if it was not found, instead of properly erroring
    out. Furthermore a relative filename would also not be found when the
    given directory is "." since dpkg-source does a chdir("..") in that case.
    
    Both issues are fixed by this commit.
    
    Closes: #652414
    Reported-by: Sam Hartman <[email protected]>

diff --git a/debian/changelog b/debian/changelog
index c4929aa..87c43ef 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -66,6 +66,8 @@ dpkg (1.16.2) UNRELEASED; urgency=low
   * Error out if a dpkg database .list file is not a regular file. LP: #369898
   * Fix dpkg-mergechangelogs to not error out on invalid versions.
     Closes: #651993
+  * Fix dpkg-source --commit on "3.0 (quilt)" when an explicit patch file
+    is given with a relative filename. Closes: #652414
 
   [ Jonathan Nieder ]
   * Bump po4a version in Build-Depends to 0.41, since earlier versions do
diff --git a/scripts/Dpkg/Source/Package/V2.pm 
b/scripts/Dpkg/Source/Package/V2.pm
index 891158d..2a7479a 100644
--- a/scripts/Dpkg/Source/Package/V2.pm
+++ b/scripts/Dpkg/Source/Package/V2.pm
@@ -629,7 +629,14 @@ sub commit {
 
     $self->prepare_build($dir);
 
-    unless ($tmpdiff && -e $tmpdiff) {
+    # Try to fix up a broken relative filename for the patch
+    if ($tmpdiff and not -e $tmpdiff) {
+        $tmpdiff = File::Spec->catfile($dir, $tmpdiff)
+            unless File::Spec->file_name_is_absolute($tmpdiff);
+        error(_g("patch file '%s' doesn't exist"), $tmpdiff) if not -e 
$tmpdiff;
+    }
+
+    unless ($tmpdiff) {
         $tmpdiff = $self->generate_patch($dir, usage => "commit");
     }
     push @Dpkg::Exit::handlers, sub { unlink($tmpdiff) };

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to