summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2009-12-13 22:09:23 +0100
committerGuido Günther <agx@sigxcpu.org>2009-12-13 22:22:09 +0100
commitbcdd6b558808b0fda4221f14eb0584de62bb2d9d (patch)
tree72e999c96602770ea9c7a7f2f3adf15827a9a078
parentdce995dcb2daad2a7db50d26b798aaffc931ad4d (diff)
downloadgit-buildpackage-bcdd6b558808b0fda4221f14eb0584de62bb2d9d.tar.gz
git-buildpackage-bcdd6b558808b0fda4221f14eb0584de62bb2d9d.tar.bz2
git-buildpackage-bcdd6b558808b0fda4221f14eb0584de62bb2d9d.zip
Improve error message when trying to import 3.0 source format packages
until we properly support them.
-rw-r--r--gbp/deb.py6
-rwxr-xr-xgit-import-dsc2
2 files changed, 8 insertions, 0 deletions
diff --git a/gbp/deb.py b/gbp/deb.py
index 6a60f9b5..ba9dd0be 100644
--- a/gbp/deb.py
+++ b/gbp/deb.py
@@ -32,11 +32,13 @@ class DscFile(object):
version_re = re.compile("Version:\s((?P<epoch>\d+)\:)?(?P<version>[%s]+)\s*$" % debian_version_chars)
tar_re = re.compile('^\s\w+\s\d+\s+(?P<tar>[^_]+_[^_]+(\.orig)?\.tar\.(gz|bz2))')
diff_re = re.compile('^\s\w+\s\d+\s+(?P<diff>[^_]+_[^_]+\.diff.(gz|bz2))')
+ format_re = re.compile('Format:\s+(?P<format>[0-9.]+)\s*')
def __init__(self, dscfile):
self.pkg = ""
self.tgz = ""
self.diff = ""
+ self.pkgformat = "1.0"
self.debian_version = ""
self.upstream_version = ""
self.native = False
@@ -71,6 +73,10 @@ class DscFile(object):
if m:
self.diff = os.path.join(fromdir, m.group('diff'))
continue
+ m = self.format_re.match(line)
+ if m:
+ self.pkgformat = m.group('format')
+ continue
f.close()
if not self.pkg:
diff --git a/git-import-dsc b/git-import-dsc
index c88aa951..37e6d518 100755
--- a/git-import-dsc
+++ b/git-import-dsc
@@ -152,6 +152,8 @@ def main(argv):
raise GbpError
else:
src = parse_dsc(args[0])
+ if src.pkgformat != '1.0':
+ raise GbpError, "Importing %s source format not yet supported." % src.pkgformat
if options.verbose:
print_dsc(src)