You are not logged in.

#1 2014-06-10 08:14:55

lboregard
Member
Registered: 2014-05-19
Posts: 23

new versions of packages

hi, i'm currently using the checkupdate script (https://gitorious.org/pacman/mainline/c … 4b7a793326), and it shows me which packages need upgrade.

it shows the version i'm currently running on my machine, but it doesn't show which version would i upgrade to.

does anyone know of a patch for this scripts or some other cli tool that would show me the new versions of packages to be upgraded ?

thanks in advance

Offline

#2 2014-06-10 11:20:11

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: new versions of packages

Why not just use pacman with VerbosePkgLists option enabled in pacman.conf?

:: Starting full system upgrade...
resolving dependencies...
looking for inter-conflicts...

Packages (6):

Name                      Old Version  New Version  Net Change  Download Size

testing/cloog             0.18.1-2     0.18.1-3     0.02 MiB         0.08 MiB
testing/gcc               4.9.0-3      4.9.0-4      -2.63 MiB       21.34 MiB
testing/gcc-libs          4.9.0-3      4.9.0-4      0.00 MiB         1.06 MiB
testing/isl               0.12.2-1     0.13-1       0.29 MiB         0.51 MiB
testing/xf86-video-intel  2.99.911-2   2.99.912-1   0.24 MiB         0.64 MiB

Total Download Size:    23.62 MiB
Total Installed Size:   89.17 MiB
Net Upgrade Size:       -2.08 MiB

:: Proceed with installation? [Y/n] 

Offline

#3 2014-06-10 15:28:31

jjacky
Member
Registered: 2011-11-09
Posts: 347
Website

Re: new versions of packages

karol wrote:

Why not just use pacman with VerbosePkgLists option enabled in pacman.conf?

because it's not used here? It's a -Qu not a -Su operation that is being done, just listing packages.

If you replace, in the script, the -Qqu with simply -Qu you should get both versions displayed. (Side note, kalu can be compiled as CLI, if you want e.g. info about AUR or watched (i.e. non-installed) packages.)

Offline

#4 2014-06-10 16:11:45

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: new versions of packages

jjacky wrote:
karol wrote:

Why not just use pacman with VerbosePkgLists option enabled in pacman.conf?

because it's not used here?

I meant: don't use that script, use 'pacman -Syu'.

Offline

#5 2014-06-10 16:46:17

jjacky
Member
Registered: 2011-11-09
Posts: 347
Website

Re: new versions of packages

karol wrote:
jjacky wrote:
karol wrote:

Why not just use pacman with VerbosePkgLists option enabled in pacman.conf?

because it's not used here?

I meant: don't use that script, use 'pacman -Syu'.

Oh; But (I assume) he only wants to know about pending updates, not necessarily do the upgrade right away. That's the point of such tools/scripts, to know about available updates without having to sync/apply them right away.

Offline

#6 2014-06-10 16:52:03

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: new versions of packages

The current 'checkupdates' included in pacman doesn't show any versions:

$ checkupdates
cloog
gcc
gcc-libs
isl
libsystemd
s-nail
systemd
systemd-sysvcompat
xf86-video-intel

Offline

#7 2014-06-10 16:54:31

ANOKNUSA
Member
Registered: 2010-10-22
Posts: 2,141

Re: new versions of packages

Oh; But (I assume) he only wants to know about pending updates, not necessarily do the upgrade right away. That's the point of such tools/scripts, to know about available updates without having to sync/apply them right away.

~  ❯  # pacman -Syu
[sudo] password for anoknusa: 
:: Synchronizing package databases...
 core                                                                   110.7 KiB   506K/s 00:00 [--------------------------------------------------------] 100%
 extra                                                                 1679.4 KiB   949K/s 00:02 [--------------------------------------------------------] 100%
 community                                                                2.2 MiB  1016K/s 00:02 [--------------------------------------------------------] 100%
 multilib is up to date
:: Starting full system upgrade...
resolving dependencies...
looking for inter-conflicts...

Packages (2):

Name              Old Version  New Version  Net Change  Download Size

core/binutils     2.24-4       2.24-5       0.07 MiB         4.08 MiB
community/nodejs  0.10.28-3    0.10.29-1    -0.78 MiB        3.16 MiB

Total Download Size:    7.24 MiB
Total Installed Size:   37.73 MiB
Net Upgrade Size:       -0.71 MiB

:: Proceed with installation? [Y/n] n
~  ❯                                  

Without more input from the OP, it's hard to imagine what purpose knowing the version number without upgrading would serve. In anticipation of a possible response: Partial updates are not supported and strongly discouraged.

Offline

#8 2014-06-10 16:56:49

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: new versions of packages

'echo n | sudo pacman -Syu' should work w/o user input.

'pacman -Qu' shows the current versions, not the new ones.

Offline

#9 2014-06-10 17:17:45

jjacky
Member
Registered: 2011-11-09
Posts: 347
Website

Re: new versions of packages

Right, so anything involving Sy without u (inc. saying no to performing the upgrade) isn't good/supported, obviously. Which leads us back to such tools/scripts, handling using temporary dbs automatically.

karol wrote:

'pacman -Qu' shows the current versions, not the new ones.

Oh? Does for me:

% pacman --dbpath /tmp/checkup-db-jjacky/ -Qu  | head -1
binutils 2.24-4 -> 2.24-5

Although I just realized I'm running a pacman-git so maybe it's new/doesn't do it with the latest stable?

Offline

#10 2014-06-10 17:19:55

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: new versions of packages

$ pacman -Qu  | head -1
cloog 0.18.1-2

I edited the 'checkupdates' script:

#pacman -Qqu --dbpath "$CHECKUPDATES_DB" 2> /dev/null
/usr/bin/paste -d " " <(/usr/bin/printf "%-20.20s %-20s => \n" $(/usr/bin/pacman -Qu)) <(/usr/bin/pacman -Sdp --print-format "%v" $(/usr/bin/pacman -Qqu))
$ checkupdates
cloog                0.18.1-2             =>  0.13-1
gcc                  4.9.0-3              =>  0.18.1-3
gcc-libs             4.9.0-3              =>  4.9.0-4
isl                  0.12.2-1             =>  4.9.0-4
libsystemd           213-8                =>  213-9
s-nail               14.6.4-1             =>  14.7-1
systemd              213-8                =>  213-9
systemd-sysvcompat   213-8                =>  213-9
xdg-utils            1.1.0.git20140207-1  =>  1.1.0.git20140426-1
xf86-video-intel     2.99.911-2           =>  2.99.912-1

Edit: This doesn't look right. The version numbers got mixed up - look at cloog for example.

Last edited by karol (2014-06-10 17:21:51)

Offline

#11 2014-06-10 17:48:49

jjacky
Member
Registered: 2011-11-09
Posts: 347
Website

Re: new versions of packages

karol wrote:

Edit: This doesn't look right. The version numbers got mixed up - look at cloog for example.

Yeah I'm guessing the order from -Sdp isn't the one you'd like, because packages might be ordered based on which repo they were found or something (since pacman would still process a dependency before the package requiring it and such), so you can't really do that. (Also you'd want to double the "d" else it could still pull new dependencies.)

Offline

#12 2014-06-10 17:52:04

lboregard
Member
Registered: 2014-05-19
Posts: 23

Re: new versions of packages

thanks,  what im looking for is to know to which versions im updating the packages... some of what i have move so fast i dont know what id be installing before doing pacman -Syu,  not doing partial updates

Offline

#13 2014-06-10 19:39:14

ANOKNUSA
Member
Registered: 2010-10-22
Posts: 2,141

Re: new versions of packages

some of what i have move so fast i dont know what id be installing before doing pacman -Syu

What do you mean by this? What "moves so fast," and how do you not know what you're installing?

jjacky wrote:

Right, so anything involving Sy without u (inc. saying no to performing the upgrade) isn't good/supported, obviously. Which leads us back to such tools/scripts, handling using temporary dbs automatically.

"pacman -Sy <package> is a bad idea, but simply refreshing the database is fine. There are no "temporary" pacman databases. The danger in partial upgrades is in installing packages whose libraries or dependencies conflict with other installed packages. The purpose of the checkupdates script is to pipe a list of pending updates to some status or notification script or daemon; it's to alert you that there are updates, not provide a complete run-down of everything awaiting approval. If you need comprehensive information on software that is installed or is to be installed, the package manager is there for you. You can always choose not to proceed with an update without any risk, provided the next system update is a complete one.

Last edited by ANOKNUSA (2014-06-10 19:48:05)

Offline

#14 2014-06-10 20:11:40

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: new versions of packages

What about

$ expac "%n %v" -S $(checkupdates)
flashplugin 11.2.202.359-1
s-nail 14.7-1

Offline

#15 2014-06-10 21:16:47

fungle
Member
Registered: 2014-05-01
Posts: 81

Re: new versions of packages

Edit the checkupdates script and take out the -q quiet switch on line 40. It should look like this

40 pacman -Qu --dbpath "$CHECKUPDATES_DB" 2> /dev/null

Offline

#16 2014-06-10 21:22:15

jjacky
Member
Registered: 2011-11-09
Posts: 347
Website

Re: new versions of packages

ANOKNUSA wrote:

"pacman -Sy <package> is a bad idea, but simply refreshing the database is fine. There are no "temporary" pacman databases. The danger in partial upgrades is in installing packages whose libraries or dependencies conflict with other installed packages. The purpose of the checkupdates script is to pipe a list of pending updates to some status or notification script or daemon; it's to alert you that there are updates, not provide a complete run-down of everything awaiting approval. If you need comprehensive information on software that is installed or is to be installed, the package manager is there for you. You can always choose not to proceed with an update without any risk, provided the next system update is a complete one.

Actually, no. Doing a pacman -Sy, or "simply refreshing the database" as you put it, is just as bad, because then your next "pacman -S foobar" is really a "pacman -Sy foobar" And that's exactly why tools/scripts like the ones mentionned here use "temporary" databases, as in they make a temporary copy of the dbs, and sync those to get the list of available updates *without* affecting the system.

Quoting the very link you yourself posted earlier:

Do not use pacman -Sy package or any equivalent such as pacman -Sy and then pacman -S package

So you don't want sucha tool/script to perform a -Sy, because then you will forget about it and it will lead you to doing a "-Sy foobar" without realizing it, and wondering why everything is broken.

Offline

#17 2014-06-10 22:31:12

ANOKNUSA
Member
Registered: 2010-10-22
Posts: 2,141

Re: new versions of packages

jjacky wrote:

Quoting the very link you yourself posted earlier:

Do not use pacman -Sy package or any equivalent such as pacman -Sy and then pacman -S package

Indeed. Now read the next sentence in that section.

I'm still curious as to why the the OP needs to know what version a package will be upgraded to before actually considering an update---if the idea is to hold off until a particular package reaches a particular version, that's just a bad idea---but I'm afraid I've already derailed this thread, so I'll stop.

Offline

#18 2014-06-10 22:51:58

fungle
Member
Registered: 2014-05-01
Posts: 81

Re: new versions of packages

Ok, so I've been messing around with the checkupdates script some more, my previous post only shows the old version number of the packages that need to be upgraded. Here is the new code that will print out the packages that need to be updated along with the old version number and the new version number in the format PackageName   OldVersion => NewVersion.

40    # pacman -Qu --dbpath "$CHECKUPDATES_DB" 2> /dev/null
41    PACKNAME=($(pacman -Qqu --dbpath "$CHECKUPDATES_DB" 2> /dev/null))
42    OLDVER=($(pacman -Qu --dbpath "$CHECKUPDATES_DB" 2> /dev/null | awk -v ORS=' ' '{ print $2 }'))
43    NEWVER=($(pacman -Si --dbpath "$CHECKUPDATES_DB" ${PACKNAME[@]} 2> /dev/null \
44           | awk -v ORS=' ' '/^Version/ { print $3}'))
45    for ((i=0; i<${#PACKNAME[@]}; i++)) do
46       echo -e "${PACKNAME[$i]}\t${OLDVER[$i]} => ${NEWVER[$i]}"
47    done

Edit:

jasonwryan wrote:

Minor point: awk handles pattern matching, so you don't need the grep pipe.

Fixed.

Last edited by fungle (2014-06-10 23:43:46)

Offline

#19 2014-06-10 22:53:48

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: new versions of packages

Nice.

Minor point: awk handles pattern matching, so you don't need the grep pipe.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#20 2014-06-10 23:09:06

jjacky
Member
Registered: 2011-11-09
Posts: 347
Website

Re: new versions of packages

Nice indeed.

(And just for the record, next version of pacman will indeed do so on -Qu)

Offline

#21 2014-06-10 23:40:18

HalosGhost
Forum Fellow
From: Twin Cities, MN
Registered: 2012-06-22
Posts: 2,097
Website

Re: new versions of packages

Here's my thought, to those that are messing with the script itself. When you've gotten it to do something productive (like adding version numbers to the output), offer that as a commit upstream. It'd be nice if it were to become official!

All the best,

-HG

Offline

#22 2014-06-10 23:50:10

fungle
Member
Registered: 2014-05-01
Posts: 81

Re: new versions of packages

That's true, however, as per jjacky's post, pacman -Qu will do what my little hack just did so eventually it'll be redundant.

Offline

#23 2014-06-11 00:05:41

lboregard
Member
Registered: 2014-05-19
Posts: 23

Re: new versions of packages

thanks a lot to you all for the feedback !!

will use the updated script from fungle, until pacman -Qu does the same smile

Offline

#24 2014-06-11 03:33:11

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,672
Website

Re: new versions of packages

It would be good if someone sent a patch to pacman-dev to implement this...

Offline

#25 2014-06-11 03:51:24

Jristz
Member
From: America/Santiago
Registered: 2011-06-11
Posts: 1,048

Re: new versions of packages

Yes send the patch, send the patch, Not make the benefit only for you, I'm sure all want it.
Life is a two way road

I could do it but I'm not sure if the change is finished or you do want add more

Last edited by Jristz (2014-06-11 03:52:59)


Lenovo ThinkPad L420 modified
:: Intel i7 2560QM :: 8 GB RAM :: SSD 256 GB ::
:: DVD read+Writter :: 3 USB 3.0 Expresa Card ::
:: a Favulous 1 mins lasting Io-Li battery ::cry::

Offline

Board footer

Powered by FluxBB