syncpackage, requestsync: Sync from testing for LTSs (LP: #876400)

This commit is contained in:
Stefano Rivera 2011-10-26 01:13:35 +02:00
commit c921d40a9f
6 changed files with 17 additions and 8 deletions

1
debian/changelog vendored
View File

@ -19,6 +19,7 @@ ubuntu-dev-tools (0.133) unstable; urgency=low
of distro-info. of distro-info.
* syncpackge: Gracefully deal with no available changelog from Debian (PTS * syncpackge: Gracefully deal with no available changelog from Debian (PTS
changelogs aren't available immediately) changelogs aren't available immediately)
* syncpackage, requestsync: Sync from testing for LTSs (LP: #876400)
[ Benjamin Drung ] [ Benjamin Drung ]
* syncpackage: Allow syncing to -proposed with --no-lp. * syncpackage: Allow syncing to -proposed with --no-lp.

4
debian/control vendored
View File

@ -16,7 +16,7 @@ Build-Depends: dctrl-tools,
python-all (>= 2.6.5-13~), python-all (>= 2.6.5-13~),
python-apt (>= 0.7.93~), python-apt (>= 0.7.93~),
python-debian (>= 0.1.20~), python-debian (>= 0.1.20~),
python-distro-info | distro-info (<< 0.3~), python-distro-info (>= 0.4~),
python-gnupginterface, python-gnupginterface,
python-launchpadlib (>= 1.5.7), python-launchpadlib (>= 1.5.7),
python-mox, python-mox,
@ -38,7 +38,7 @@ Depends: binutils,
lsb-release, lsb-release,
python-apt (>= 0.7.93~), python-apt (>= 0.7.93~),
python-debian (>= 0.1.20~), python-debian (>= 0.1.20~),
python-distro-info | distro-info (<< 0.3~), python-distro-info (>= 0.4~),
python-launchpadlib (>= 1.5.7), python-launchpadlib (>= 1.5.7),
python-lazr.restfulclient, python-lazr.restfulclient,
sudo, sudo,

View File

@ -48,7 +48,7 @@ Display a help message and exit.
.TP .TP
.B \-d .B \-d
Specifies which Debian distribution a package should be synced from. Specifies which Debian distribution a package should be synced from.
Default is \fIunstable\fR. Default is \fItesting\fR in LTS cycles, otherwise \fIunstable\fR.
.TP .TP
.B \-n .B \-n
Specifies that the package is a new package, and requestsync should not Specifies that the package is a new package, and requestsync should not

View File

@ -30,10 +30,11 @@ archive.
Show help message and exit Show help message and exit
.TP .TP
\fB\-d\fI DIST\fR, \fB\-\-distribution\fR=\fIDIST\fR \fB\-d\fI DIST\fR, \fB\-\-distribution\fR=\fIDIST\fR
Debian distribution to sync from. Debian distribution to sync from. Default is \fItesting\fR during LTS
cycles, and \fIunstable\fR otherwise.
.TP .TP
\fB\-r\fI RELEASE\fR, \fB\-\-release\fR=\fIRELEASE\fR \fB\-r\fI RELEASE\fR, \fB\-\-release\fR=\fIRELEASE\fR
Specify target Ubuntu release. Specify target Ubuntu release. Default: current development release.
.TP .TP
\fB\-V\fI DEBVERSION\fR, \fB\-\-debian\-version\fR=\fIDEBVERSION\fR \fB\-V\fI DEBVERSION\fR, \fB\-\-debian\-version\fR=\fIDEBVERSION\fR
Specify the version to sync from. Specify the version to sync from.

View File

@ -44,13 +44,18 @@ from ubuntutools.requestsync.common import (edit_report, get_debian_changelog,
# #
def main(): def main():
ubu_info = UbuntuDistroInfo()
DEFAULT_SOURCE = 'unstable'
if ubu_info.is_lts(ubu_info.devel()):
DEFAULT_SOURCE = 'testing'
# Our usage options. # Our usage options.
usage = ('Usage: %prog [options] ' usage = ('Usage: %prog [options] '
'<source package> [<target release> [base version]]') '<source package> [<target release> [base version]]')
parser = OptionParser(usage) parser = OptionParser(usage)
parser.add_option('-d', type='string', parser.add_option('-d', type='string',
dest='dist', default='unstable', dest='dist', default=DEFAULT_SOURCE,
help='Debian distribution to sync from.') help='Debian distribution to sync from.')
parser.add_option('-k', type='string', parser.add_option('-k', type='string',
dest='keyid', default=None, dest='keyid', default=None,
@ -174,7 +179,7 @@ def main():
if lpapi: if lpapi:
release = Distribution('ubuntu').getDevelopmentSeries().name release = Distribution('ubuntu').getDevelopmentSeries().name
else: else:
release = UbuntuDistroInfo().devel() release = ubu_info.devel()
print >> sys.stderr, 'W: Target release missing - assuming %s' % release print >> sys.stderr, 'W: Target release missing - assuming %s' % release
elif len(args) == 2: elif len(args) == 2:
release = args[1] release = args[1]

View File

@ -31,6 +31,7 @@ import urllib
import debian.debian_support import debian.debian_support
from devscripts.logger import Logger from devscripts.logger import Logger
from distro_info import UbuntuDistroInfo
from lazr.restfulclient.errors import HTTPError from lazr.restfulclient.errors import HTTPError
from ubuntutools.archive import (DebianSourcePackage, UbuntuSourcePackage, from ubuntutools.archive import (DebianSourcePackage, UbuntuSourcePackage,
@ -271,7 +272,8 @@ def fetch_source_pkg(package, dist, version, component, ubuntu_release, mirror):
return DebianSourcePackage(dscfile=package, mirrors=mirrors) return DebianSourcePackage(dscfile=package, mirrors=mirrors)
if dist is None: if dist is None:
dist = "unstable" ubu_info = UbuntuDistroInfo()
dist = 'testing' if ubu_info.is_lts(ubu_info.devel()) else 'unstable'
requested_version = version requested_version = version
if type(version) == str: if type(version) == str:
version = Version(version) version = Version(version)