print a sensible error message, when a git repository isn't a debian source package
authorGuido Guenther <agx@sigxcpu.org>
Fri, 8 Jun 2007 14:51:04 +0000 (16:51 +0200)
committerGuido Guenther <agx@sigxcpu.org>
Fri, 8 Jun 2007 14:51:04 +0000 (16:51 +0200)
git-buildpackage

index 550d36b044aa6b281e9d1e01bdfbd8fc4426197f..6817a820cd222032bdfa28d1062437069fc0fdc8 100755 (executable)
@@ -50,6 +50,7 @@ def create_orig(cp, output_dir, branch):
 
 def main(argv):
     output_dir = '..'
+    changelog = 'debian/changelog'
 
     args = [ arg for arg in argv[1:] if arg.find('--git-') == 0 ]
     dpkg_args = [ arg for arg in argv[1:] if arg.find('--git-') == -1 ]
@@ -105,7 +106,9 @@ def main(argv):
             print >>sys.stderr, "You are not on branch '%s' but on '%s'" % (options.debian_branch, branch)
             raise GbpError, "Use --git-ignore-new to ignore or --git-debian-branch to set the branch name."
 
-        cp = parse_changelog('debian/changelog')
+        cp = parse_changelog(changelog)
+        if not cp:
+            raise GbpError,"'%s' does not exist, not a debian package" % changelog
         if not is_native(cp) and not has_orig(cp, output_dir):
             print "%s does not exist, creating from branch '%s'" % (orig_file(cp), options.upstream_branch)
             if not repo.has_branch(options.upstream_branch):