* requestsync: Check for already existing sync requests before filing a new

one.
This commit is contained in:
Jonathan Patrick Davies 2008-09-01 22:29:32 +01:00
parent cbfdaaea55
commit 806beacb51
3 changed files with 36 additions and 2 deletions

2
debian/changelog vendored
View File

@ -9,6 +9,8 @@ ubuntu-dev-tools (0.43ubuntu2) UNRELEASED; urgency=low
- Wrapped Depends line and bumped debhelper build-dependency version to 6. - Wrapped Depends line and bumped debhelper build-dependency version to 6.
* debian/compat: Changed to 6. * debian/compat: Changed to 6.
* Moved https_proxy dropping code to common.py. * Moved https_proxy dropping code to common.py.
* requestsync: Check for already existing sync requests before filing a new
one.
-- Colin Watson <cjwatson@ubuntu.com> Mon, 01 Sep 2008 09:48:38 +0100 -- Colin Watson <cjwatson@ubuntu.com> Mon, 01 Sep 2008 09:48:38 +0100

View File

@ -138,4 +138,7 @@ def main():
sys.exit(0) sys.exit(0)
if __name__ == "__main__": if __name__ == "__main__":
try:
main() main()
except KeyboardInterrupt:
print "Operation was interrupted by user."

View File

@ -73,7 +73,7 @@ def checkNeedsSponsorship(component):
"the '%s'\nteam, who shall be subscribed to this bug report." % sponsor "the '%s'\nteam, who shall be subscribed to this bug report." % sponsor
print "This must be done before it can be processed by a member of " \ print "This must be done before it can be processed by a member of " \
"the Ubuntu Archive team." "the Ubuntu Archive team."
print "Should the above be incorrect, please press Control-C now to " \ print "Should the above be incorrect, please press Ctrl-C now to " \
"stop this script now\nand check the cookie file at:", launchpad_cookiefile "stop this script now\nand check the cookie file at:", launchpad_cookiefile
raw_input_exit_on_ctrlc() # Abort if necessary. raw_input_exit_on_ctrlc() # Abort if necessary.
return True # Sponsorship required. return True # Sponsorship required.
@ -81,6 +81,33 @@ def checkNeedsSponsorship(component):
# Is a team member, no sponsorship required. # Is a team member, no sponsorship required.
return False return False
def checkExistingReports(package):
""" Check existing bug reports on Launchpad for a possible sync request.
If found ask for confirmation on filing a request.
"""
import launchpadbugs.connector as Connector
# Connect to the bug list.
bugList = Connector.ConnectBugList()
# Fetch the package bug list from Launchpad.
pkgBugList = bugList("https://bugs.launchpad.net/ubuntu/+source/%s" % package)
if len(pkgBugList) == 0:
return # No bugs found.
for bug in pkgBugList:
# See if Please sync package is in the bug summary.
if ("Please sync %s" % package) in bug.summary:
print "A bug with the title: '%s' has been found on Launchpad." % bug.summary
print "Please see the following URL to verify this before filing a " \
"duplicate report:"
print " -", bug.url
print "Press Ctrl-C to stop filing the bug report now, otherwise " \
"please press enter."
raw_input_exit_on_ctrlc()
def cur_version_component(sourcepkg, release): def cur_version_component(sourcepkg, release):
'''Determine current package version in ubuntu.''' '''Determine current package version in ubuntu.'''
madison = subprocess.Popen(['rmadison', '-u', 'ubuntu', '-a', 'source', \ madison = subprocess.Popen(['rmadison', '-u', 'ubuntu', '-a', 'source', \
@ -451,6 +478,8 @@ if __name__ == '__main__':
print 'The versions in Debian and Ubuntu are the same already (%s). Aborting.' % (deb_version,) print 'The versions in Debian and Ubuntu are the same already (%s). Aborting.' % (deb_version,)
sys.exit(1) sys.exit(1)
checkExistingReports(srcpkg)
# generate bug report # generate bug report
subscribe = 'ubuntu-archive' subscribe = 'ubuntu-archive'
status = 'confirmed' status = 'confirmed'