You are not logged in.

#1 2006-11-06 20:02:54

vredfreak
Member
Registered: 2004-11-20
Posts: 66

List package differences?

Ok, here's what I would like to do.  I want to compare the versions of the packages installed on my system against the versions in the repos, just like "pacman -Syu".  But, I would like pacman to simply list the packages instead of asking to install.  I want to copy the list output to a file.

I'm aware of the --noconfirm option, but I don't want pacman to take any action at all, simply list the packages.

Can this be done?


Hi.  I'm a sig.  What are you?

Offline

#2 2006-11-06 20:41:16

dojo
Member
Registered: 2005-11-02
Posts: 97

Re: List package differences?

pacman -Syp

This updates your package database and prints out the URL of packages which could be updated. Of course this is not what you want but the closest thing to that.

Greets

dojo

Offline

#3 2006-11-06 21:20:35

vredfreak
Member
Registered: 2004-11-20
Posts: 66

Re: List package differences?

pacman -Syp

Thanks dojo.  Does this also list the package names?  I can't test it on my machine because everything's up to date.  If it does, then I can work with that.

I'm just trying to find a better way for conky to let me know what updates are available.  As it is now, I have to use the --noconfirm and -w options so that the pacman will quit at some point.  If I use pacman -Syu, pacman will keep running until it gets some sort of confirmation, which it will never get.

Here's what I have now.

#!/bin/bash

LOGFILE=pacman.log

pacman -Sywu --noprogressbar --noconfirm > pacman.log

if less $LOGFILE | grep "Target"; then
    sed -n '{/^Target.*/p;/^ .*/p}' pacman.log | cut -b 10-
else
    echo No updates available.
fi

This works, but I'd rather not have to download the packages everytime.


Hi.  I'm a sig.  What are you?

Offline

#4 2006-11-06 21:46:06

Dusty
Schwag Merchant
From: Medicine Hat, Alberta, Canada
Registered: 2004-01-18
Posts: 5,986
Website

Re: List package differences?

IIRC, the -p option lists the URIs to the packages, eg:

http://www.mirror.net/path/to/parkages/ … pkg.tar.gz

You should be able to use awk or cut or something to extract the packagename out of that path; cut it between the last / and the last -. (This is why pkgver isn't allowed to have a - in it! ;-))

Dusty

Offline

#5 2006-11-06 21:53:12

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: List package differences?

Assuming you're in a -Sy state, you can use:

pacman -Sup | sed 's|.*/([^-]*)-(.*).pkg.tar.gz|1 upgrade 2|g'

Offline

#6 2006-11-06 22:07:42

vredfreak
Member
Registered: 2004-11-20
Posts: 66

Re: List package differences?

Dusty wrote:

IIRC, the -p option lists the URIs to the packages, eg:

http://www.mirror.net/path/to/parkages/ … pkg.tar.gz

You should be able to use awk or cut or something to extract the packagename out of that path; cut it between the last / and the last -. (This is why pkgver isn't allowed to have a - in it! ;-))

Dusty

I was afraid of that.  You're right though, I can get what I need from that.

Daniel


Hi.  I'm a sig.  What are you?

Offline

#7 2006-11-06 22:10:24

vredfreak
Member
Registered: 2004-11-20
Posts: 66

Re: List package differences?

phrakture wrote:

Assuming you're in a -Sy state, you can use:

pacman -Sup | sed 's|.*/([^-]*)-(.*).pkg.tar.gz|1 upgrade 2|g'

That's handy.  Just have to format the output a liitle so that conky doesn't eat up too much real estate.  Thanks.

Daniel

PS.  It probably would have taken me all night to come up with that regexp expression.  I stink with that.


Hi.  I'm a sig.  What are you?

Offline

Board footer

Powered by FluxBB