[Pkg-asv-commits] r33 - in trunk: . debian
ahoenen-guest at alioth.debian.org
ahoenen-guest at alioth.debian.org
Tue May 6 20:04:57 UTC 2008
Author: ahoenen-guest
Date: 2008-05-06 20:04:56 +0000 (Tue, 06 May 2008)
New Revision: 33
Modified:
trunk/apt-show-versions
trunk/debian/changelog
Log:
Allversions output:
Add an archive column to ease understanding of duplicate version lines, e.g.:
$ ./apt-show-versions -a bash
bash 3.1dfsg-9 install ok installed
bash 2.05b-26 oldstable ftp.de.debian.org
bash 3.1dfsg-8 stable ftp.de.debian.org
bash 3.1dfsg-9 testing ftp.de.debian.org
bash 3.1dfsg-9 testing ftp2.de.debian.org
bash 3.2-2 unstable ftp.de.debian.org
bash/testing uptodate 3.1dfsg-9
Modified: trunk/apt-show-versions
===================================================================
--- trunk/apt-show-versions 2008-05-05 11:02:54 UTC (rev 32)
+++ trunk/apt-show-versions 2008-05-06 20:04:56 UTC (rev 33)
@@ -56,6 +56,7 @@
$ASV_VERSION ='0.13';
# Provide some constants (to avoid redundant literals).
+my $ARCHIVE = 'Archive';
my $CODENAME = 'Codename';
my $NAME = 'Name';
my $PACKAGE = 'Package';
@@ -189,7 +190,7 @@
@files = map { $list_dir . $_} grep /Packages$/, readdir(DIR);
($< == 0) and (store(\@files, $filescachefile) or
warn "Can't write $filescachefile\n");
-
+
closedir DIR ;
}
unless (@files > 0) {
@@ -337,6 +338,7 @@
# variables are needed:
my $max_package_len = 0;
my $max_version_len = 0;
+ my $max_name_len = 0;
# print more information if required
if ($opts{'allversions'}) {
@@ -371,11 +373,15 @@
$official_idx = $cur_idx + 1;
}
# Then handle current release.
+ (my $archive = $pkg->{$RELEASE}) =~ s/_.*//;
push @print_info, {$PACKAGE => $pkg->{$PACKAGE},
$VERSION => $pkg->{$VERSION},
- $NAME => $releasenames{$pkg->{$RELEASE}}{$NAME}};
+ $NAME => $releasenames{$pkg->{$RELEASE}}{$NAME},
+ $ARCHIVE => $archive};
$max_package_len = &max(length($pkg->{$PACKAGE}), $max_package_len);
$max_version_len = &max(length($pkg->{$VERSION}), $max_version_len);
+ $max_name_len = &max(length($releasenames{$pkg->{$RELEASE}}{$NAME}),
+ $max_name_len);
}
# Finally handle missing official suites after last existing release.
foreach ($official_idx .. $#official_suites) {
@@ -451,10 +457,11 @@
unless ($suppress_print) {
foreach my $print_info (@print_info) {
if (ref $print_info) {
- printf("%*s %*s %s\n",
+ printf("%*s %*s %*s %s\n",
-$max_package_len, $print_info->{$PACKAGE},
-$max_version_len, $print_info->{$VERSION},
- $print_info->{$NAME});
+ -$max_name_len, $print_info->{$NAME},
+ $print_info->{$ARCHIVE});
}
else {
print $print_info;
Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog 2008-05-05 11:02:54 UTC (rev 32)
+++ trunk/debian/changelog 2008-05-06 20:04:56 UTC (rev 33)
@@ -9,6 +9,7 @@
- Avoid repetition of the default-release version.
- Strictly sort versions by version number as primary criterion.
- Enforce tabular layout.
+ - Add an archive column to output.
* Sort output by package names.
* If specified package is not only not installed, but even not available
(e.g. a misspelled package name), dump an accordant comment.
@@ -33,7 +34,7 @@
[ Christoph Martin ]
* call closedir from correct position (closes: #479255)
- -- Christoph Martin <christoph.martin at uni-mainz.de> Mon, 5 May 2008 13:02:45 +0200
+ -- Andreas Hoenen <andreas at hoenen-terstappen.de> Tue, 06 May 2008 21:57:40 +0200
apt-show-versions (0.12) unstable; urgency=low
More information about the Pkg-asv-commits
mailing list