tags 648654 patch
thanks

This is the patch which addresses the issue and works for me.
Please review and consider it for inclusion.
From c94389ff2963d6310e97cc901c8c64ce8b25375a Mon Sep 17 00:00:00 2001
From: Michael Prokop <m...@grml.org>
Date: Sun, 13 Nov 2011 19:49:06 +0100
Subject: [PATCH] debcheckout: use DESTDIR also for debian/ only VCS packages

When using debcheckout's DESTDIR feature the rename fails iff the
package tracks debian/ only in VCS and the rest of the package is
retrieved via apt-source. This patch addresses this situation.

Example for such a package where debcheckout fails without this
patch:

| % debcheckout collectd source
| declared git repository at git://git.tokkee.org/pkg-collectd.git
| git clone git://git.tokkee.org/pkg-collectd.git source ...
| Cloning into 'source'...
| remote: Counting objects: 3271, done.
| remote: Compressing objects: 100% (2228/2228), done.
| remote: Total 3271 (delta 1763), reused 725 (delta 384)
| Receiving objects: 100% (3271/3271), 434.02 KiB | 746 KiB/s, done.
| Resolving deltas: 100% (1763/1763), done.
| repository only contains the debian directory, using apt-get source
| Reading package lists... Done
| Building dependency tree
| Reading state information... Done
| NOTICE: 'collectd' packaging is maintained in the 'Git' version control system at:
| git://git.tokkee.org/pkg-collectd.git
| Need to get 1,794 kB of source archives.
| Get:1 http://cdn.debian.net/debian/ sid/main collectd 4.10.1-2.1 (dsc) [2,501 B]
| Get:2 http://cdn.debian.net/debian/ sid/main collectd 4.10.1-2.1 (tar) [1,733 kB]
| Get:3 http://cdn.debian.net/debian/ sid/main collectd 4.10.1-2.1 (diff) [58.5 kB]
| Fetched 1,794 kB in 2s (829 kB/s)
| dpkg-source: info: extracting collectd in collectd-4.10.1
| dpkg-source: info: unpacking collectd_4.10.1.orig.tar.gz
| dpkg-source: info: applying collectd_4.10.1-2.1.diff.gz
| rename rVnARqI64_/collectd-4.10.1/Makefile.am collectd/Makefile.am: No such file or directory at /usr/bin/debcheckout line 857.
|
| % ls source
| debian/

Closes: #648654
Signed-off-by: Michael Prokop <m...@grml.org>
---
 scripts/debcheckout.pl |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/debcheckout.pl b/scripts/debcheckout.pl
index bfc4c56..043f1f5 100755
--- a/scripts/debcheckout.pl
+++ b/scripts/debcheckout.pl
@@ -854,8 +854,8 @@ sub unpack_source($$$$$) {
 	} elsif ($file eq '.' or $file eq '..') {
 	    next;
 	} else {
-	    rename "$directory/$file", "$pkg/$file" or
-		die "rename $directory/$file $pkg/$file: $!";
+	    rename "$directory/$file", "$destdir/$file" or
+		die "rename $directory/$file $destdir/$file: $!";
 	}
     }
     closedir DIR;
-- 
1.7.7.2

Attachment: signature.asc
Description: Digital signature

Reply via email to