summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2013-10-21 23:01:35 +0200
committerHauke Mehrtens <hauke@hauke-m.de>2013-10-28 21:34:13 +0100
commit3740e2d37dac90e31823fb135f340f9d96d43c3d (patch)
treed9b79e5c18f7cd5b3d1e80686f5d16f010f1ea1a
parentc1d67cefdcba7dcb77dfe74dea8af58500be69c8 (diff)
gentree.py: do not add full path into tar
Upstream commit: 515e82602216fc40a224f02f34d0a0f0c03c8309 dir_to_tar could be the absolute path to the directory to to tar, but we do not want the full patch in the tar, just the basename. In addition the second close is not necessary. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
-rwxr-xr-xgentree.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/gentree.py b/gentree.py
index c700309b..26a55c9d 100755
--- a/gentree.py
+++ b/gentree.py
@@ -345,9 +345,9 @@ def create_tar_and_bz2(tar_name, dir_to_tar):
in the backend decompresses and verifies the tarball against
our signature.
"""
- parent = os.path.dirname(tar_name)
+ basename = os.path.basename(dir_to_tar)
tar = tarfile.open(tar_name, "w")
- tar.add(dir_to_tar)
+ tar.add(dir_to_tar, basename)
tar.close()
tar_file = open(tar_name, "r")
@@ -356,8 +356,6 @@ def create_tar_and_bz2(tar_name, dir_to_tar):
bz2_file.write(tar_file.read())
bz2_file.close()
- tar.close()
-
def upload_release(args, rel_prep, logwrite=lambda x:None):
"""
Given a path of a relase make tarball out of it, PGP sign it, and