If importing lpbugs fails - show the right URL if package is new or not.

This commit is contained in:
Jonathan Davies 2009-01-10 20:22:57 +00:00
parent 4e476d4755
commit b82069f31b

View File

@ -90,6 +90,15 @@ def checkExistingReports(package, isNewPackage):
If found ask for confirmation on filing a request. If found ask for confirmation on filing a request.
""" """
# Determine if the package is new or not.
if isNewPackage:
# 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
try: try:
import launchpadbugs.connector as Connector import launchpadbugs.connector as Connector
except: except:
@ -98,20 +107,12 @@ def checkExistingReports(package, isNewPackage):
"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 "\
"manually check at:" "manually check at:"
print "- https://bugs.launchpad.net/ubuntu/+source/%s" % package print "-", bugListUrl
return return
# Connect to the bug list. # Connect to the bug list.
bugList = Connector.ConnectBugList() bugList = Connector.ConnectBugList()
if isNewPackage:
# 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. # Fetch data from Launchpad.
pkgBugList = bugList(bugListUrl) pkgBugList = bugList(bugListUrl)