Hi Steffen,
thanks for your report and the small patch.
I am going to prepare a new upload with this fix.
apt-show-versions really should use the Perl apt classes to access the
package database instead of reading the files directly.
Kind regards
Christoph
Am 30.07.25 um 11:53 schrieb Steffen Grunewald:
Hi all,
I'm providing some utilities in a small "flat" repository, for management of
RAID controllers, backup, etc.
This one includes a set of known-to-work TSM client packages (tivsm-{api64,ba}
which we extract from *-TIV-TSMBAC-LinuxX86_DEB.tar files downloaded from a
public IBM server.
When running apt-show-versions on this Bookworm machine, we get
# apt-show-versions -i -v
Parsing /var/lib/dpkg/status... completed.
[...]
Use of uninitialized value $value in substitution (s///) at
/usr/bin/apt-show-versions line 604, <FILE> line 618.
Use of uninitialized value $value in substitution (s///) at
/usr/bin/apt-show-versions line 605, <FILE> line 618.
Use of uninitialized value $value in substitution (s///) at
/usr/bin/apt-show-versions line 604, <FILE> line 621.
Use of uninitialized value $value in substitution (s///) at
/usr/bin/apt-show-versions line 605, <FILE> line 621.
Use of uninitialized value $value in substitution (s///) at
/usr/bin/apt-show-versions line 604, <FILE> line 634.
Use of uninitialized value $value in substitution (s///) at
/usr/bin/apt-show-versions line 605, <FILE> line 634.
Use of uninitialized value $value in substitution (s///) at
/usr/bin/apt-show-versions line 604, <FILE> line 637.
Use of uninitialized value $value in substitution (s///) at
/usr/bin/apt-show-versions line 605, <FILE> line 637.
Parsing /var/lib/apt/lists/[redacted]_binary-amd64_Packages... completed.
# dpkg -l | grep apt-show-versions
ii apt-show-versions 0.22.13+nmu1 all lists available package
versions with distribution
Closer inspection of the FILE shows that the keyword: value pair is not
separated
by an single blank but *two tabs*. (I don't know how IBM create those packages;
I suspect something like "alien" or even manual insertion of control files into
the binary packages.)
It seems that all other apt* can handle this (although it may be a violation of
the Policy?).
Lines 604 and 605 in the script here follow the attempt to split the line into
key and value; and indeed this is done at a colon followed by a single blank.
A minimal modification makes the script behave in my case:
# diff -u apt-show-versions.{ORIG,FIXED}
--- apt-show-versions.ORIG 2022-10-15 11:52:39.000000000 +0200
+++ apt-show-versions.FIXED 2025-07-30 11:33:52.420224220 +0200
@@ -600,7 +600,7 @@
next;
}
unless ((/^Package/) || (/^Version/) || (/^Status/) || (/^Source/) ||
(/^Architecture/)) {next};
- ($key, $value) = split /: /, $_;
+ ($key, $value) = split /:\s+/, $_;
$value =~ s/\n//;
$value =~ s/\s\(.*\)$//; # Remove any Version information in ()
$package->{$key} = $value;
- maybe it will also fix Peter's (the OP's) issue?
(How would I provide a patch that gets recognized as such by the bug tracker?)
Best regards,
Steffen