The following commit has been merged in the master branch:
commit 0396824c22e2c9c6fc7eb2c5bbe20fe0e0f5163e
Author: James Vega <james...@debian.org>
Date:   Tue May 17 08:05:33 2011 -0400

    debcheckout: Add $destdir as an argument to unpack_source
    
    Previously, unpack_source was assuming the created directory would be based 
on
    the package name ($pkg).  This assumption would fail if the user specified a
    directory that wasn't the same as the package name.
    
    Closes: #627030
    Signed-off-by: James Vega <james...@debian.org>

diff --git a/debian/changelog b/debian/changelog
index d5511e0..b0fcf2b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,6 +3,8 @@ devscripts (2.10.74) UNRELEASED; urgency=low
   * getbuildlog:
     + Query the updated build log status pages.
     + Request the raw log file when downloading.
+  * debcheckout: Use the destination directory, not package name, when
+    checking for where the checkout happened.  (Closes: #627030)
 
  -- James Vega <james...@debian.org>  Sat, 14 May 2011 16:05:10 -0400
 
diff --git a/scripts/debcheckout.pl b/scripts/debcheckout.pl
index e570d5b..2ac4549 100755
--- a/scripts/debcheckout.pl
+++ b/scripts/debcheckout.pl
@@ -782,20 +782,21 @@ sub checkout_files($$$$) {
 }
 
 # download source package, unpack it, and merge its contents into the checkout
-sub unpack_source($$$$) {
-    my ($pkg, $version, $origtgz_name, $unpack_source) = @_;
+sub unpack_source($$$$$) {
+    my ($pkg, $version, $destdir, $origtgz_name, $unpack_source) = @_;
 
     return 1 if ($unpack_source eq 'never');
     return 1 if (defined $origtgz_name and $origtgz_name eq ''); # only really 
relevant with URL on command line
 
+    $destdir ||= $pkg;
     # is this a debian-dir-only repository?
-    unless (-d $pkg) {
-       print STDERR "debcheckout did not create the $pkg directory - this is 
probably a bug\n";
+    unless (-d $destdir) {
+       print STDERR "debcheckout did not create the $destdir directory - this 
is probably a bug\n";
        return 0;
     }
-    my @repo_files = glob "$pkg/*";
+    my @repo_files = glob "$destdir/*";
     my $debian_only = 0;
-    if (@repo_files == 1 and $repo_files[0] eq "$pkg/debian") {
+    if (@repo_files == 1 and $repo_files[0] eq "$destdir/debian") {
        $debian_only = 1;
     }
 
@@ -1108,7 +1109,7 @@ EOF
            $rc ||= 1;
            exit($rc);
        }
-       unpack_source($pkg, $version, $origtgz_name, $unpack_source) or $rc = 1;
+       unpack_source($pkg, $version, $destdir, $origtgz_name, $unpack_source) 
or $rc = 1;
     }
 
     exit($rc);

-- 
Git repository for devscripts


-- 
To unsubscribe, send mail to pkg-devscripts-unsubscr...@teams.debian.net.

Reply via email to