summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2012-06-14 19:30:26 +0300
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>2014-11-14 14:22:07 +0200
commit6bfdaeb3e98c4183c190e6f04d472d035622e6ca (patch)
tree0f2baca1d6b1593bd47ccf530473220342645c78 /tests
parenta5707c5c48379b5575091148eb7fde3f8c5d18bc (diff)
downloadgit-buildpackage-6bfdaeb3e98c4183c190e6f04d472d035622e6ca.tar.gz
git-buildpackage-6bfdaeb3e98c4183c190e6f04d472d035622e6ca.tar.bz2
git-buildpackage-6bfdaeb3e98c4183c190e6f04d472d035622e6ca.zip
UpstreamSource.pack: support prefix mangling
Add support for changing the prefix directory inside the tarball that is generated. Also, fixes a bug that caused a "prefix-less" tarball to get one, if unpacked and then repacked. Also, adds this support to repack_source() in common/import_orig. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/06_test_upstream_source.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/06_test_upstream_source.py b/tests/06_test_upstream_source.py
index 34787bf4..ac210a03 100644
--- a/tests/06_test_upstream_source.py
+++ b/tests/06_test_upstream_source.py
@@ -72,6 +72,15 @@ class TestTar(unittest.TestCase):
self._check_tar(repacked, ["gbp/errors.py"],
["gbp/__init__.py"])
+ def test_pack_mangle_prefix(self):
+ """Check if mangling prefix works"""
+ source = UpstreamSource(os.path.abspath("gbp/"))
+ target = self.tmpdir.join("gbp_0.1.tar.bz2")
+ repacked = source.pack(target, newprefix="foobar")
+ self._check_tar(repacked, ["foobar/errors.py", "foobar/__init__.py"])
+ repacked2 = source.pack(target, newprefix="")
+ self._check_tar(repacked2, ["./errors.py", "./__init__.py"])
+
class TestZip(unittest.TestCase):
"""Test if unpacking zip archives works"""