From 08754a3c71948ba0deb4ca6e6a51f635c37ca948 Mon Sep 17 00:00:00 2001 From: Stefano Rivera Date: Wed, 8 Feb 2012 12:06:32 +0200 Subject: [PATCH] * reverse-depends: Now that Debian is supported server-side: - Convert Debian release aliases to codenames. - Default to the devel release of the vendor distribution. --- debian/changelog | 3 +++ reverse-depends | 17 ++++++++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index a2c0a38..e407e07 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,6 +7,9 @@ ubuntu-dev-tools (0.139) UNRELEASED; urgency=low (LP: #919805) * pbuilder-dist: Export DISTRIBUTION and ARCHITECTURE as well as DIST and ARCH. Thanks Alessio Treglia. (Closes: #659060, LP: #423609) + * reverse-depends: Now that Debian is supported server-side: + - Convert Debian release aliases to codenames. + - Default to the devel release of the vendor distribution. -- Stefano Rivera Fri, 23 Dec 2011 22:33:17 +0200 diff --git a/reverse-depends b/reverse-depends index b0489c6..d54857b 100755 --- a/reverse-depends +++ b/reverse-depends @@ -18,20 +18,23 @@ import optparse import sys from devscripts.logger import Logger -from distro_info import UbuntuDistroInfo +from ubuntutools.misc import (system_distribution, vendor_to_distroinfo, + codename_to_distribution) from ubuntutools.rdepends import query_rdepends, RDependsException def main(): + system_distro_info = vendor_to_distroinfo(system_distribution())() parser = optparse.OptionParser('%prog [options] package', description="List reverse-dependencies of package. " "If the package name is prefixed with src: then the " "reverse-dependencies of all the binary packages that " "the specified source package builds will be listed.") parser.add_option('-r', '--release', metavar='RELEASE', - default=UbuntuDistroInfo().devel(), - help='Query dependencies in RELEASE. Default: devel') + default=system_distro_info.devel(), + help='Query dependencies in RELEASE. ' + 'Default: %s' % system_distro_info.devel()) parser.add_option('-R', '--without-recommends', action='store_false', dest='recommends', default=True, help='Only consider Depends relationships, ' @@ -68,6 +71,14 @@ def main(): if options.server is not None: opts['server'] = options.server + # Convert unstable/testing aliases to codenames: + distribution = codename_to_distribution(options.release) + if not distribution: + parser.error('Unknown release codename %s' % options.release) + distro_info = vendor_to_distroinfo(distribution)() + options.release = distro_info.codename(options.release, + default=options.release) + try: data = query_rdepends(package, options.release, options.arch, **opts) except RDependsException, e: