aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 6a60f9b..ba9dd0b 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 c88aa95..37e6d51 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)