requestsync: Make --lp the default.

This commit is contained in:
Stefano Rivera 2011-11-12 23:33:32 +02:00
parent 3910b88ee9
commit 8aefff3758
3 changed files with 26 additions and 23 deletions

5
debian/changelog vendored
View File

@ -1,9 +1,10 @@
ubuntu-dev-tools (0.135) UNRELEASED; urgency=low
ubuntu-dev-tools (0.136) UNRELEASED; urgency=low
* grab-merge: Use wget -nv rather than -q, so that we see error messages
(LP: #881967)
* requestsync: Make --lp the default.
-- Stefano Rivera <stefanor@debian.org> Sat, 12 Nov 2011 23:04:35 +0200
-- Stefano Rivera <stefanor@debian.org> Sat, 12 Nov 2011 23:28:05 +0200
ubuntu-dev-tools (0.134) unstable; urgency=low

View File

@ -11,14 +11,10 @@ requestsync \- helper to file sync requests for Ubuntu
\fBrequestsync\fR looks at the versions of <source package> in Debian and
Ubuntu and prompts for an explanation of why the Ubuntu changes (if there
are any) should be dropped.
The changelog entry is then downloaded from packages.debian.org.
If the sync request is being filed per email (default), a prompt for your
GPG passphrase follows so that it can sign the mail and send it off to
Launchpad.
Alternatively a sync request can be filed directly using the launchpadlib
Python module (option \fB\-\-lp\fR).
\fBrequestsync\fR falls back to mail the sync request if submitting using
the launchpadlib module fails.
The changelog entry is then downloaded from packages.debian.org, and the
sync request bug is filed in launchpad.
Alternatively, the sync request can be filed by GPG\-signed email (option
\fB\-\-email\fR).
.PP
\fBrequestsync\fR checks if you have the permissions to request the sync from
@ -28,7 +24,7 @@ you don't have upload permissions, the script will subscribe the necessary
team with approval rights to the bug report for you.
This check is only performed if \fBrequestsync\fR is allowed to use the LP API
(option \fB\-\-lp\fR). In the other case \fBrequestsync\fR relies on that you
(not email submission). In the other case \fBrequestsync\fR relies on that you
answer the question about upload permissions honestly to determine if a team
with approval rights is to be subscribed to the bug.
@ -58,9 +54,8 @@ attempt to look it up in Ubuntu since it will not exist.
Specifies your GPG key.
This is only used if the sync request is mailed to Launchpad.
.TP
.B \-\-lp
Use the launchpadlib Python module (packaged as python\-launchpadlib) to
file the sync request in Launchpad.
.B \-\-email
Use GPG\-signed email to file the bug, rather than launchpadlib.
.TP
.B \-s
Specifies that you require sponsorship.
@ -126,7 +121,7 @@ Sets which port of the SMTP server to use. Default is 25.
Sets the username and password to use when authenticating to the SMTP server.
.TP
.BR REQUESTSYNC_USE_LPAPI
Setting this to \fIyes\fR is equivalent to running with \fB--lp\fR.
Setting this to \fIno\fR is equivalent to running with \fB--email\fR.
.TP
.BR REQUESTSYNC_LPINSTANCE ", " UBUNTUTOOLS_LPINSTANCE
The default value for \fB--lpinstance\fR.

View File

@ -26,7 +26,7 @@
#
# ##################################################################
from optparse import OptionParser
import optparse
import os
import sys
@ -52,7 +52,7 @@ def main():
# Our usage options.
usage = ('Usage: %prog [options] '
'<source package> [<target release> [base version]]')
parser = OptionParser(usage)
parser = optparse.OptionParser(usage)
parser.add_option('-d', type='string',
dest='dist', default=DEFAULT_SOURCE,
@ -65,10 +65,12 @@ def main():
dest='newpkg', default=False,
help='Whether package to sync is a new package in '
'Ubuntu.')
parser.add_option('--lp', action='store_true',
dest='lpapi', default=False,
help='Specify whether to use the LP API for filing '
'the sync request (recommended).')
parser.add_option('--email', action='store_true', default=False,
help='Use a PGP-signed email for filing the sync '
'request, rather than the LP API.')
parser.add_option('--lp', dest='deprecated_lp_flag',
action='store_true', default=False,
help=optparse.SUPPRESS_HELP)
parser.add_option('-l', '--lpinstance', metavar='INSTANCE',
dest='lpinstance', default=None,
help='Launchpad instance to connect to '
@ -98,8 +100,13 @@ def main():
require_utf8()
config = UDTConfig(options.no_conf)
if not options.lpapi:
options.lpapi = config.get_value('USE_LPAPI', default=False,
if options.deprecated_lp_flag:
print "The --lp flag is now default, ignored."
if options.email:
options.lpapi = False
else:
options.lpapi = config.get_value('USE_LPAPI', default=True,
boolean=True)
if options.lpinstance is None:
options.lpinstance = config.get_value('LPINSTANCE')