diff options
author | Guido Günther <agx@sigxcpu.org> | 2011-07-25 20:53:16 +0200 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2011-07-25 21:13:16 +0200 |
commit | 489a532b1e6a15d8d74dc4acc13f2b5296f26b03 (patch) | |
tree | 863e3b75e0025afd19f7731b3b5ee8929c6156ff /gbp | |
parent | e05e98532a662ec5d65df74cf60f63dc331897c3 (diff) |
Strip trailing '/' from the unpack path
so the dirname/basename split works reliably
Git-Dch: Ignore
Diffstat (limited to 'gbp')
-rw-r--r-- | gbp/deb.py | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -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: |