diff options
author | أحمد المحمودي <aelmahmoudy@users.sourceforge.net> | 2009-07-29 15:19:06 +0200 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2009-07-29 15:19:06 +0200 |
commit | 14915d9c713246b0f284e8e2acec3f45587ef70e (patch) | |
tree | 171be1d890571f4051b11f77b0e37356649529b7 /gbp | |
parent | 8ea47477233c2f810c7310118f0a717e16ab940e (diff) | |
download | git-buildpackage-14915d9c713246b0f284e8e2acec3f45587ef70e.tar.gz git-buildpackage-14915d9c713246b0f284e8e2acec3f45587ef70e.tar.bz2 git-buildpackage-14915d9c713246b0f284e8e2acec3f45587ef70e.zip |
make tar_toplevel safer
Diffstat (limited to 'gbp')
-rw-r--r-- | gbp/deb_utils.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gbp/deb_utils.py b/gbp/deb_utils.py index d701eb4f..2af2fdf9 100644 --- a/gbp/deb_utils.py +++ b/gbp/deb_utils.py @@ -214,7 +214,9 @@ def repack_orig(archive, tmpdir, dest): def tar_toplevel(dir): """tar archives can contain a leading directory not""" unpacked = glob.glob('%s/*' % dir) - if len(unpacked) == 1: + unpacked.extend(glob.glob("%s/.*" % dir)) # include hidden files and folders + # Check that dir contains nothing but a single folder: + if len(unpacked) == 1 and os.path.isdir(unpacked[0]): return unpacked[0] else: return dir |