From 0939e55b013ea5c45ad19304e78025becfe1962e Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Tue, 27 Aug 2024 21:11:35 -0700 Subject: [PATCH] Include version of package to get from debian https://github.com/webmin/webmin/issues/2261 --- software/debian-lib.pl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/software/debian-lib.pl b/software/debian-lib.pl index 951b8134c..29d2acc7e 100755 --- a/software/debian-lib.pl +++ b/software/debian-lib.pl @@ -49,12 +49,13 @@ return lc($_[0]) =~ /^[a-e]/ ? "A-E" : lc($_[0]) =~ /^[u-z]/ ? "U-Z" : "Other"; } -# package_info(package) +# package_info(package, [version]) # Returns an array of package information in the order # name, class, description, arch, version, vendor, installtime sub package_info { -local $qm = quotemeta($_[0]); +local ($pkg, $ver) = @_; +local $qm = quotemeta($pkg); # First check if it is really installed, and not just known to the package # system in some way @@ -67,6 +68,7 @@ if ($lines[$#lines] !~ /^.[ih]/) { # Get full status local $out; if (&has_command("apt-cache")) { + $qm .= ":".quotemeta($ver) if ($ver); $out = &backquote_command("apt-cache show $qm 2>&1", 1); $out =~ s/[\0-\177]*\r?\n\r?\n(Package:)/\\1/; # remove available ver }