diff options
author | Guido Guenther <agx@sigxcpu.org> | 2006-11-03 17:24:00 +0100 |
---|---|---|
committer | Guido Guenther <agx@bogon.sigxcpu.org> | 2006-11-03 17:24:00 +0100 |
commit | 7aa6ff42c4b0cebff45ee15e46765914edaf817f (patch) | |
tree | e2f87cff5e9d65434406b63e028ee0fe00d0696b /git-import-dsc | |
parent | 700bb61a80c24768d6ed2b2fa1e5560e320a4f28 (diff) | |
download | git-buildpackage-7aa6ff42c4b0cebff45ee15e46765914edaf817f.tar.gz git-buildpackage-7aa6ff42c4b0cebff45ee15e46765914edaf817f.tar.bz2 git-buildpackage-7aa6ff42c4b0cebff45ee15e46765914edaf817f.zip |
don't use a regexp for version parsing on import
Diffstat (limited to 'git-import-dsc')
-rw-r--r--[-rwxr-xr-x] | git-import-dsc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/git-import-dsc b/git-import-dsc index 8907c56c..d40d6c48 100755..100644 --- a/git-import-dsc +++ b/git-import-dsc @@ -35,8 +35,7 @@ gitTag=GitTag() class DscPackage(object): """Parse the dsc file for verions, package names, etc""" pkgre=re.compile('Source:\s+(?P<pkg>.+)\s*') - versionre=re.compile("Version:\s(\d+\:)?(?P<upstream>[%s]+)(-(?P<debian>[%s]+))?\s*$" % - (debian_version_chars, debian_version_chars)) + versionre=re.compile("Version:\s(\d+\:)?(?P<version>[%s]+)\s*$" % (debian_version_chars,)) tarre=re.compile('^\s\w+\s\d+\s+(?P<tar>[^_]+_[^_]+(\.orig)?\.tar\.(gz|bz2))') def __init__(self, dscfile): @@ -45,15 +44,16 @@ class DscPackage(object): for line in f: m=self.versionre.match(line) if m: - self.upstream_version = m.group('upstream') - if m.group('debian'): - self.debian_version = m.group('debian') + if '-' in m.group('version'): + self.debian_version = m.group('version').split("-")[-1] + self.upstream_version = "-".join(m.group('version').split("-")[0:-1]) self.native = False print "Upstream version:", self.upstream_version print "Debian version:", self.debian_version else: print "Debian Native Package" self.native = True # Debian native package + upstream_version=m.group('version') print "Version:", self.upstream_version continue m=self.pkgre.match(line) |