aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--gbp/deb_utils.py4
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