diff --git a/debian/changelog b/debian/changelog index 980f1b8..ed2cfe0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -19,6 +19,7 @@ ubuntu-dev-tools (0.133) unstable; 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. diff --git a/debian/control b/debian/control index 049fa46..bb91a4c 100644 --- a/debian/control +++ b/debian/control @@ -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, diff --git a/doc/requestsync.1 b/doc/requestsync.1 index ee3e3b6..f47ef70 100644 --- a/doc/requestsync.1 +++ b/doc/requestsync.1 @@ -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 diff --git a/doc/syncpackage.1 b/doc/syncpackage.1 index 0a7bad3..a28299f 100644 --- a/doc/syncpackage.1 +++ b/doc/syncpackage.1 @@ -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. diff --git a/requestsync b/requestsync index 7500009..752998f 100755 --- a/requestsync +++ b/requestsync @@ -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] ' ' [ [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] diff --git a/syncpackage b/syncpackage index 57c4c00..1a43d9d 100755 --- a/syncpackage +++ b/syncpackage @@ -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)