From e139944b3a564fbce407ffebffc66ce8ad559509 Mon Sep 17 00:00:00 2001 From: Michael Bienia Date: Sat, 27 Jun 2009 11:58:05 +0200 Subject: [PATCH] * lpapiwrapper.py: canUploadPackage(): Assume 'universe' as component if the package doesn't exist (yet) in Ubuntu (needed for checking sponsorship when requesting syncs of new packages). * requestsync: use canUploadPackage() from LpApiWrapper --- debian/changelog | 6 ++++-- requestsync | 2 +- ubuntutools/lp/lpapiwrapper.py | 9 +++++++-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index 70cc978..1c11558 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,7 +2,9 @@ ubuntu-dev-tools (0.75) UNRELEASED; urgency=low [ Michael Bienia ] * buildd: - + Use the LP API for retrying or rescoring builds. + - Use the LP API for retrying or rescoring builds. + * requestsync: + - Fix check for sponsorship when a new package should get synced. [ Jonathan Davies ] * update-maintainer: @@ -49,7 +51,7 @@ ubuntu-dev-tools (0.75) UNRELEASED; urgency=low * requestsync: We need to use the output from madison, not just throw it away. - -- Iain Lane Mon, 15 Jun 2009 19:17:51 +0100 + -- Michael Bienia Sat, 27 Jun 2009 11:56:08 +0200 ubuntu-dev-tools (0.74) karmic; urgency=low diff --git a/requestsync b/requestsync index 9d58ca5..527359b 100755 --- a/requestsync +++ b/requestsync @@ -55,7 +55,7 @@ def checkNeedsSponsorship(srcpkg): If they are in the ~ubuntu-core-dev team, no sponsorship required. """ - if not lp_functions.canUploadPackage(srcpkg): + if not LpApiWrapper.canUploadPackage(srcpkg): print "You are not able to upload this package directly to Ubuntu.\n" \ "Your sync request shall require an approval by a member of " \ diff --git a/ubuntutools/lp/lpapiwrapper.py b/ubuntutools/lp/lpapiwrapper.py index 12fd1dc..0ec4a0f 100644 --- a/ubuntutools/lp/lpapiwrapper.py +++ b/ubuntutools/lp/lpapiwrapper.py @@ -176,7 +176,8 @@ class LpApiWrapper(object): per-package upload rights. 'package' can either be a LP representation of a source package - or a string and an Ubuntu series. + or a string and an Ubuntu series. If 'package' doesn't exist + yet in Ubuntu assume 'universe' for component. ''' if isinstance(package, Entry): @@ -187,7 +188,11 @@ class LpApiWrapper(object): # Fall-back to current Ubuntu development series series = cls.getUbuntuDevelopmentSeries() - component = cls.getUbuntuSourcePackage(package, series).component_name + try: + component = cls.getUbuntuSourcePackage(package, series).component_name + except PackageNotFoundException: + # Probably a new package, assume "universe" as component + component = 'universe' if component not in cls._upload_comp and package not in cls._upload_pkg: me = cls.getMe()