summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2011-07-25 20:53:16 +0200
committerGuido Günther <agx@sigxcpu.org>2011-07-25 21:13:16 +0200
commit489a532b1e6a15d8d74dc4acc13f2b5296f26b03 (patch)
tree863e3b75e0025afd19f7731b3b5ee8929c6156ff
parente05e98532a662ec5d65df74cf60f63dc331897c3 (diff)
Strip trailing '/' from the unpack path
so the dirname/basename split works reliably Git-Dch: Ignore
-rw-r--r--gbp/deb.py11
-rwxr-xr-xgit-import-orig2
2 files changed, 7 insertions, 6 deletions
diff --git a/gbp/deb.py b/gbp/deb.py
index 5646dded..806f2fc6 100644
--- a/gbp/deb.py
+++ b/gbp/deb.py
@@ -190,7 +190,7 @@ class UpstreamSource(object):
self.is_dir = [False, True][os.path.isdir(name)]
self._check_orig()
if self.is_dir:
- self.unpacked = self._path
+ self.unpacked = self.path
def _check_orig(self):
"""Check if archive can be used as orig tarball"""
@@ -213,7 +213,7 @@ class UpstreamSource(object):
@property
def path(self):
- return self._path
+ return self._path.rstrip('/')
def unpack(self, dir, filters=[]):
"""
@@ -254,15 +254,16 @@ class UpstreamSource(object):
@rtype: UpstreamSource
"""
if not self.unpacked:
- raise GbpError, "Need an unpacked source tree to repack"
+ raise GbpError, "Need an unpacked source tree to pack"
if type(filters) != type([]):
raise GbpError, "Filters must be a list"
try:
+ unpacked = self.unpacked.rstrip('/')
repackArchive = gbpc.PackTarArchive(newarchive,
- os.path.dirname(self.unpacked),
- os.path.basename(self.unpacked),
+ os.path.dirname(unpacked),
+ os.path.basename(unpacked),
filters)
repackArchive()
except gbpc.CommandExecFailed:
diff --git a/git-import-orig b/git-import-orig
index c9d71708..aebb811f 100755
--- a/git-import-orig
+++ b/git-import-orig
@@ -191,7 +191,7 @@ def repacked_tarball_name(source, name, version):
os.path.dirname(source.path),
os.path.basename(source.path).replace(".tar", ".gbp.tar"))
else:
- # Repacked sources or other arcives get canonical name
+ # Repacked sources or other archives get canonical name
name = os.path.join(
os.path.dirname(source.path),
"%s_%s.orig.tar.bz2" % (name, version))