mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-05-07 23:11:29 +00:00
import-bug-from-debian: Bugs are filed against source packages in Ubuntu.
(LP: #844734)
This commit is contained in:
parent
1dda02513c
commit
3a07cf4a74
2
debian/changelog
vendored
2
debian/changelog
vendored
@ -2,6 +2,8 @@ ubuntu-dev-tools (0.131) UNRELEASED; urgency=low
|
|||||||
|
|
||||||
* doc/requestsync.1: Correct default value for REQUESTSYNC_SMTP_SERVER
|
* doc/requestsync.1: Correct default value for REQUESTSYNC_SMTP_SERVER
|
||||||
(LP: #844992)
|
(LP: #844992)
|
||||||
|
* import-bug-from-debian: Bugs are filed against source packages in Ubuntu.
|
||||||
|
(LP: #844734)
|
||||||
|
|
||||||
-- Stefano Rivera <stefanor@debian.org> Thu, 08 Sep 2011 23:13:05 +0200
|
-- Stefano Rivera <stefanor@debian.org> Thu, 08 Sep 2011 23:13:05 +0200
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
# -*- coding: UTF-8 -*-
|
# -*- coding: UTF-8 -*-
|
||||||
|
|
||||||
# Copyright © 2009 James Westby <james.westby@ubuntu.com>,
|
# Copyright © 2009 James Westby <james.westby@ubuntu.com>,
|
||||||
# 2010 Stefano Rivera <stefanor@ubuntu.com>
|
# 2010, 2011 Stefano Rivera <stefanor@ubuntu.com>
|
||||||
#
|
#
|
||||||
# ##################################################################
|
# ##################################################################
|
||||||
#
|
#
|
||||||
@ -25,18 +25,18 @@
|
|||||||
from optparse import OptionParser, SUPPRESS_HELP
|
from optparse import OptionParser, SUPPRESS_HELP
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
|
import webbrowser
|
||||||
|
|
||||||
|
from devscripts.logger import Logger
|
||||||
try:
|
try:
|
||||||
import SOAPpy
|
import SOAPpy
|
||||||
except ImportError:
|
except ImportError:
|
||||||
print >> sys.stderr, ("Please install 'python-soappy' in order to use "
|
Logger.error("Please install 'python-soappy' in order to use this utility.")
|
||||||
"this utility.")
|
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
from launchpadlib.launchpad import Launchpad
|
from launchpadlib.launchpad import Launchpad
|
||||||
|
|
||||||
from ubuntutools.config import UDTConfig
|
from ubuntutools.config import UDTConfig
|
||||||
from ubuntutools import subprocess
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
bug_re = re.compile(r"bug=(\d+)")
|
bug_re = re.compile(r"bug=(\d+)")
|
||||||
@ -73,12 +73,7 @@ def main():
|
|||||||
if options.lpinstance is None:
|
if options.lpinstance is None:
|
||||||
options.lpinstance = config.get_value("LPINSTANCE")
|
options.lpinstance = config.get_value("LPINSTANCE")
|
||||||
|
|
||||||
try:
|
launchpad = Launchpad.login_with("ubuntu-dev-tools", options.lpinstance)
|
||||||
launchpad = Launchpad.login_with("ubuntu-dev-tools", options.lpinstance)
|
|
||||||
except IOError, msg:
|
|
||||||
print msg
|
|
||||||
print "No credentials, can't continue"
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
debian = launchpad.distributions['debian']
|
debian = launchpad.distributions['debian']
|
||||||
ubuntu = launchpad.distributions['ubuntu']
|
ubuntu = launchpad.distributions['ubuntu']
|
||||||
@ -91,7 +86,8 @@ def main():
|
|||||||
# bug URL
|
# bug URL
|
||||||
match = bug_re.search(bug_num)
|
match = bug_re.search(bug_num)
|
||||||
if match is None:
|
if match is None:
|
||||||
raise ValueError("Can't determine bug number from %s" % bug_num)
|
Logger.error("Can't determine bug number from %s", bug_num)
|
||||||
|
sys.exit(1)
|
||||||
bug_num = match.groups()[0]
|
bug_num = match.groups()[0]
|
||||||
bug_num = bug_num.lstrip("#")
|
bug_num = bug_num.lstrip("#")
|
||||||
bug_num = int(bug_num)
|
bug_num = int(bug_num)
|
||||||
@ -102,11 +98,13 @@ def main():
|
|||||||
if len(bug_nums) > 1:
|
if len(bug_nums) > 1:
|
||||||
bugs = bugs[0]
|
bugs = bugs[0]
|
||||||
|
|
||||||
#import pdb; pdb.set_trace()
|
if not bugs:
|
||||||
|
Logger.error("Cannot find any of the listed bugs")
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
for bug in bugs:
|
for bug in bugs:
|
||||||
bug = bug.value
|
bug = bug.value
|
||||||
package = bug.package
|
ubupackage = package = bug.source
|
||||||
ubupackage = package
|
|
||||||
if options.package:
|
if options.package:
|
||||||
ubupackage = options.package
|
ubupackage = options.package
|
||||||
bug_num = bug.bug_num
|
bug_num = bug.bug_num
|
||||||
@ -114,6 +112,12 @@ def main():
|
|||||||
log = debbugs.get_bug_log(bug_num)
|
log = debbugs.get_bug_log(bug_num)
|
||||||
summary = log[0][0]
|
summary = log[0][0]
|
||||||
target = ubuntu.getSourcePackage(name=ubupackage)
|
target = ubuntu.getSourcePackage(name=ubupackage)
|
||||||
|
if target is None:
|
||||||
|
Logger.error("Source package '%s' is not in Ubuntu. Please specify "
|
||||||
|
"the destination source package with --package",
|
||||||
|
ubupackage)
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
u_bug = launchpad.bugs.createBug(target=target, title=subject,
|
u_bug = launchpad.bugs.createBug(target=target, title=subject,
|
||||||
description='Imported from Debian bug '
|
description='Imported from Debian bug '
|
||||||
'http://bugs.debian.org/%d:\n\n%s'
|
'http://bugs.debian.org/%d:\n\n%s'
|
||||||
@ -125,74 +129,9 @@ def main():
|
|||||||
d_watch = u_bug.addWatch(remote_bug=bug_num, bug_tracker=lp_debbugs)
|
d_watch = u_bug.addWatch(remote_bug=bug_num, bug_tracker=lp_debbugs)
|
||||||
d_task.bug_watch = d_watch
|
d_task.bug_watch = d_watch
|
||||||
d_task.lp_save()
|
d_task.lp_save()
|
||||||
print "Opened %s" % u_bug.web_link
|
Logger.normal("Opened %s", u_bug.web_link)
|
||||||
if not options.browserless:
|
if not options.browserless:
|
||||||
subprocess.call(["xdg-open", u_bug.web_link])
|
webbrowser.open(u_bug.web_link)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main()
|
main()
|
||||||
|
|
||||||
#def get_status(*args):
|
|
||||||
# result = server.get_status(*args)
|
|
||||||
# return result
|
|
||||||
#
|
|
||||||
#def get_bugs(*args):
|
|
||||||
# result = server.get_bugs(*args)
|
|
||||||
# return result
|
|
||||||
#
|
|
||||||
#def get_usertag(email, *tags):
|
|
||||||
# result = server.get_usertag(email, *tags)
|
|
||||||
# return result
|
|
||||||
#
|
|
||||||
#def get_bug_log(bugnumber):
|
|
||||||
# result = server.get_bug_log(bugnumber)
|
|
||||||
# return result
|
|
||||||
#
|
|
||||||
#def newest_bugs(amount):
|
|
||||||
# result = server.newest_bugs(amount)
|
|
||||||
# return result
|
|
||||||
#
|
|
||||||
#if __name__ == "__main__":
|
|
||||||
# # Demonstration
|
|
||||||
#
|
|
||||||
# # some debug output
|
|
||||||
#
|
|
||||||
# # All bugs from one package (returns a list of bugnumbers)
|
|
||||||
# print get_bugs("package", "gtk-qt-engine")
|
|
||||||
#
|
|
||||||
# # All bugs of a maintainer
|
|
||||||
# print get_bugs("maint", "debian-qa@lists.debian.org")
|
|
||||||
#
|
|
||||||
# # returns the status of those bugs
|
|
||||||
# print get_status(409909, 419920, 421581, 417044, 397993)
|
|
||||||
#
|
|
||||||
# # get_status and get_bugs combined:
|
|
||||||
# print get_status(get_bugs("package", "gtk-qt-engine"))
|
|
||||||
#
|
|
||||||
# # returns the full log for the given bug number
|
|
||||||
# print get_bug_log(202526)
|
|
||||||
#
|
|
||||||
# # retrives the newest 20 bugs
|
|
||||||
# print newest_bugs(20)
|
|
||||||
#
|
|
||||||
# # All bugs of a maintainer
|
|
||||||
# print get_bugs("maint", "debian-qa@lists.debian.org")
|
|
||||||
#
|
|
||||||
# # returns the status of those bugs
|
|
||||||
# print get_status(409909, 419920, 421581, 417044, 397993)
|
|
||||||
#
|
|
||||||
# # get_status and get_bugs combined:
|
|
||||||
# print get_status(get_bugs("package", "gtk-qt-engine"))
|
|
||||||
#
|
|
||||||
# # returns the full log for the given bug number
|
|
||||||
# print get_bug_log(202526)
|
|
||||||
#
|
|
||||||
# # retrives the newest 20 bugs
|
|
||||||
# print newest_bugs(20)
|
|
||||||
#
|
|
||||||
# # returns bugs tagged by the given email
|
|
||||||
# print get_usertag("debian-qa@lists.debian.org")
|
|
||||||
#
|
|
||||||
# # returns bugs tagged by the given email, with the given tag
|
|
||||||
# print get_usertag("debian-qa@lists.debian.org", "qa-ftbfs-20070708")
|
|
||||||
#
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user