mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-05-19 04:41:28 +00:00
Include -y option to skip prompts (LP: #691895)
This commit is contained in:
parent
fca3e45826
commit
735ac962c3
@ -81,6 +81,11 @@ def parse(args):
|
|||||||
dest='upload',
|
dest='upload',
|
||||||
help='Specify an upload destination',
|
help='Specify an upload destination',
|
||||||
metavar='UPLOAD')
|
metavar='UPLOAD')
|
||||||
|
p.add_option('-y', '--yes',
|
||||||
|
dest='prompt',
|
||||||
|
default=True,
|
||||||
|
action='store_false',
|
||||||
|
help='Do not prompt before uploading to a PPA')
|
||||||
p.add_option('-v', '--version',
|
p.add_option('-v', '--version',
|
||||||
dest='version',
|
dest='version',
|
||||||
default=None,
|
default=None,
|
||||||
@ -207,18 +212,21 @@ def do_build(workdir, package, release, bp_version, builder, update):
|
|||||||
release,
|
release,
|
||||||
os.path.join(workdir, "buildresult"))
|
os.path.join(workdir, "buildresult"))
|
||||||
|
|
||||||
def do_upload(workdir, package, bp_version, upload):
|
def do_upload(workdir, package, bp_version, upload, prompt):
|
||||||
print 'Please check %s %s in file://%s carefully!' % \
|
print 'Please check %s %s in file://%s carefully!' % \
|
||||||
(package, bp_version, workdir)
|
(package, bp_version, workdir)
|
||||||
|
if prompt or upload == 'ubuntu':
|
||||||
question = 'Do you want to upload the package to %s' % upload
|
question = 'Do you want to upload the package to %s' % upload
|
||||||
answer = YesNoQuestion().ask(question, "yes")
|
answer = YesNoQuestion().ask(question, "yes")
|
||||||
if answer == "yes":
|
if answer != "yes":
|
||||||
|
return
|
||||||
|
|
||||||
changes_file = '%s_%s_source.changes' % (package, bp_version)
|
changes_file = '%s_%s_source.changes' % (package, bp_version)
|
||||||
check_call(['dput', upload, changes_file], cwd=workdir)
|
check_call(['dput', upload, changes_file], cwd=workdir)
|
||||||
|
|
||||||
|
|
||||||
def do_backport(workdir, package, dscfile, version, suffix, release, build,
|
def do_backport(workdir, package, dscfile, version, suffix, release, build,
|
||||||
builder, update, upload):
|
builder, update, upload, prompt):
|
||||||
check_call(['dpkg-source', '-x', dscfile, package], cwd=workdir)
|
check_call(['dpkg-source', '-x', dscfile, package], cwd=workdir)
|
||||||
srcdir = os.path.join(workdir, package)
|
srcdir = os.path.join(workdir, package)
|
||||||
|
|
||||||
@ -241,7 +249,7 @@ def do_backport(workdir, package, dscfile, version, suffix, release, build,
|
|||||||
if 0 != do_build(workdir, package, release, bp_version, builder, update):
|
if 0 != do_build(workdir, package, release, bp_version, builder, update):
|
||||||
error('Package failed to build; aborting')
|
error('Package failed to build; aborting')
|
||||||
if upload:
|
if upload:
|
||||||
do_upload(workdir, package, bp_version, upload)
|
do_upload(workdir, package, bp_version, upload, prompt)
|
||||||
|
|
||||||
shutil.rmtree(srcdir)
|
shutil.rmtree(srcdir)
|
||||||
|
|
||||||
@ -290,7 +298,8 @@ def main(args):
|
|||||||
opts.build,
|
opts.build,
|
||||||
opts.builder,
|
opts.builder,
|
||||||
opts.update,
|
opts.update,
|
||||||
opts.upload)
|
opts.upload,
|
||||||
|
opts.prompt)
|
||||||
finally:
|
finally:
|
||||||
if not opts.workdir:
|
if not opts.workdir:
|
||||||
shutil.rmtree(workdir)
|
shutil.rmtree(workdir)
|
||||||
|
1
debian/changelog
vendored
1
debian/changelog
vendored
@ -18,6 +18,7 @@ ubuntu-dev-tools (0.108) UNRELEASED; urgency=low
|
|||||||
|
|
||||||
[ Evan Broder ]
|
[ Evan Broder ]
|
||||||
* backportpackage: new script for testing backport requests in a PPA.
|
* backportpackage: new script for testing backport requests in a PPA.
|
||||||
|
- Include -y option to skip prompts (LP: #691895)
|
||||||
* sponsor-patch: Add --update option to make sure build environment is
|
* sponsor-patch: Add --update option to make sure build environment is
|
||||||
up to date (LP: #689605)
|
up to date (LP: #689605)
|
||||||
|
|
||||||
|
@ -49,6 +49,10 @@ Update the build environment before attempting to build.
|
|||||||
.B \-u \fIUPLOAD\fR, \-\-upload=\fIUPLOAD\fR
|
.B \-u \fIUPLOAD\fR, \-\-upload=\fIUPLOAD\fR
|
||||||
Upload to \fIUPLOAD\fR with \fBdput\fR(1) (after confirmation).
|
Upload to \fIUPLOAD\fR with \fBdput\fR(1) (after confirmation).
|
||||||
.TP
|
.TP
|
||||||
|
.B \-y, \-\-yes
|
||||||
|
Do not prompt before uploading to a PPA. For everyone's safety, this
|
||||||
|
option is ignored if \fIUPLOAD\fR is \fBubuntu\fR.
|
||||||
|
.TP
|
||||||
.B \-v \fIVERSION\fR, \-\-version=\fIVERSION\fR
|
.B \-v \fIVERSION\fR, \-\-version=\fIVERSION\fR
|
||||||
If the \fB\-\-source\fR option is specified, then
|
If the \fB\-\-source\fR option is specified, then
|
||||||
\fBbackportpackage\fR verifies that the current version of \fIsource
|
\fBbackportpackage\fR verifies that the current version of \fIsource
|
||||||
|
Loading…
x
Reference in New Issue
Block a user