Merge lp://staging/~sense/apport/ubuntu-bugpatterns into lp://staging/~ubuntu-bugcontrol/apport/ubuntu-bugpatterns

Proposed by Sense Egbert Hofstede
Status: Merged
Merged at revision: not available
Proposed branch: lp://staging/~sense/apport/ubuntu-bugpatterns
Merge into: lp://staging/~ubuntu-bugcontrol/apport/ubuntu-bugpatterns
Diff against target: 64 lines (+22/-13)
2 files modified
nautilus.xml (+8/-0)
search-bugs (+14/-13)
To merge this branch: bzr merge lp://staging/~sense/apport/ubuntu-bugpatterns
Reviewer Review Type Date Requested Status
Brian Murray Approve
Review via email: mp+18767@code.staging.launchpad.net
To post a comment you must log in.
Revision history for this message
Sense Egbert Hofstede (sense) wrote :

* Wrote a pattern for LP: #362342
* Some optparse fixes for ./search-bugs
** Now search-bugs only connects to LP after parsing the options, this allows people to do ./search-bugs --help without having to authenticate right away
** Fix metavars and use them in the help texts
** Extended the usage text to include the two required variables

Revision history for this message
Brian Murray (brian-murray) wrote :

Looks great, thanks! I'll merge this shortly.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'nautilus.xml'
2--- nautilus.xml 1970-01-01 00:00:00 +0000
3+++ nautilus.xml 2010-02-06 18:10:26 +0000
4@@ -0,0 +1,8 @@
5+<?xml version="1.0"?>
6+
7+<patterns>
8+ <pattern url="https://launchpad.net/bugs/362342">
9+ <re key="Stacktrace">#0 .*g_list_remove.*\s*/lib/libglib-2\.0\.so\.0</re>
10+ <re key="Title">nautilus crashed with SIGSEGV in g_list_remove()</re>
11+ </pattern>
12+</patterns>
13
14=== modified file 'search-bugs'
15--- search-bugs 2009-11-30 23:22:06 +0000
16+++ search-bugs 2010-02-06 18:10:26 +0000
17@@ -34,7 +34,7 @@
18 credentials = Credentials()
19 credentials.load(open(credfile))
20 launchpad = Launchpad(credentials, root, cachedir)
21- except:
22+ except IOError:
23 launchpad = Launchpad.get_token_and_login(sys.argv[0], root, cachedir)
24 credfd = tempfile.NamedTemporaryFile(dir=os.path.dirname(credfile))
25 launchpad.credentials.save(credfd)
26@@ -57,19 +57,20 @@
27 bug.markAsDuplicate(duplicate_of=master)
28 print 'Modified LP: #%s' % ( task.bug.id )
29
30+parser = optparse.OptionParser(usage="usage: %prog -p PACKAGE -t TAGS [options]")
31+parser.add_option("-p", "--package", help="Filter on PACKAGE", dest="package", metavar="PACKAGE")
32+parser.add_option("-s", "--status", help="Filter on STATUS", dest="status", metavar="STATUS")
33+parser.add_option("-t", "--tags", help="Filter on TAGS", dest="tags", metavar="TAGS")
34+parser.add_option("-d", "--dupes", help="Include duplicates in search", dest="dupes", action="store_true")
35+parser.add_option("-q", "--quiet", help="Only print bug numbers", dest="quiet", action="store_true")
36+parser.add_option("-k", "--keywords", help="Search for KEYWORDS", dest="keywords", metavar="KEYWORDS")
37+parser.add_option("-C", "--consolidate", help="Mark bugs as duplicate of master bug in pattern", dest="consolidate", action="store_true")
38+
39+(opt, args) = parser.parse_args()
40+
41+# Connect to Launchpad
42 lp = connect()
43
44-parser = optparse.OptionParser()
45-parser.add_option("-p", "--package", help="Filter on package", metavar="PACKAGE")
46-parser.add_option("-s", "--status", help="Filter on status", metavar="STATUS")
47-parser.add_option("-t", "--tags", help="Filter on tag(s)", metavar="TAGS")
48-parser.add_option("-d", "--dupes", help="Include duplicates in search", action="store_true")
49-parser.add_option("-q", "--quiet", help="Only print bug numbers", action="store_true")
50-parser.add_option("-k", "--keywords", help="Search using string", metavar="keywords")
51-parser.add_option("-C", "--consolidate", help="Mark bugs as duplicate of master bug in pattern", action="store_true")
52-
53-(opt, args) = parser.parse_args()
54-
55 status_list = []
56 tags_list = []
57 ubuntu = lp.distributions['ubuntu']
58@@ -138,5 +139,5 @@
59 print 'LP: #%s is already a duplicate of another bug' % (bug.id)
60 break
61 mark_as_duplicate(master_number, task.bug)
62- if match and opt.quiet:
63+ elif match and opt.quiet:
64 print '%s' % ( task.bug.id )