summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuido Guenther <agx@sigxcpu.org>2008-02-08 17:08:19 +0100
committerGuido Guenther <agx@sigxcpu.org>2008-02-08 17:08:19 +0100
commitd11c2a1b90a065739adcd754319f3924f8124972 (patch)
tree5c5d1983482de19c0b421448b0df24215073ee29
parent70aad7d304c3ba42557c4fe06d70b7eedce8365f (diff)
downloadgit-buildpackage-d11c2a1b90a065739adcd754319f3924f8124972.tar.gz
git-buildpackage-d11c2a1b90a065739adcd754319f3924f8124972.tar.bz2
git-buildpackage-d11c2a1b90a065739adcd754319f3924f8124972.zip
detect flat tar archives (Closes: #463822)
-rwxr-xr-xgit-import-orig8
1 files changed, 7 insertions, 1 deletions
diff --git a/git-import-orig b/git-import-orig
index f3344bec..ade8437b 100755
--- a/git-import-orig
+++ b/git-import-orig
@@ -169,7 +169,13 @@ on howto create it otherwise use --upstream-branch to specify it.
unpack_orig(archive, tmpdir)
if options.verbose:
print "Unpacked %s to '%s'" % (archive , tmpdir)
- orig_dir = glob.glob(tmpdir+'/*')[0]
+ unpacked = glob.glob(tmpdir+'/*')
+ # archive has everything packed up in one subdir:
+ if len(unpacked) == 1:
+ orig_dir = unpacked[0]
+ # archive content not in a subdir
+ else:
+ orig_dir = tmpdir
try:
if not is_empty: