Debian Bug report logs - #827337
apt-show-versions: option to hide packages that are at the right version based on pinning upgradeable

version graph

Package: apt-show-versions; Maintainer for apt-show-versions is Christoph Martin <martin@uni-mainz.de>; Source for apt-show-versions is src:apt-show-versions (PTS, buildd, popcon).

Reported by: Paul Wise <pabs@debian.org>

Date: Wed, 15 Jun 2016 05:48:01 UTC

Severity: wishlist

Found in version apt-show-versions/0.22.7

Reply or subscribe to this bug.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Christoph Martin <christoph.martin@uni-mainz.de>:
Bug#827337; Package apt-show-versions. (Wed, 15 Jun 2016 05:48:05 GMT) (full text, mbox, link).


Acknowledgement sent to Paul Wise <pabs@debian.org>:
New Bug report received and forwarded. Copy sent to Christoph Martin <christoph.martin@uni-mainz.de>. (Wed, 15 Jun 2016 05:48:05 GMT) (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: Paul Wise <pabs@debian.org>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: apt-show-versions: option to hide packages that are at the right version based on pinning upgradeable
Date: Wed, 15 Jun 2016 13:44:50 +0800
[Message part 1 (text/plain, inline)]
Package: apt-show-versions
Version: 0.22.7
Severity: wishlist

I pin most packages to testing and then have progressively lower pin
values for less desirable suites. I also pin some particular packages
to other suites. I also pin security updates using the script in bug
#725934 to the suite that they come from (mostly unstable). I would
like to have an option to hide packages that are at the right version
based on pinning. So for most packages, hide if they are the version in
testing. For specific packages pinned to a different release, hide if
they are the version from the pinned release. For security updates
pinned to unstable release, hide if they are the version from unstable.

-- System Information:
Debian Release: stretch/sid
  APT prefers testing-debug
  APT policy: (900, 'testing-debug'), (900, 'testing'), (800, 'unstable-debug'), (800, 'unstable'), (790, 'buildd-unstable'), (700, 'experimental-debug'), (700, 'experimental'), (690, 'buildd-experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 4.6.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_AU.utf8, LC_CTYPE=en_AU.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages apt-show-versions depends on:
ii  apt                             1.2.12
ii  libapt-pkg-perl                 0.1.29+b5
ii  libperl5.22 [libstorable-perl]  5.22.2-1
ii  perl                            5.22.2-1

apt-show-versions recommends no packages.

apt-show-versions suggests no packages.

-- no debconf information

-- 

bye,
pabs

https://wiki.debian.org/PaulWise
[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Christoph Martin <christoph.martin@uni-mainz.de>:
Bug#827337; Package apt-show-versions. (Wed, 24 Oct 2018 16:09:02 GMT) (full text, mbox, link).


Acknowledgement sent to Antoine Beaupré <anarcat@debian.org>:
Extra info received and forwarded to list. Copy sent to Christoph Martin <christoph.martin@uni-mainz.de>. (Wed, 24 Oct 2018 16:09:02 GMT) (full text, mbox, link).


Message #10 received at 827337@bugs.debian.org (full text, mbox, reply):

From: Antoine Beaupré <anarcat@debian.org>
To: Paul Wise <pabs@debian.org>, 827337@bugs.debian.org
Subject: Re: Bug#827337: apt-show-versions: option to hide packages that are at the right version based on pinning upgradeable
Date: Wed, 24 Oct 2018 12:05:32 -0400
On 2016-06-15 13:44:50, Paul Wise wrote:
> Package: apt-show-versions
> Version: 0.22.7
> Severity: wishlist
>
> I pin most packages to testing and then have progressively lower pin
> values for less desirable suites. I also pin some particular packages
> to other suites. I also pin security updates using the script in bug
> #725934 to the suite that they come from (mostly unstable). I would
> like to have an option to hide packages that are at the right version
> based on pinning. So for most packages, hide if they are the version in
> testing. For specific packages pinned to a different release, hide if
> they are the version from the pinned release. For security updates
> pinned to unstable release, hide if they are the version from unstable.

I have a similar requirement, at least I think it is. I'm running
testing and pin some packages to "unstable until it hits testing". For
example, I have this for Firefox right now:

Package: firefox-esr
Pin: release n=sid
Pin-Priority: 501

Package: firefox-esr
Pin: release n=buster
Pin: release v=60
Pin-Priority: 502

It gives me a quantum-enabled firefox in buster, from sid, but will
transition to the buster version when it makes it. I also manually
install some packages from sid that are missing from buster in the hope
they transition.

I use apt-show-versions to keep track of those transitions. This
requires me to add a filter to hide "uptodate" entries from
"buster". For example, here's the output I am looking at right now:

$ apt-show-versions  | grep -v '/buster [^ ]* uptodate'
firefox-esr:amd64/sid 60.3.0esr-1 uptodate
network-manager-iodine:amd64/sid 1.2.0-3 uptodate
network-manager-iodine-gnome:amd64/sid 1.2.0-3 uptodate
printer-driver-postscript-hp:amd64 not installed
python-hvac:amd64 0.6.4-1 installed: No available version in archive
wireguard:all/sid 0.0.20181018-1 uptodate
wireguard-dkms:all/sid 0.0.20181018-1 uptodate
wireguard-tools:amd64/sid 0.0.20181018-1 uptodate

The first three and last three are normal there: both firefox-esr,
wireguard, and nm-iodine have excuses for not migrating to testing. The
`not installed` bit doesn't belong there but that's #783781. The
python-hvac one is interesting: it's a package that is currently in WNPP
(#875603) that I've worked on. Hopefully it will get there as well.

So that's really nice, but I always forget that cute regex. I wished
there was a way to simply add an option to get that clean output. I
tried this patch:

diff --git i/apt-show-versions w/apt-show-versions
index 3df13c7..6266b10 100755
--- i/apt-show-versions
+++ w/apt-show-versions
@@ -79,6 +79,7 @@ unless (GetOptions (\%opts,
         'upgradeable|u',
         'brief|b',
         'nohold|nh',
+        'nouptodate|nu',
         'initialize|i',
         'verbose|v',
        'version|V',
@@ -143,6 +144,7 @@ Options:
  -a|--allversions           Print all available versions.
  -b|--brief                 Short output.
  -nh|--nohold               Don't treat holded packages.
+ -nu|--nouptodate           Don't display up to date packages.
  -i|--initialize            Initialize or update package cache only (as root).
  -v|--verbose               Verbose messages.
  -V|--version              Prints apt-show-versions version
@@ -458,7 +460,9 @@ sub print_package_internal {
                 ($found, @version_info) =
                    &print_version(($irelease ? $irelease : &get_rel_name($_->{$RELEASE})),
                                    $pkgarch, $iversion, $version, $cand);
-                push @print_info, @version_info if ($found);
+                if ($found and ($found != 1 or !$opts{'nouptodate'})) {
+                    push @print_info, @version_info;
+                }
                 $aversion = $version;
             }
             $is_upgradeable = 1 if ($found == 2);

But that doesn't give the right output:

$ ./apt-show-versions --nouptodate
python-hvac:amd64 0.6.4-1 installed: No available version in archive

Obviously, it removes just all uptodate packages, regardless of
suite. There should be a way to figure out if the found release (the
$irelease thing above) is the default release, but unfortunately
apt-show-versions does not have a good notion of what that is. It only
relies on APT::Default-Release (#875603) and that's usually not defined.

What *is* the proper way of figuring out what the default release is? Or
should we have a --ignore flag that would ignore a certain suite?

So I'm not sure if there's a clean way of fixing this.

A.

-- 
No animal has more liberty than the cat; but it buries the mess it
makes. The cat is the best anarchist. Until they learn that from the cat
I cannot respect them.
                        - For whom the bell tolls, Ernest Hemingway



Information forwarded to debian-bugs-dist@lists.debian.org, Christoph Martin <christoph.martin@uni-mainz.de>:
Bug#827337; Package apt-show-versions. (Thu, 25 Oct 2018 00:27:03 GMT) (full text, mbox, link).


Acknowledgement sent to Paul Wise <pabs@debian.org>:
Extra info received and forwarded to list. Copy sent to Christoph Martin <christoph.martin@uni-mainz.de>. (Thu, 25 Oct 2018 00:27:03 GMT) (full text, mbox, link).


Message #15 received at 827337@bugs.debian.org (full text, mbox, reply):

From: Paul Wise <pabs@debian.org>
To: Antoine Beaupré <anarcat@debian.org>, 827337@bugs.debian.org, APT Developers <deity@lists.debian.org>
Subject: Re: Bug#827337: apt-show-versions: option to hide packages that are at the right version based on pinning upgradeable
Date: Thu, 25 Oct 2018 08:23:11 +0800
[Message part 1 (text/plain, inline)]
On Wed, 2018-10-24 at 12:05 -0400, Antoine Beaupré wrote:

> What *is* the proper way of figuring out what the default release is?
> Or should we have a --ignore flag that would ignore a certain suite?

APT developers: we could use your help on this bug report:

https://bugs.debian.org/827337

Using the APT Perl libraries, what is the right way to determine if the
currently installed version of a package matches the default release
and pinning setup configured by the system or if the installed version
was manually updated to a non-default release?

I guess this is pretty complicated, since different pinning value
ranges have different meanings and this should affect the results.

-- 
bye,
pabs

https://wiki.debian.org/PaulWise

[signature.asc (application/pgp-signature, inline)]

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Thu Nov 21 23:40:44 2024; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.