salt icon indicating copy to clipboard operation
salt copied to clipboard

apt available_version should sort

Open djs52 opened this issue 14 years ago • 3 comments

I have two versions of salt available in my package cache:

djs-admin@thames:~$ apt-cache -q show salt-master|grep ^Version
Version: 0.10.0-1ubuntu5
Version: 0.9.5.1.pre-v0.9.5-1-ga8fdf7db-1

but pkg.available_versions shows the last one listed, instead of the highest listed:

djs-admin@thames:~$ sudo salt 'thames*' pkg.available_version salt-master
{'thames.office.adelard.com': '0.9.5.1.pre-v0.9.5-1-ga8fdf7db-1'}

djs52 avatar Jun 18 '12 11:06 djs52

Very definitively a bug! Thanks!

thatch45 avatar Jun 18 '12 14:06 thatch45

What if we were to take the output of apt-cache policy and compare Installed with Candidate? For example:

$ apt-cache policy sudo
sudo:
  Installed: 1.8.3p1-1ubuntu3.3
  Candidate: 1.8.3p1-1ubuntu3.3
  Version table:
     1.8.5p2-1ubuntu1 0
        500 http://us.archive.ubuntu.com/ubuntu/ quantal/main amd64 Packages
 *** 1.8.3p1-1ubuntu3.3 0
        900 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     1.8.3p1-1ubuntu3.2 0
        900 http://us.archive.ubuntu.com/ubuntu/ precise-security/main amd64 Packages
     1.8.3p1-1ubuntu3 0
        900 http://us.archive.ubuntu.com/ubuntu/ precise/main amd64 Packages

Note that version 1.8.5p2-1ubuntu1 is available but is not a candidate due to certain apt preferences. See https://github.com/saltstack/salt/issues/1772 for the back story.

tvaughan avatar Aug 29 '12 17:08 tvaughan

This is good thinking, and something that we should add in.

thatch45 avatar Aug 29 '12 21:08 thatch45