From aafcbd082e7fdbfb9c63e2523e8f0d9adb61fa87 Mon Sep 17 00:00:00 2001 From: Stefano Rivera Date: Wed, 15 Feb 2012 15:05:46 +0200 Subject: [PATCH] sponsor-patch: Support syncs of new packages. --- debian/changelog | 4 +++- ubuntutools/sponsor_patch/bugtask.py | 12 +++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 0b4192d..dad1cba 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,7 +3,9 @@ ubuntu-dev-tools (0.139) UNRELEASED; urgency=low [ Stefano Rivera ] * syncpackage, backportpackage, sponsor-patch: Use -nc when building source packages. Avoids needing build-deps on the build machine. - * sponsor-patch: Determine the task from the UDD branch. + * sponsor-patch: + - Determine the task from the UDD branch. + - Support syncs of new packages. * Re-add dgetlp. Still needed for downloading source packages from +queue. (LP: #919805) * pbuilder-dist: Export DISTRIBUTION and ARCHITECTURE as well as DIST and diff --git a/ubuntutools/sponsor_patch/bugtask.py b/ubuntutools/sponsor_patch/bugtask.py index c88aa50..622e063 100644 --- a/ubuntutools/sponsor_patch/bugtask.py +++ b/ubuntutools/sponsor_patch/bugtask.py @@ -53,6 +53,12 @@ class BugTask(object): self.project = components[1].lower() self.series = components[2].lower() + if self.package is None: + title_re = '^Sync ([a-z0-9+.-]+) [a-z0-9.+:~-]+ \([a-z]+\) from.*' + match = re.match(title_re, self.get_bug_title(), re.U | re.I) + if match is not None: + self.package = match.group(1) + def download_source(self): source_files = self.get_source().sourceFileUrls() dsc_file = "" @@ -150,7 +156,11 @@ class BugTask(object): return debian.debian_support.Version(source_package_version) def get_latest_released_version(self): - version = self.get_source(True).source_package_version + source = self.get_source(True) + if source is None: # Not currently published in Ubuntu + version = '~' + else: + version = source.source_package_version return debian.debian_support.Version(version) def is_complete(self):