aboutsummaryrefslogtreecommitdiffhomepage
path: root/gbp
diff options
context:
space:
mode:
authorGuido Guenther <agx@sigxcpu.org>2008-08-12 18:21:12 +0200
committerGuido Guenther <agx@sigxcpu.org>2008-08-12 18:21:12 +0200
commit32b2e89565f9c37bd3f3c40c77b5c19c5b1f0e2b (patch)
tree07d16c2bdfd35594adf35987bc4afc71b642a7c2 /gbp
parent64808dffa98ca2e5910707d2a763606ec8a91cb0 (diff)
detect flat tar archives in git-import-dsc too
Diffstat (limited to 'gbp')
-rw-r--r--gbp/deb_utils.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/gbp/deb_utils.py b/gbp/deb_utils.py
index 91e3fc23..a9bd1fbc 100644
--- a/gbp/deb_utils.py
+++ b/gbp/deb_utils.py
@@ -9,6 +9,7 @@ import os
import re
import shutil
import sys
+import glob
import command_wrappers as gbpc
from errors import GbpError
@@ -192,6 +193,15 @@ def unpack_orig(archive, tmpdir, filters):
return unpackArchive.dir
+def tar_toplevel(dir):
+ """tar archives can contain a leading directory not"""
+ unpacked = glob.glob('%s/*' % dir)
+ if len(unpacked) == 1:
+ return unpacked[0]
+ else:
+ return dir
+
+
def _test():
import doctest
doctest.testmod()