Merge lp:~stefanor/ubuntu-dev-tools/reportbug-config-800429 into lp:~ubuntu-dev/ubuntu-dev-tools/trunk

Proposed by Stefano Rivera
Status: Merged
Merged at revision: 1109
Proposed branch: lp:~stefanor/ubuntu-dev-tools/reportbug-config-800429
Merge into: lp:~ubuntu-dev/ubuntu-dev-tools/trunk
Diff against target: 73 lines (+44/-0)
2 files modified
debian/changelog (+2/-0)
submittodebian (+42/-0)
To merge this branch: bzr merge lp:~stefanor/ubuntu-dev-tools/reportbug-config-800429
Reviewer Review Type Date Requested Status
Ubuntu Development Team Pending
Review via email: mp+65466@code.launchpad.net

Description of the change

We could just shell out to reportbug --configure, but this is probably more appropriate for new users, right?

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2011-06-16 19:02:04 +0000
3+++ debian/changelog 2011-06-22 10:19:25 +0000
4@@ -10,6 +10,8 @@
5 guessing at the cause. (LP: #788447)
6 * sponsor-patch: Use dch --release instead of --edit to work with
7 DEBCHANGE_RELEASE_HEURISTIC=changelog.
8+ * submittodebian: Write a usable .reportbugrc if it doesn't exist.
9+ (LP: #800429)
10
11 [ Dustin Kirkland ]
12 * doc/lp-project-upload.1, lp-project-upload:
13
14=== modified file 'submittodebian'
15--- submittodebian 2011-01-21 18:20:04 +0000
16+++ submittodebian 2011-06-22 10:19:25 +0000
17@@ -25,6 +25,8 @@
18 import re, os, sys
19 from tempfile import mkstemp
20
21+from ubuntutools.config import ubu_email
22+from ubuntutools.question import YesNoQuestion
23 from ubuntutools.distro_info import UbuntuDistroInfo
24
25 try:
26@@ -119,7 +121,47 @@
27 print "%s\n" % cmd
28 os.system(cmd)
29
30+def check_reportbug_config():
31+ fn = os.path.expanduser('~/.reportbugrc')
32+ if os.path.exists(fn):
33+ return
34+ email = ubu_email()[1]
35+ reportbugrc = """# Reportbug configuration generated by submittodebian(1)
36+# See reportbug.conf(5) for the configuration file format.
37+
38+# Use Debian's reportbug SMTP Server:
39+# Note: it's limited to 5 connections per hour, and cannot CC you at submission
40+# time. See /usr/share/doc/reportbug/README.Users.gz for more details.
41+smtphost reportbug.debian.org:587
42+header "X-Debbugs-CC: %s"
43+no-cc
44+
45+# Use GMail's SMTP Server:
46+#smtphost smtp.googlemail.com:587
47+#smtpuser "<your address>@gmail.com"
48+#smtptls
49+""" % email
50+
51+ with file(fn, 'w') as f:
52+ f.write(reportbugrc)
53+
54+ print """You have not configured reportbug. Assuming this is the first time you have used it.
55+Writing a ~/.reportbugrc that will use Debian's mailserver, and CC the bug to
56+you at <%s>
57+
58+--- Generated ~/.reportbugrc ---
59+%s
60+--- End of ~/.reportbugrc ---
61+
62+If this is not correct, please exit now and edit ~/.reportbugrc or run
63+reportbug --configure for its configuration wizard.
64+""" % (email, reportbugrc.strip())
65+
66+ if YesNoQuestion().ask("Continue submitting this bug?", "yes") == "no":
67+ sys.exit(1)
68+
69 def main():
70+ check_reportbug_config()
71 changelog_file = (check_file('debian/changelog', critical = False) or
72 check_file('../debian/changelog'))
73 changelog = Changelog(file(changelog_file).read())

Subscribers

People subscribed via source and target branches

to status/vote changes: