summaryrefslogtreecommitdiff
path: root/git-import-orig
diff options
context:
space:
mode:
authorGuido Guenther <agx@sigxcpu.org>2007-05-20 01:22:31 +0200
committerGuido Guenther <agx@bogon.sigxcpu.org>2007-05-20 01:22:31 +0200
commit20fddd876cc2621d31dab4c99ea3e27827c79aee (patch)
treefba8184e6b8c758a13c30a9f6299c0e7a818092d /git-import-orig
parentd5664627241d5e91de8b0a151d508a32b946c503 (diff)
downloadgit-buildpackage-20fddd876cc2621d31dab4c99ea3e27827c79aee.tar.gz
git-buildpackage-20fddd876cc2621d31dab4c99ea3e27827c79aee.tar.bz2
git-buildpackage-20fddd876cc2621d31dab4c99ea3e27827c79aee.zip
raise GBPError in import_orig instead of checking the return value
Diffstat (limited to 'git-import-orig')
-rwxr-xr-xgit-import-orig17
1 files changed, 7 insertions, 10 deletions
diff --git a/git-import-orig b/git-import-orig
index 9c9255c3..0a4cbc9d 100755
--- a/git-import-orig
+++ b/git-import-orig
@@ -44,7 +44,7 @@ def unpack_orig(archive):
except gbpc.CommandExecFailed:
print "Unpacking of %s failed" % (archive,)
cleanup_tmp_tree(unpackArchive.dir)
- return
+ raise GbpError
return unpackArchive.dir
@@ -116,28 +116,25 @@ create it otherwise use --upstream-branch to specify it.
if version:
print "Upstream version is %s" % (version,)
else:
- print >>sys.stderr,"Cannot determine upstream version from %s - use -u" % archive
+ print >>sys.stderr, "Cannot determine upstream version from %s - use -u <version>" % archive
parser.print_help()
raise GbpError
(ret, out) = repo.is_clean()
if not ret:
- print >>sys.stderr, "Repository has uncommitted changes, commit them first: "
+ print >>sys.stderr, "Repository has uncommitted changes, commit these first: "
raise GbpError, out
tmpdir = unpack_orig(archive)
- if not tmpdir:
- raise GbpError
- else:
- if options.verbose:
- print "Unpacked orig to %s" % tmpdir
- origdir = glob.glob(tmpdir+'/*')[0]
+ if options.verbose:
+ print "Unpacked orig to %s" % tmpdir
+ orig_dir = glob.glob(tmpdir+'/*')[0]
try:
print "Importing %s to upstream branch..." % archive
gitCheckoutUpstream()
gitShowBranch()
- gbpc.GitLoadDirs(verbose=options.verbose)(dir=origdir,
+ gbpc.GitLoadDirs(verbose=options.verbose)(dir=orig_dir,
summary="Imported upstream version %s" % version)
gbpc.GitTag(options.sign_tags, options.keyid)(build_tag(options.upstream_tag, version),
msg="Upstream version %s" % version)