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

This commit is contained in:
Stefano Rivera 2011-10-17 13:31:02 +02:00
parent e7c0233ca6
commit aab58522ad
6 changed files with 17 additions and 8 deletions

1
debian/changelog vendored
View File

@ -7,6 +7,7 @@ ubuntu-dev-tools (0.133) UNRELEASED; urgency=low
of distro-info.
* syncpackge: Gracefully deal with no available changelog from Debian (PTS
changelogs aren't available immediately)
* syncpackage, requestsync: Sync from testing for LTSs (LP: #876400)
[ Benjamin Drung ]
* 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-apt (>= 0.7.93~),
python-debian (>= 0.1.20~),
python-distro-info | distro-info (<< 0.3~),
python-distro-info (>= 0.4~),
python-gnupginterface,
python-launchpadlib (>= 1.5.7),
python-mox,
@ -38,7 +38,7 @@ Depends: binutils,
lsb-release,
python-apt (>= 0.7.93~),
python-debian (>= 0.1.20~),
python-distro-info | distro-info (<< 0.3~),
python-distro-info (>= 0.4~),
python-launchpadlib (>= 1.5.7),
python-lazr.restfulclient,
sudo,

View File

@ -48,7 +48,7 @@ Display a help message and exit.
.TP
.B \-d
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
.B \-n
Specifies that the package is a new package, and requestsync should not

View File

@ -30,10 +30,11 @@ archive.
Show help message and exit
.TP
\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
\fB\-r\fI RELEASE\fR, \fB\-\-release\fR=\fIRELEASE\fR
Specify target Ubuntu release.
Specify target Ubuntu release. Default: current development release.
.TP
\fB\-V\fI DEBVERSION\fR, \fB\-\-debian\-version\fR=\fIDEBVERSION\fR
Specify the version to sync from.

View File

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

View File

@ -31,6 +31,7 @@ import urllib
import debian.debian_support
from devscripts.logger import Logger
from distro_info import UbuntuDistroInfo
from lazr.restfulclient.errors import HTTPError
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)
if dist is None:
dist = "unstable"
ubu_info = UbuntuDistroInfo()
dist = 'testing' if ubu_info.is_lts(ubu_info.devel()) else 'unstable'
requested_version = version
if type(version) == str:
version = Version(version)