From d614cabff775a9e593d7392d0c03beae8281d1c5 Mon Sep 17 00:00:00 2001 From: Daniel Holbach Date: Wed, 12 Sep 2007 16:27:54 +0200 Subject: [PATCH] * revuput: deal with the case of NEW packages. * hugdaylist: added a tool to write Wiki lists of bugs in as in https://wiki.ubuntu.com/UbuntuBugDay/20070912 --- debian/changelog | 6 +++++ debian/control | 2 +- hugdaylist | 68 ++++++++++++++++++++++++++++++++++++++++++++++++ revuput | 25 +++++++++++++----- setup.py | 3 ++- 5 files changed, 95 insertions(+), 9 deletions(-) create mode 100755 hugdaylist diff --git a/debian/changelog b/debian/changelog index 9921e5d..d430ace 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,7 +1,13 @@ ubuntu-dev-tools (0.7) UNRELEASED; urgency=low + [Colin Watson] * Fix *roff use (hyphens vs. dashes, start each sentence on a new line). + [Daniel Holbach] + * revuput: deal with the case of NEW packages. + * hugdaylist: added a tool to write Wiki lists of bugs in as + in https://wiki.ubuntu.com/UbuntuBugDay/20070912 + -- Colin Watson Wed, 12 Sep 2007 09:28:54 +0100 ubuntu-dev-tools (0.6) gutsy; urgency=low diff --git a/debian/control b/debian/control index 4dc9427..3097a6a 100644 --- a/debian/control +++ b/debian/control @@ -12,7 +12,7 @@ Standards-Version: 3.7.2 Package: ubuntu-dev-tools Architecture: all Section: devel -Depends: ${python:Depends}, ${misc:Depends}, binutils, devscripts, sudo, python-launchpad-bugs (>= 0.2.9) +Depends: ${python:Depends}, ${misc:Depends}, binutils, devscripts, sudo, python-launchpad-bugs (>= 0.2.14) Recommends: bzr, pbuilder Conflicts: devscripts (<< 2.10.7ubuntu5) Replaces: devscripts (<< 2.10.7ubuntu5) diff --git a/hugdaylist b/hugdaylist new file mode 100755 index 0000000..51d726e --- /dev/null +++ b/hugdaylist @@ -0,0 +1,68 @@ +#!/usr/bin/python +# +# Copyright 2007, Canonical, Daniel Holbach +# +# GPL 3 +# +# hugdaylist +# - produces lists like https://wiki.ubuntu.com/UbuntuBugDay/20070912?action=raw +# +# hugdaylist -n +# - will only list URLs +# + +import re +import os +import sys +import string + +try: + import launchpadbugs.connector as Connector +except: + print >> sys.stderr, \ + "You need python-launchpad-bugs (>= 0.2.9) installed to use hugdaylist." + sys.exit(1) + + +USAGE = "hugdaylist [-n ] " + +def check_args(): + howmany = -1 + url = "" + + if len(sys.argv) < 2: + print >> sys.stderr, USAGE + sys.exit(1) + + if sys.argv[1] == "-n": + howmany = int(sys.argv[2]) + url = sys.argv[3] + else: + url = sys.argv[1] + + return (howmany, url) + +def main(): + + (howmany, url) = check_args() + + BugList = Connector.ConnectBugList() + l = BugList(url) + + if not l.bugs: + print "BugList of %s is empty." % url + sys.exit(0) + + if howmany == -1: + howmany = len(l.bugs) + + print "|| Bug || Subject || Triager ||" + + for i in list(l.bugs)[:howmany]: + print '|| [%s %s] || %s || ||' % \ + (i.url, i.bugnumber, i.summary) + + +if __name__ == '__main__': + main() + diff --git a/revuput b/revuput index 04b74f9..bd9c471 100755 --- a/revuput +++ b/revuput @@ -1,12 +1,12 @@ #!/usr/bin/python # -# Copyright 2007, Canonical +# Copyright 2007, Canonical, Daniel Holbach # # GPL 3 # # # Notes: -# - needs dput, python-launchpad-bugs (>= 0.2.9) +# - needs dput, python-launchpad-bugs (>= 0.2.14) # - needs http://launchpad.net/bugs/137767 to get fixed # # @@ -28,7 +28,7 @@ try: import launchpadbugs.connector as Connector except: print >> sys.stderr, \ - "You need python-launchpad-bugs (>= 0.2.9) installed to use revuput." + "You need python-launchpad-bugs (>= 0.2.14) installed to use revuput." sys.exit(1) #try: @@ -150,6 +150,8 @@ def deal_with_bugreport(bugnumbers, host, incoming, sourcepackage, version): if component in ["universe", "multiverse"] and \ 'ubuntu-universe-sponsors' not in [str(s) for s in bug.subscribers]: bug.subscribers.add('ubuntu-universe-sponsors') + if not component: + bug.tags.append("needs-packaging") comment = Bug.NewComment(text=assemble_bug_comment_text(host, incoming, sourcepackage, version), @@ -198,10 +200,18 @@ def file_bug(sourcepackage, version): Bug = Connector.ConnectBug() Bug.authentication = os.path.expanduser("~/.lpcookie") - bug = Bug.New(product={"name": sourcepackage, "target": "ubuntu"}, - summary="Please sponsor %s %s" % (sourcepackage, version), - description=\ - "The new package will be uploaded to PPA shortly.") + try: + bug = Bug.New(product={"name": sourcepackage, "target": "ubuntu"}, + summary="Please sponsor %s %s" % \ + (sourcepackage, version), + description=\ + "The new package will be uploaded to PPA shortly.") + except: + bug = Bug.New(product={"name": "ubuntu"}, + summary="Please sponsor %s %s" % \ + (sourcepackage, version), + description=\ + "The new package will be uploaded to PPA shortly.") print "Successfully filed bug %s: http://launchpad.net/bugs/%s" % \ (bug.bugnumber, bug.bugnumber) @@ -228,6 +238,7 @@ def main(): host = lookup_dput_host(location) (dput_res, incoming) = call_dput(location, changesfile) if not dput_res: + print >> sys.stderr, "%s was not uploaded." % changesfile sys.exit(1) fixed_lp_bugs = find_fixed_launchpad_bug(changesfile) diff --git a/setup.py b/setup.py index da89349..bef997f 100755 --- a/setup.py +++ b/setup.py @@ -26,7 +26,8 @@ setup(name='ubuntu-dev-tools', 'what-patch', 'suspicious-source', 'revuput', - 'requestsync' + 'requestsync', + 'hugdaylist' ], )