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

2018-10-24 Thread Paul Wise
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
Description: This is a digitally signed message part


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

2018-10-24 Thread Antoine Beaupré
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|--initializeInitialize 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) =
_version(($irelease ? $irelease : 
_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



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

2016-06-14 Thread Paul Wise
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  perl5.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
Description: This is a digitally signed message part