mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-05-06 14:31:30 +00:00
backportpackage: If no dest release is specified, default to the current release
This commit is contained in:
parent
533b2bf7bd
commit
82373b169d
@ -25,6 +25,7 @@ import urllib
|
|||||||
|
|
||||||
from debian.deb822 import Dsc
|
from debian.deb822 import Dsc
|
||||||
import launchpadlib.launchpad
|
import launchpadlib.launchpad
|
||||||
|
import lsb_release
|
||||||
|
|
||||||
from ubuntutools.builder import getBuilder
|
from ubuntutools.builder import getBuilder
|
||||||
from ubuntutools.logger import Logger
|
from ubuntutools.logger import Logger
|
||||||
@ -46,7 +47,7 @@ def parse(args):
|
|||||||
dest='dest_releases',
|
dest='dest_releases',
|
||||||
default=[],
|
default=[],
|
||||||
action='append',
|
action='append',
|
||||||
help='Backport to DEST release (required)',
|
help='Backport to DEST release (default: current release)',
|
||||||
metavar='DEST')
|
metavar='DEST')
|
||||||
p.add_option('-s', '--source',
|
p.add_option('-s', '--source',
|
||||||
dest='source_release',
|
dest='source_release',
|
||||||
@ -81,8 +82,6 @@ def parse(args):
|
|||||||
opts, args = p.parse_args(args)
|
opts, args = p.parse_args(args)
|
||||||
if len(args) != 1:
|
if len(args) != 1:
|
||||||
p.error('You must specify a source package')
|
p.error('You must specify a source package')
|
||||||
if not opts.dest_releases:
|
|
||||||
p.error('You must specify at least one destination release')
|
|
||||||
if not opts.upload and not opts.build:
|
if not opts.upload and not opts.build:
|
||||||
p.error('Nothing to do')
|
p.error('Nothing to do')
|
||||||
|
|
||||||
@ -232,6 +231,13 @@ def main(args):
|
|||||||
lp = launchpadlib.launchpad.Launchpad.login_anonymously(script_name,
|
lp = launchpadlib.launchpad.Launchpad.login_anonymously(script_name,
|
||||||
opts.launchpad)
|
opts.launchpad)
|
||||||
|
|
||||||
|
if not opts.dest_releases:
|
||||||
|
try:
|
||||||
|
distinfo = lsb_release.get_distro_information()
|
||||||
|
opts.dest_releases = [distinfo['CODENAME']]
|
||||||
|
except:
|
||||||
|
error('No destination release specified and unable to guess yours')
|
||||||
|
|
||||||
workdir = tempfile.mkdtemp(prefix='backportpackage-')
|
workdir = tempfile.mkdtemp(prefix='backportpackage-')
|
||||||
try:
|
try:
|
||||||
dscfile = fetch_package(lp,
|
dscfile = fetch_package(lp,
|
||||||
|
@ -4,8 +4,6 @@ backportpackage \- helper to test package backports
|
|||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.TP
|
.TP
|
||||||
.B backportpackage \fR[\fIadditional options\fR]
|
.B backportpackage \fR[\fIadditional options\fR]
|
||||||
\-\-destination <\fIdest release\fR>
|
|
||||||
.br
|
|
||||||
\-\-upload <\fIupload target\fR>
|
\-\-upload <\fIupload target\fR>
|
||||||
.br
|
.br
|
||||||
<\fIsource package\fR>
|
<\fIsource package\fR>
|
||||||
@ -15,8 +13,8 @@ backportpackage \- helper to test package backports
|
|||||||
.TP
|
.TP
|
||||||
.B \-d \fIDEST\fR, \-\-destination=\fIDEST\fR
|
.B \-d \fIDEST\fR, \-\-destination=\fIDEST\fR
|
||||||
\fBRequired\fR. Backport the package to the specified Ubuntu
|
\fBRequired\fR. Backport the package to the specified Ubuntu
|
||||||
release. This option may be specified multiple times, but must be
|
release. If this option is unspecified, then \fBbackportpackage\fR
|
||||||
specified at least once.
|
defaults to the release on which it is currently running.
|
||||||
.TP
|
.TP
|
||||||
.B \-s \fISOURCE\fR, \-\-source=\fISOURCE\fR
|
.B \-s \fISOURCE\fR, \-\-source=\fISOURCE\fR
|
||||||
Backport the package from the specified Ubuntu release. If neither
|
Backport the package from the specified Ubuntu release. If neither
|
||||||
|
Loading…
x
Reference in New Issue
Block a user