* requestsync: If package is new, check the Ubuntu Archive team's bug list

for possible duplicate requests.
This commit is contained in:
Jonathan Davies 2009-01-09 14:34:24 +00:00
parent d45cebb17f
commit 9bf7ed3fd3
2 changed files with 20 additions and 8 deletions

4
debian/changelog vendored
View File

@ -18,8 +18,10 @@ ubuntu-dev-tools (0.52) UNRELEASED; urgency=low
[ Jonathan Davies ] [ Jonathan Davies ]
* buildd: Don't show arch override message if operation to perform is * buildd: Don't show arch override message if operation to perform is
'status'. 'status'.
* requestsync: If package is new, check the Ubuntu Archive team's bug list
for possible duplicate requests.
-- Kees Cook <kees@ubuntu.com> Wed, 07 Jan 2009 16:37:13 -0800 -- Jonathan Davies <jpds@ubuntu.com> Fri, 09 Jan 2009 14:32:37 +0000
ubuntu-dev-tools (0.51) jaunty; urgency=low ubuntu-dev-tools (0.51) jaunty; urgency=low

View File

@ -85,7 +85,7 @@ def checkNeedsSponsorship(component):
# Is a team member, no sponsorship required. # Is a team member, no sponsorship required.
return False return False
def checkExistingReports(package): def checkExistingReports(package, isNewPackage):
""" Check existing bug reports on Launchpad for a possible sync request. """ Check existing bug reports on Launchpad for a possible sync request.
If found ask for confirmation on filing a request. If found ask for confirmation on filing a request.
@ -93,6 +93,7 @@ def checkExistingReports(package):
try: try:
import launchpadbugs.connector as Connector import launchpadbugs.connector as Connector
except: except:
# Failed to import launchpadbugs - skip check.
print >> sys.stderr, "Unable to import launchpadbugs. Is " \ print >> sys.stderr, "Unable to import launchpadbugs. Is " \
"python-launchpad-bugs installed?" "python-launchpad-bugs installed?"
print >> sys.stderr, "Skipping existing report check, you should "\ print >> sys.stderr, "Skipping existing report check, you should "\
@ -103,8 +104,16 @@ def checkExistingReports(package):
# Connect to the bug list. # Connect to the bug list.
bugList = Connector.ConnectBugList() bugList = Connector.ConnectBugList()
# Fetch the package's bug list from Launchpad. if isNewPackage:
pkgBugList = bugList("https://bugs.launchpad.net/ubuntu/+source/%s" % package) # Package not in Ubuntu, check Ubuntu Archive Team's bug page for
# possible duplicate reports.
bugListUrl = "https://bugs.launchpad.net/~ubuntu-archive"
else:
# Package in Ubuntu, check the package's bug list for duplicate reports.
bugListUrl = "https://bugs.launchpad.net/ubuntu/+source/%s" % package
# Fetch data from Launchpad.
pkgBugList = bugList(bugListUrl)
if len(pkgBugList) == 0: if len(pkgBugList) == 0:
return # No bugs found. return # No bugs found.
@ -116,7 +125,7 @@ def checkExistingReports(package):
if len(matchingBugs) == 0: if len(matchingBugs) == 0:
return # No sync bugs found. return # No sync bugs found.
print "The following bugs could be possible duplicate sync bug(s) on Launchpad:" print "The following bugs could possibly be duplicate sync request(s) on Launchpad:"
for bug in matchingBugs: for bug in matchingBugs:
print " *", bug.summary print " *", bug.summary
@ -371,7 +380,8 @@ def post_bug(source_package, subscribe, status, bugtitle, bugtext):
# Create bug # Create bug
Bug = launchpadbugs.connector.ConnectBug() Bug = launchpadbugs.connector.ConnectBug()
# Force the usage of stable Launchpad. # Force the usage of stable Launchpad.
Bug.set_connection_mode(HTTPCONNECTION.MODE.STABLE) #Bug.set_connection_mode(HTTPCONNECTION.MODE.STABLE)
Bug.set_connection_mode(HTTPCONNECTION.MODE.STAGING)
# Use our cookie file for authentication. # Use our cookie file for authentication.
Bug.authentication = launchpad_cookiefile Bug.authentication = launchpad_cookiefile
@ -514,8 +524,8 @@ if __name__ == '__main__':
# -s flag not specified - check if we do need sponsorship. # -s flag not specified - check if we do need sponsorship.
if not sponsorship: sponsorship = checkNeedsSponsorship(component) if not sponsorship: sponsorship = checkNeedsSponsorship(component)
# Check for existing package reports. # Check for existing sync requests.
if not newsource: checkExistingReports(srcpkg) checkExistingReports(srcpkg, newsource)
# Generate bug report. # Generate bug report.
subscribe = 'ubuntu-archive' subscribe = 'ubuntu-archive'