syncpackage: Fix extraction of upstream version for debian versions that

contain more than one dash.
This commit is contained in:
Benjamin Drung 2010-07-28 16:25:35 +02:00
parent 1e7993df3e
commit 477e6a9430
2 changed files with 19 additions and 2 deletions

4
debian/changelog vendored
View File

@ -13,6 +13,8 @@ ubuntu-dev-tools (0.101) UNRELEASED; urgency=low
[ Benjamin Drung ]
* Bump Standards-Version to 3.9.0 (no changes required).
* Switch to dpkg-source 3.0 (native) format.
* syncpackage: Fix extraction of upstream version for debian versions that
contain more than one dash.
[ Michael Bienia ]
* Add "import-bug-from-debian" written by James Westby.
@ -20,7 +22,7 @@ ubuntu-dev-tools (0.101) UNRELEASED; urgency=low
* requestsync: Fix bug where the variable 'hasLP' is not always set
(lp: #607874).
-- Michael Bienia <geser@ubuntu.com> Tue, 20 Jul 2010 19:44:18 +0200
-- Benjamin Drung <bdrung@ubuntu.com> Wed, 28 Jul 2010 16:23:58 +0200
ubuntu-dev-tools (0.100) maverick; urgency=low

View File

@ -151,6 +151,21 @@ def add_fixed_bugs(changes, bugs, verbose=False):
return "\n".join(changes + [""])
def extract_upstream_version(debian_version):
# remove last part separated by a dash (1.0-2 -> 1.0)
parts = debian_version.split('-')
if len(parts) > 1:
del parts[-1]
upstream_version = '-'.join(parts)
# remove epoch
parts = upstream_version.split(':')
if len(parts) > 1:
del parts[0]
upstream_version = ':'.join(parts)
return upstream_version
def sync_dsc(dscurl, debian_dist, release, name, email, bugs, keyid=None, verbose=False):
assert dscurl.endswith(".dsc")
dscname = os.path.basename(dscurl)
@ -238,7 +253,7 @@ def sync_dsc(dscurl, debian_dist, release, name, email, bugs, keyid=None, verbos
map(lambda f: f.download(verbose), fakesync_files)
# change into package directory
directory = srcpkg + '-' + strip_epoch(new_ver).split('-')[0]
directory = srcpkg + '-' + extract_upstream_version(new_ver)
if verbose:
print "cd " + directory
os.chdir(directory)