From 30cb57b32c299230a3cbf10fba97b33e4faf7735 Mon Sep 17 00:00:00 2001 From: Stefano Rivera Date: Sat, 3 Dec 2011 17:02:47 +0200 Subject: [PATCH 01/11] Initial pkg-on-images tool --- pkg-on-images | 82 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100755 pkg-on-images diff --git a/pkg-on-images b/pkg-on-images new file mode 100755 index 0000000..aa12230 --- /dev/null +++ b/pkg-on-images @@ -0,0 +1,82 @@ +#!/usr/bin/python +# +# Copyright (C) 2011, Stefano Rivera +# +# Permission to use, copy, modify, and/or distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +import gzip +import json +import optparse +import os +import time +import urllib + +from ubuntutools.lp.lpapicache import Distribution + +DATA_URL = ('http://people.ubuntuwire.org/~stefanor/ubuntu-image-contents/' + 'image_contents.json.gz') + + +def load_index(): + cachedir = os.path.expanduser('~/.cache/ubuntu-dev-tools') + fn = os.path.join(cachedir, 'image_contents.json.gz') + + if (not os.path.isfile(fn) + or time.time() - os.path.getmtime(fn) > 60 * 60 * 24): + if not os.path.isdir(cachedir): + os.makedirs(cachedir) + urllib.urlretrieve(DATA_URL, fn) + + with gzip.open(fn, 'r') as f: + return json.load(f) + + +def main(): + parser = optparse.OptionParser('%prog [options] package...') + parser.add_option('-b', '--binary', + default=False, action='store_true', + help="Binary packages are being specified, " + "not source packages (fast)") + options, args = parser.parse_args() + + if len(args) < 1: + parser.error("At least one package must be specified") + + index = load_index() + if options.binary: + for binary in args: + if binary in index: + for flavor, type_ in index[binary]: + print "%s is present on %s %s" % (binary, flavor, type_) + else: + print "%s is not present on any current images" % binary + else: + archive = Distribution('ubuntu').getArchive() + for source in args: + spph = archive.getSourcePackage(source) + binaries = frozenset(bpph.getPackageName() + for bpph in spph.getBinaries()) + present = False + for binary in binaries: + if binary in index: + present = True + for flavor, type_ in index[binary]: + print ("%s: %s is present on %s %s" + % (source, binary, flavor, type_)) + if not present: + print ("No binaries from %s are present on any current images" + % source) + + +if __name__ == '__main__': + main() From 09a870fa4395442aae828393f3372453fe178888 Mon Sep 17 00:00:00 2001 From: Stefano Rivera Date: Sun, 4 Dec 2011 00:09:51 +0200 Subject: [PATCH 02/11] Some error handling (and other bits) --- pkg-on-images | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/pkg-on-images b/pkg-on-images index aa12230..96de298 100755 --- a/pkg-on-images +++ b/pkg-on-images @@ -21,13 +21,18 @@ import os import time import urllib -from ubuntutools.lp.lpapicache import Distribution +from devscripts.logger import Logger + +from ubuntutools.lp.lpapicache import Distribution, PackageNotFoundException DATA_URL = ('http://people.ubuntuwire.org/~stefanor/ubuntu-image-contents/' 'image_contents.json.gz') def load_index(): + '''Download a new copy of the image contents index, if necessary, + and read it. + ''' cachedir = os.path.expanduser('~/.cache/ubuntu-dev-tools') fn = os.path.join(cachedir, 'image_contents.json.gz') @@ -42,6 +47,7 @@ def load_index(): def main(): + '''Query which images the specified packages are on''' parser = optparse.OptionParser('%prog [options] package...') parser.add_option('-b', '--binary', default=False, action='store_true', @@ -63,7 +69,11 @@ def main(): else: archive = Distribution('ubuntu').getArchive() for source in args: - spph = archive.getSourcePackage(source) + try: + spph = archive.getSourcePackage(source) + except PackageNotFoundException, e: + Logger.error(str(e)) + continue binaries = frozenset(bpph.getPackageName() for bpph in spph.getBinaries()) present = False @@ -71,7 +81,7 @@ def main(): if binary in index: present = True for flavor, type_ in index[binary]: - print ("%s: %s is present on %s %s" + print ("src:%s: %s is present on %s %s" % (source, binary, flavor, type_)) if not present: print ("No binaries from %s are present on any current images" From 4988d36ba27cfdaac1f47b6fdaa942abfca5266e Mon Sep 17 00:00:00 2001 From: Stefano Rivera Date: Sun, 4 Dec 2011 00:39:40 +0200 Subject: [PATCH 03/11] Extra bits --- debian/control | 1 + debian/copyright | 4 +++- doc/pkg-on-images.1 | 49 +++++++++++++++++++++++++++++++++++++++++++++ setup.py | 1 + 4 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 doc/pkg-on-images.1 diff --git a/debian/control b/debian/control index e15fd97..04712c8 100644 --- a/debian/control +++ b/debian/control @@ -86,6 +86,7 @@ Description: useful tools for Ubuntu developers sbuild. - pbuilder-dist, cowbuilder-dist - wrapper script for managing several build chroots (for different Ubuntu and Debian releases) on the same system. + - pkg-on-images - query if a package is included in daily images. - pull-debian-debdiff - attempts to find and download a specific version of a Debian package and its immediate parent to generate a debdiff. - pull-debian-source - downloads the lastest source package available in diff --git a/debian/copyright b/debian/copyright index 98ffaf6..9d3ab4b 100644 --- a/debian/copyright +++ b/debian/copyright @@ -144,7 +144,8 @@ License: GPL-3+ On Debian systems, the complete text of the GNU General Public License version 3 can be found in the /usr/share/common-licenses/GPL-3 file. -Files: doc/pull-debian-debdiff.1 +Files: doc/pkg-on-images.1 + doc/pull-debian-debdiff.1 doc/pull-debian-source.1 doc/requestbackport.1 doc/reverse-depends.1 @@ -152,6 +153,7 @@ Files: doc/pull-debian-debdiff.1 doc/ubuntu-dev-tools.5 doc/update-maintainer.1 enforced-editing-wrapper + pkg-on-images pull-debian-debdiff pull-debian-source requestbackport diff --git a/doc/pkg-on-images.1 b/doc/pkg-on-images.1 new file mode 100644 index 0000000..1ec52b5 --- /dev/null +++ b/doc/pkg-on-images.1 @@ -0,0 +1,49 @@ +.\" Copyright (C) 2011, Stefano Rivera +.\" +.\" Permission to use, copy, modify, and/or distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +.\" REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +.\" AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +.\" INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +.\" LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +.\" OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +.\" PERFORMANCE OF THIS SOFTWARE. +.TH pkg\-on\-images 1 "December 2011" ubuntu\-dev\-tools + +.SH NAME +pkg\-on\-images \- List the all the daily images containing the +specified packages + +.SH SYNOPSIS +.B pkg\-on\-images \fR[\fIoptions\fR] \fIpackage\fR... + +.SH DESCRIPTION +Lists all the current daily images containing the specified packages. +An index of the current manifests is downloaded from UbuntuWire. + +.SH OPTIONS +.TP +\fB\-b\fR, \fB\-\-binary\fR +The packages specified are binary packages. +This is faster than source packages, as otherwise we must query LP to +determine the binary packages that every specified source package +builds. +.TP +\fB\-h\fR, \fB\-\-help\fR +Display a help message and exit + +.SH EXAMPLES +All the images that contain unity: +.IP +.nf +.B pkg\-on\-images -b unity +.fi + +.SH AUTHORS +\fBpkg\-on\-images\fR and this manpage were written by Stefano Rivera +. +.PP +Both are released under the terms of the ISC License. diff --git a/setup.py b/setup.py index 558b8e1..8f1ec4b 100755 --- a/setup.py +++ b/setup.py @@ -28,6 +28,7 @@ scripts = ['404main', 'mk-sbuild', 'pbuilder-dist', 'pbuilder-dist-simple', + 'pkg-on-images', 'pull-debian-debdiff', 'pull-debian-source', 'pull-lp-source', From 7d5efa8a7675a2bf501a1f13f070b177c6aae1ff Mon Sep 17 00:00:00 2001 From: Stefano Rivera Date: Mon, 5 Dec 2011 22:49:10 +0200 Subject: [PATCH 04/11] Rename to ubuntu-safe-to-upload --- debian/control | 2 +- debian/copyright | 6 +++--- ...kg-on-images.1 => ubuntu-safe-to-upload.1} | 20 ++++++++++++------- setup.py | 2 +- pkg-on-images => ubuntu-safe-to-upload | 0 5 files changed, 18 insertions(+), 12 deletions(-) rename doc/{pkg-on-images.1 => ubuntu-safe-to-upload.1} (71%) rename pkg-on-images => ubuntu-safe-to-upload (100%) diff --git a/debian/control b/debian/control index 04712c8..8941ebb 100644 --- a/debian/control +++ b/debian/control @@ -86,7 +86,6 @@ Description: useful tools for Ubuntu developers sbuild. - pbuilder-dist, cowbuilder-dist - wrapper script for managing several build chroots (for different Ubuntu and Debian releases) on the same system. - - pkg-on-images - query if a package is included in daily images. - pull-debian-debdiff - attempts to find and download a specific version of a Debian package and its immediate parent to generate a debdiff. - pull-debian-source - downloads the lastest source package available in @@ -107,3 +106,4 @@ Description: useful tools for Ubuntu developers command line. - ubuntu-iso - output information of an Ubuntu ISO image. - update-maintainer - script to update maintainer field in ubuntu packages. + - ubuntu-safe-to-upload - query if a package is safe to upload during a freeze. diff --git a/debian/copyright b/debian/copyright index 9d3ab4b..b4125cb 100644 --- a/debian/copyright +++ b/debian/copyright @@ -144,22 +144,22 @@ License: GPL-3+ On Debian systems, the complete text of the GNU General Public License version 3 can be found in the /usr/share/common-licenses/GPL-3 file. -Files: doc/pkg-on-images.1 - doc/pull-debian-debdiff.1 +Files: doc/pull-debian-debdiff.1 doc/pull-debian-source.1 doc/requestbackport.1 doc/reverse-depends.1 doc/sponsor-patch.1 doc/ubuntu-dev-tools.5 doc/update-maintainer.1 + doc/ubuntu-safe-to-upload.1 enforced-editing-wrapper - pkg-on-images pull-debian-debdiff pull-debian-source requestbackport reverse-depends sponsor-patch test-data/* + ubuntu-safe-to-upload ubuntutools/archive.py ubuntutools/builder.py ubuntutools/config.py diff --git a/doc/pkg-on-images.1 b/doc/ubuntu-safe-to-upload.1 similarity index 71% rename from doc/pkg-on-images.1 rename to doc/ubuntu-safe-to-upload.1 index 1ec52b5..4328d35 100644 --- a/doc/pkg-on-images.1 +++ b/doc/ubuntu-safe-to-upload.1 @@ -11,17 +11,23 @@ .\" LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR .\" OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR .\" PERFORMANCE OF THIS SOFTWARE. -.TH pkg\-on\-images 1 "December 2011" ubuntu\-dev\-tools +.TH ubuntu\-safe\-to\-upload 1 "December 2011" ubuntu\-dev\-tools .SH NAME -pkg\-on\-images \- List the all the daily images containing the -specified packages +ubuntu\-safe\-to\-upload \- Determine whether a package is safe to +upload during a freeze .SH SYNOPSIS -.B pkg\-on\-images \fR[\fIoptions\fR] \fIpackage\fR... +.B ubuntu\-safe\-to\-upload \fR[\fIoptions\fR] \fIpackage\fR... .SH DESCRIPTION Lists all the current daily images containing the specified packages. +Or whether the package is part of the supported seed. +.PP +If it isn't on an image, it should be safe to upload. +During the final freeze, one should avoid packages in the supported seed +too. +.PP An index of the current manifests is downloaded from UbuntuWire. .SH OPTIONS @@ -39,11 +45,11 @@ Display a help message and exit All the images that contain unity: .IP .nf -.B pkg\-on\-images -b unity +.B ubuntu\-safe\-to\-upload -b unity .fi .SH AUTHORS -\fBpkg\-on\-images\fR and this manpage were written by Stefano Rivera -. +\fBubuntu\-safe\-to\-upload\fR and this manpage were written by Stefano +Rivera . .PP Both are released under the terms of the ISC License. diff --git a/setup.py b/setup.py index 8f1ec4b..b4b1831 100755 --- a/setup.py +++ b/setup.py @@ -28,7 +28,6 @@ scripts = ['404main', 'mk-sbuild', 'pbuilder-dist', 'pbuilder-dist-simple', - 'pkg-on-images', 'pull-debian-debdiff', 'pull-debian-source', 'pull-lp-source', @@ -42,6 +41,7 @@ scripts = ['404main', 'syncpackage', 'ubuntu-build', 'ubuntu-iso', + 'ubuntu-safe-to-upload', 'update-maintainer', ] diff --git a/pkg-on-images b/ubuntu-safe-to-upload similarity index 100% rename from pkg-on-images rename to ubuntu-safe-to-upload From f4793f0df0cf358008f9008f0577ca2172e2272d Mon Sep 17 00:00:00 2001 From: Stefano Rivera Date: Tue, 6 Dec 2011 00:24:11 +0200 Subject: [PATCH 05/11] Tighter output --- ubuntu-safe-to-upload | 100 ++++++++++++++++++++++++++++-------------- 1 file changed, 68 insertions(+), 32 deletions(-) diff --git a/ubuntu-safe-to-upload b/ubuntu-safe-to-upload index 96de298..6b3b24f 100755 --- a/ubuntu-safe-to-upload +++ b/ubuntu-safe-to-upload @@ -14,6 +14,7 @@ # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +import collections import gzip import json import optparse @@ -25,27 +26,80 @@ from devscripts.logger import Logger from ubuntutools.lp.lpapicache import Distribution, PackageNotFoundException -DATA_URL = ('http://people.ubuntuwire.org/~stefanor/ubuntu-image-contents/' - 'image_contents.json.gz') +DATA_URL = ('http://people.ubuntuwire.org/~stefanor/ubuntu-seeded-packages/' + 'seeded.json.gz') -def load_index(): +def load_index(url): '''Download a new copy of the image contents index, if necessary, and read it. ''' cachedir = os.path.expanduser('~/.cache/ubuntu-dev-tools') - fn = os.path.join(cachedir, 'image_contents.json.gz') + fn = os.path.join(cachedir, 'seeded.json.gz') if (not os.path.isfile(fn) - or time.time() - os.path.getmtime(fn) > 60 * 60 * 24): + or time.time() - os.path.getmtime(fn) > 60 * 60 * 2): if not os.path.isdir(cachedir): os.makedirs(cachedir) - urllib.urlretrieve(DATA_URL, fn) + urllib.urlretrieve(url, fn) with gzip.open(fn, 'r') as f: return json.load(f) +def resolve_binaries(sources): + '''Return a dict of source:binaries for all binary packages built by + sources + ''' + archive = Distribution('ubuntu').getArchive() + binaries = {} + for source in sources: + try: + spph = archive.getSourcePackage(source) + except PackageNotFoundException, e: + Logger.error(str(e)) + continue + binaries[source] = sorted(set(bpph.getPackageName() + for bpph in spph.getBinaries())) + + return binaries + + +def present_on(appearences): + '''Format a list of (flavor, type) tuples into a human-readable string''' + present = collections.defaultdict(set) + for flavor, type_ in appearences: + present[flavor].add(type_) + for flavor, types in present.iteritems(): + if len(types) > 1: + types.discard('supported') + return ', '.join('%s [%s]' % (flavor, ' '.join(sorted(types))) + for flavor, types in present.iteritems()) + + +def output_binaries(index, binaries): + '''Print binaries found in index''' + for binary in binaries: + if binary in index: + present = present_on(index[binary]) + print "%s is seeded in: %s" % (binary, present) + else: + print "%s is not seeded" % binary + + +def output_by_source(index, by_source): + '''Print binaries found in index. Grouped by source''' + for source, binaries in by_source.iteritems(): + seen = False + for binary in binaries: + if binary in index: + seen = True + present = present_on(index[binary]) + print "%s: %s is seeded in: %s" % (source, binary, present) + if not seen: + print "%s's binaries are not seeded" % source + + def main(): '''Query which images the specified packages are on''' parser = optparse.OptionParser('%prog [options] package...') @@ -53,39 +107,21 @@ def main(): default=False, action='store_true', help="Binary packages are being specified, " "not source packages (fast)") + parser.add_option('-u', '--service-url', metavar='URL', + default=DATA_URL, + help='Reverse Dependencies webservice URL. ' + 'Default: UbuntuWire') options, args = parser.parse_args() if len(args) < 1: parser.error("At least one package must be specified") - index = load_index() + index = load_index(options.service_url) if options.binary: - for binary in args: - if binary in index: - for flavor, type_ in index[binary]: - print "%s is present on %s %s" % (binary, flavor, type_) - else: - print "%s is not present on any current images" % binary + output_binaries(index, args) else: - archive = Distribution('ubuntu').getArchive() - for source in args: - try: - spph = archive.getSourcePackage(source) - except PackageNotFoundException, e: - Logger.error(str(e)) - continue - binaries = frozenset(bpph.getPackageName() - for bpph in spph.getBinaries()) - present = False - for binary in binaries: - if binary in index: - present = True - for flavor, type_ in index[binary]: - print ("src:%s: %s is present on %s %s" - % (source, binary, flavor, type_)) - if not present: - print ("No binaries from %s are present on any current images" - % source) + binaries = resolve_binaries(args) + output_by_source(index, binaries) if __name__ == '__main__': From b4e08496902c23a727fec2da6a0570e00b50cd2d Mon Sep 17 00:00:00 2001 From: Stefano Rivera Date: Tue, 6 Dec 2011 00:29:32 +0200 Subject: [PATCH 06/11] un-copy-paste a little --- doc/ubuntu-safe-to-upload.1 | 5 +++++ ubuntu-safe-to-upload | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/doc/ubuntu-safe-to-upload.1 b/doc/ubuntu-safe-to-upload.1 index 4328d35..3758b38 100644 --- a/doc/ubuntu-safe-to-upload.1 +++ b/doc/ubuntu-safe-to-upload.1 @@ -38,6 +38,11 @@ This is faster than source packages, as otherwise we must query LP to determine the binary packages that every specified source package builds. .TP +\fB\-u\fR \fIURL\fR, \fB\-\-data\-url\fR=\fIURL\fR +URL for index of seeded packages. +Default: UbuntuWire's service at +\fBhttp://people.ubuntuwire.org/~stefanor/ubuntu-seeded-packages/seeded.json.gz\fR. +.TP \fB\-h\fR, \fB\-\-help\fR Display a help message and exit diff --git a/ubuntu-safe-to-upload b/ubuntu-safe-to-upload index 6b3b24f..d2f7ffb 100755 --- a/ubuntu-safe-to-upload +++ b/ubuntu-safe-to-upload @@ -107,9 +107,9 @@ def main(): default=False, action='store_true', help="Binary packages are being specified, " "not source packages (fast)") - parser.add_option('-u', '--service-url', metavar='URL', + parser.add_option('-u', '--data-url', metavar='URL', default=DATA_URL, - help='Reverse Dependencies webservice URL. ' + help='URL for the seeded packages index. ' 'Default: UbuntuWire') options, args = parser.parse_args() From e4fcb01b6a79649c164ec5f889185a882bdf45ad Mon Sep 17 00:00:00 2001 From: Stefano Rivera Date: Wed, 7 Dec 2011 01:29:16 +0200 Subject: [PATCH 07/11] Whoops, changed an option name, but not its variable --- ubuntu-safe-to-upload | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ubuntu-safe-to-upload b/ubuntu-safe-to-upload index d2f7ffb..5c48910 100755 --- a/ubuntu-safe-to-upload +++ b/ubuntu-safe-to-upload @@ -116,7 +116,7 @@ def main(): if len(args) < 1: parser.error("At least one package must be specified") - index = load_index(options.service_url) + index = load_index(options.data_url) if options.binary: output_binaries(index, args) else: From 784efd705378a3fdae5ac261181db17713f87ebd Mon Sep 17 00:00:00 2001 From: Stefano Rivera Date: Wed, 7 Dec 2011 23:55:17 +0200 Subject: [PATCH 08/11] Rename again --- debian/control | 2 +- debian/copyright | 4 ++-- ...{ubuntu-safe-to-upload.1 => ubuntu-is-seeded.1} | 14 +++++++------- setup.py | 2 +- ubuntu-safe-to-upload => ubuntu-is-seeded | 0 5 files changed, 11 insertions(+), 11 deletions(-) rename doc/{ubuntu-safe-to-upload.1 => ubuntu-is-seeded.1} (83%) rename ubuntu-safe-to-upload => ubuntu-is-seeded (100%) diff --git a/debian/control b/debian/control index 8941ebb..d0fd580 100644 --- a/debian/control +++ b/debian/control @@ -104,6 +104,6 @@ Description: useful tools for Ubuntu developers - syncpackage - helper to prepare .changes file to upload synced packages - ubuntu-build - give commands to the Launchpad build daemons from the command line. + - ubuntu-is-seeded - query if a package is safe to upload during a freeze. - ubuntu-iso - output information of an Ubuntu ISO image. - update-maintainer - script to update maintainer field in ubuntu packages. - - ubuntu-safe-to-upload - query if a package is safe to upload during a freeze. diff --git a/debian/copyright b/debian/copyright index b4125cb..4891993 100644 --- a/debian/copyright +++ b/debian/copyright @@ -150,8 +150,8 @@ Files: doc/pull-debian-debdiff.1 doc/reverse-depends.1 doc/sponsor-patch.1 doc/ubuntu-dev-tools.5 + doc/ubuntu-is-seeded.1 doc/update-maintainer.1 - doc/ubuntu-safe-to-upload.1 enforced-editing-wrapper pull-debian-debdiff pull-debian-source @@ -159,7 +159,7 @@ Files: doc/pull-debian-debdiff.1 reverse-depends sponsor-patch test-data/* - ubuntu-safe-to-upload + ubuntu-is-seeded ubuntutools/archive.py ubuntutools/builder.py ubuntutools/config.py diff --git a/doc/ubuntu-safe-to-upload.1 b/doc/ubuntu-is-seeded.1 similarity index 83% rename from doc/ubuntu-safe-to-upload.1 rename to doc/ubuntu-is-seeded.1 index 3758b38..fdb3f5d 100644 --- a/doc/ubuntu-safe-to-upload.1 +++ b/doc/ubuntu-is-seeded.1 @@ -11,14 +11,14 @@ .\" LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR .\" OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR .\" PERFORMANCE OF THIS SOFTWARE. -.TH ubuntu\-safe\-to\-upload 1 "December 2011" ubuntu\-dev\-tools +.TH ubuntu\-is\-seeded 1 "December 2011" ubuntu\-dev\-tools .SH NAME -ubuntu\-safe\-to\-upload \- Determine whether a package is safe to -upload during a freeze +ubuntu\-is\-seeded \- Determine whether a package is safe to upload +during a freeze .SH SYNOPSIS -.B ubuntu\-safe\-to\-upload \fR[\fIoptions\fR] \fIpackage\fR... +.B ubuntu\-is\-seeded \fR[\fIoptions\fR] \fIpackage\fR... .SH DESCRIPTION Lists all the current daily images containing the specified packages. @@ -50,11 +50,11 @@ Display a help message and exit All the images that contain unity: .IP .nf -.B ubuntu\-safe\-to\-upload -b unity +.B ubuntu\-is\-seeded -b unity .fi .SH AUTHORS -\fBubuntu\-safe\-to\-upload\fR and this manpage were written by Stefano -Rivera . +\fBubuntu\-is\-seeded\fR and this manpage were written by Stefano Rivera +. .PP Both are released under the terms of the ISC License. diff --git a/setup.py b/setup.py index b4b1831..7a02acc 100755 --- a/setup.py +++ b/setup.py @@ -40,8 +40,8 @@ scripts = ['404main', 'submittodebian', 'syncpackage', 'ubuntu-build', + 'ubuntu-is-seeded', 'ubuntu-iso', - 'ubuntu-safe-to-upload', 'update-maintainer', ] diff --git a/ubuntu-safe-to-upload b/ubuntu-is-seeded similarity index 100% rename from ubuntu-safe-to-upload rename to ubuntu-is-seeded From df04e14503f224010e9174ea3134706cd1a26da0 Mon Sep 17 00:00:00 2001 From: Stefano Rivera Date: Thu, 8 Dec 2011 00:01:56 +0200 Subject: [PATCH 09/11] New URL for the data --- doc/ubuntu-is-seeded.1 | 2 +- ubuntu-is-seeded | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/doc/ubuntu-is-seeded.1 b/doc/ubuntu-is-seeded.1 index fdb3f5d..1947ba4 100644 --- a/doc/ubuntu-is-seeded.1 +++ b/doc/ubuntu-is-seeded.1 @@ -41,7 +41,7 @@ builds. \fB\-u\fR \fIURL\fR, \fB\-\-data\-url\fR=\fIURL\fR URL for index of seeded packages. Default: UbuntuWire's service at -\fBhttp://people.ubuntuwire.org/~stefanor/ubuntu-seeded-packages/seeded.json.gz\fR. +\fBhttp://qa.ubuntuwire.org/ubuntu-seeded-packages/seeded.json.gz\fR. .TP \fB\-h\fR, \fB\-\-help\fR Display a help message and exit diff --git a/ubuntu-is-seeded b/ubuntu-is-seeded index 5c48910..f734e49 100755 --- a/ubuntu-is-seeded +++ b/ubuntu-is-seeded @@ -26,8 +26,7 @@ from devscripts.logger import Logger from ubuntutools.lp.lpapicache import Distribution, PackageNotFoundException -DATA_URL = ('http://people.ubuntuwire.org/~stefanor/ubuntu-seeded-packages/' - 'seeded.json.gz') +DATA_URL = 'http://qa.ubuntuwire.org/ubuntu-seeded-packages/seeded.json.gz' def load_index(url): From a3f9eeed9f143cd20c18736c25a8f76c8478d470 Mon Sep 17 00:00:00 2001 From: Stefano Rivera Date: Thu, 8 Dec 2011 00:27:58 +0200 Subject: [PATCH 10/11] Verboser output, but without duplication. This should please bdrung --- ubuntu-is-seeded | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/ubuntu-is-seeded b/ubuntu-is-seeded index f734e49..fcafd3a 100755 --- a/ubuntu-is-seeded +++ b/ubuntu-is-seeded @@ -72,18 +72,20 @@ def present_on(appearences): for flavor, types in present.iteritems(): if len(types) > 1: types.discard('supported') - return ', '.join('%s [%s]' % (flavor, ' '.join(sorted(types))) - for flavor, types in present.iteritems()) + output = [' %s: %s' % (flavor, ', '.join(sorted(types))) + for flavor, types in present.iteritems()] + output.sort() + return '\n'.join(output) def output_binaries(index, binaries): '''Print binaries found in index''' for binary in binaries: if binary in index: - present = present_on(index[binary]) - print "%s is seeded in: %s" % (binary, present) + print "%s is seeded in:" % binary + print present_on(index[binary]) else: - print "%s is not seeded" % binary + print "%s is not seeded." % binary def output_by_source(index, by_source): @@ -93,10 +95,10 @@ def output_by_source(index, by_source): for binary in binaries: if binary in index: seen = True - present = present_on(index[binary]) - print "%s: %s is seeded in: %s" % (source, binary, present) + print "%s: %s is seeded in:" % (source, binary) + print present_on(index[binary]) if not seen: - print "%s's binaries are not seeded" % source + print "%s's binaries are not seeded." % source def main(): From 067fd52b5cd6b57f0390076345d8d0bdbfff6b61 Mon Sep 17 00:00:00 2001 From: Stefano Rivera Date: Thu, 8 Dec 2011 00:29:20 +0200 Subject: [PATCH 11/11] binpkg (from srcpkg) is ... --- ubuntu-is-seeded | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ubuntu-is-seeded b/ubuntu-is-seeded index fcafd3a..b443b00 100755 --- a/ubuntu-is-seeded +++ b/ubuntu-is-seeded @@ -95,7 +95,7 @@ def output_by_source(index, by_source): for binary in binaries: if binary in index: seen = True - print "%s: %s is seeded in:" % (source, binary) + print "%s (from %s) is seeded in:" % (binary, source) print present_on(index[binary]) if not seen: print "%s's binaries are not seeded." % source