[pacman-dev] wanted: script to list uninstalled optdepends and packages that need them
Hi all, I had a thought today that a script to list package that are optdepends but not installed could be quite useful... I have not written one, but thought it would be good for pacman-contrib if someone wanted to contribute. Example output: tk - optional for: ruby - for Ruby/TK python - for IDLE, pynche and modulator fakeroot - optional for: pacman - for makepkg usage as normal user So get script writing! Preferably in bash or perl (which the current scripts use). Allan
On Mon, Jun 15, 2009 at 6:29 PM, Allan McRae<allan@archlinux.org> wrote:
Hi all,
I had a thought today that a script to list package that are optdepends but not installed could be quite useful... I have not written one, but thought it would be good for pacman-contrib if someone wanted to contribute.
Example output:
tk - optional for: ruby - for Ruby/TK python - for IDLE, pynche and modulator fakeroot - optional for: pacman - for makepkg usage as normal user
So get script writing! Preferably in bash or perl (which the current scripts use).
If we implemented one of your suggestion for optdepends handling, which is to display when an optdepends is installed or not, then it should be very easy to do something of this kind, just using pacman -Qi and grep :)
I had a thought today that a script to list package that are optdepends but not installed could be quite useful... I have not written one, but thought it would be good for pacman-contrib if someone wanted to contribute.
Example output:
tk - optional for: ruby - for Ruby/TK python - for IDLE, pynche and modulator fakeroot - optional for: pacman - for makepkg usage as normal user
So get script writing! Preferably in bash or perl (which the current scripts use).
If we implemented one of your suggestion for optdepends handling, which is to display when an optdepends is installed or not, then it should be very easy to do something of this kind, just using pacman -Qi and grep :)
I've attached a script to list uninstalled optdepends for installed packages as Allan requested. I didn't spend much time on it though because Xavier's comment casts doubt on its usefulness. There may be a few bugs in it such as missed packages. I can probably improve it if you think it would be useful. Some caveats for the script: It parses the output of "pacman -Qi". It expects the above to be in English. It strips off the version specifications to simplify checks. It considers all packages provided by an installed package to be installed themselves. and yeah, I'm now folloing this list too
Xyne wrote:
I had a thought today that a script to list package that are optdepends but not installed could be quite useful... I have not written one, but thought it would be good for pacman-contrib if someone wanted to contribute.
Example output:
tk - optional for: ruby - for Ruby/TK python - for IDLE, pynche and modulator fakeroot - optional for: pacman - for makepkg usage as normal user
So get script writing! Preferably in bash or perl (which the current scripts use).
If we implemented one of your suggestion for optdepends handling, which is to display when an optdepends is installed or not, then it should be very easy to do something of this kind, just using pacman -Qi and grep :)
I've attached a script to list uninstalled optdepends for installed packages as Allan requested. I didn't spend much time on it though because Xavier's comment casts doubt on its usefulness. There may be a few bugs in it such as missed packages. I can probably improve it if you think it would be useful.
Some caveats for the script: It parses the output of "pacman -Qi". It expects the above to be in English. It strips off the version specifications to simplify checks. It considers all packages provided by an installed package to be installed themselves.
and yeah, I'm now folloing this list too
Cool.... but something is slightly wrong there: libburn - optional for: brasero: alternative back-end bzip2: alternative back-end bzip2 probably does not have a libbrun backend :) Allan
On Tue, Jun 16, 2009 at 2:22 AM, Allan McRae<allan@archlinux.org> wrote:
bzip2 probably does not have a libbrun backend :)
no it doesn't, but it could be nice to be able to direcly burn archives :-p Ronald
Cool.... but something is slightly wrong there:
libburn - optional for: brasero: alternative back-end bzip2: alternative back-end
bzip2 probably does not have a libbrun backend :)
Allan
I don't know how that happened (haven't been able to reproduce the error here). I did find some other bugs though so maybe that one was fixed indirectly. I've attached a new version. If it still lies, send me the output of "pacman -Qi".
Xyne wrote:
Cool.... but something is slightly wrong there:
libburn - optional for: brasero: alternative back-end bzip2: alternative back-end
bzip2 probably does not have a libbrun backend :)
Allan
I don't know how that happened (haven't been able to reproduce the error here). I did find some other bugs though so maybe that one was fixed indirectly. I've attached a new version. If it still lies, send me the output of "pacman -Qi".
Works fine now. Thanks. Allan
Allan McRae wrote:
Xyne wrote:
Cool.... but something is slightly wrong there:
libburn - optional for: brasero: alternative back-end bzip2: alternative back-end
bzip2 probably does not have a libbrun backend :)
Allan
I don't know how that happened (haven't been able to reproduce the error here). I did find some other bugs though so maybe that one was fixed indirectly. I've attached a new version. If it still lies, send me the output of "pacman -Qi".
Works fine now. Thanks.
As an aside, what this has made me realize is that the style of optdepends specification varies a bit within the packages our repos (some do not even use ":"'s to separate the package name from the description). If they are going to become more than informational, this needs to become more standardized. Maybe makepkg needs to add a check on the style. Allan
Is there already something that can list optdepends from the local db regardless of their install status? Example: query local db (either with pacman -Qi or search lib) pick out optdepends filter packages that have optdepends match filter output eg.: $optdepend1 = $pkg1, $pkg2, $pkg3 $optdepend2 (installed) = $pkg1, $pkg4 I tried this before with bash, but after it got too frustrating I gave up. I had stuff like: ... pacman -Qi | grep -v "Optional Deps : None" | sed '/^Version/,/^Depends/d' | sed '/^Required/,/^$/d' | sed 's:Name:\nName:' ... and then I got desperate: ... ... for i in $DB/*; do if grep "%OPTDEPENDS%" $i/depends > /dev/null; then echo -n " .. " PKG=$( sed -n '/%NAME%/,/^$/p' $i/desc | sed \ -e '/%NAME%/d' \ -e '/^$/d' ) PKG_OPTDEPS=($( sed -n '/%OPTDEPENDS%/,/^$/p' $i/depends | sed \ -e '/%OPTDEPENDS%/d' \ -e 's/:.*//' \ -e '/^$/d' )) ... ... which is just plain stupid and slow. The fact that optdepends specification is not standardised added just more room for faults, so I stopped trying entirely. Xyne, please do something about this with perl =p I'd really like some power to optdepends, at least until pacman treats it nicely.
Is there already something that can list optdepends from the local db regardless of their install status?
Example:
query local db (either with pacman -Qi or search lib) pick out optdepends filter packages that have optdepends match filter output eg.:
$optdepend1 = $pkg1, $pkg2, $pkg3 $optdepend2 (installed) = $pkg1, $pkg4
Xyne, please do something about this with perl =p I'd really like some power to optdepends, at least until pacman treats it nicely.
I remove the "if" statement from the script that I posted earlier to ignore the optdep installation status. Try the attached script and let me know if it does what you want (I think it does, based on your description). For those interested, take a look at Juster's script which uses his alpm module: http://bbs.archlinux.org/viewtopic.php?pid=569921 /Xyne
OK great, thanks. Both can be used together now - one for missingopts and one for allopts. Anyway there are going to be a few inconsistencies, aside from the format problems, mainly those of provisions (eg. qt is provided by qtmod but qt will be stated as a missing optdepend anyway). No way around that without further complexity (match with $provides).
OK great, thanks. Both can be used together now - one for missingopts and one for allopts.
Anyway there are going to be a few inconsistencies, aside from the format problems, mainly those of provisions (eg. qt is provided by qtmod but qt will be stated as a missing optdepend anyway). No way around that without further complexity (match with $provides).
It already matches "provides" ;) The scripts are identical except for a single "if" statement. It would be trivial to add an option to switch between them if the script is actually going to be used for something.
On Mon, Jun 15, 2009 at 8:45 PM, Allan McRae<allan@archlinux.org> wrote:
Allan McRae wrote:
Xyne wrote:
Cool.... but something is slightly wrong there:
libburn - optional for: brasero: alternative back-end bzip2: alternative back-end
bzip2 probably does not have a libbrun backend :)
Allan
I don't know how that happened (haven't been able to reproduce the error here). I did find some other bugs though so maybe that one was fixed indirectly. I've attached a new version. If it still lies, send me the output of "pacman -Qi".
Works fine now. Thanks.
As an aside, what this has made me realize is that the style of optdepends specification varies a bit within the packages our repos (some do not even use ":"'s to separate the package name from the description). If they are going to become more than informational, this needs to become more standardized. Maybe makepkg needs to add a check on the style.
Apparently my "similar to the following" text in man PKGBUILD was not enough. :( I'd be fine with a check added to makepkg, although I never wanted to get draconian about it (and I never meant for it to become machine-parseable, but it seems I am in the minority there). -Dan
Dan McGee wrote:
On Mon, Jun 15, 2009 at 8:45 PM, Allan McRae<allan@archlinux.org> wrote:
Allan McRae wrote:
Xyne wrote:
Cool.... but something is slightly wrong there:
libburn - optional for: brasero: alternative back-end bzip2: alternative back-end
bzip2 probably does not have a libbrun backend :)
Allan
I don't know how that happened (haven't been able to reproduce the error here). I did find some other bugs though so maybe that one was fixed indirectly. I've attached a new version. If it still lies, send me the output of "pacman -Qi".
Works fine now. Thanks.
As an aside, what this has made me realize is that the style of optdepends specification varies a bit within the packages our repos (some do not even use ":"'s to separate the package name from the description). If they are going to become more than informational, this needs to become more standardized. Maybe makepkg needs to add a check on the style.
Apparently my "similar to the following" text in man PKGBUILD was not enough. :(
I'd be fine with a check added to makepkg, although I never wanted to get draconian about it (and I never meant for it to become machine-parseable, but it seems I am in the minority there).
I know, but now they are there, it is just too tempting to leave them alone... I added a bug report so this does not get forgotten: http://bugs.archlinux.org/task/15125 Allan
Apparently my "similar to the following" text in man PKGBUILD was not enough. :(
I'd be fine with a check added to makepkg, although I never wanted to get draconian about it (and I never meant for it to become machine-parseable, but it seems I am in the minority there).
I know, but now they are there, it is just too tempting to leave them alone...
I added a bug report so this does not get forgotten: http://bugs.archlinux.org/task/15125
Even if pacman never ends up doing something with the optdepends, standardizing them makes the output homogeneous. More importantly it enables others *cough* to write code to parse and handle them. Requiring that a user specify an optdep either exactly as deps are currently specified or followed by a colon and a reason is not draconian. It's just sane and practical.
Xavier wrote:
On Mon, Jun 15, 2009 at 6:29 PM, Allan McRae<allan@archlinux.org> wrote:
Hi all,
I had a thought today that a script to list package that are optdepends but not installed could be quite useful... I have not written one, but thought it would be good for pacman-contrib if someone wanted to contribute.
Example output:
tk - optional for: ruby - for Ruby/TK python - for IDLE, pynche and modulator fakeroot - optional for: pacman - for makepkg usage as normal user
So get script writing! Preferably in bash or perl (which the current scripts use).
If we implemented one of your suggestion for optdepends handling, which is to display when an optdepends is installed or not, then it should be very easy to do something of this kind, just using pacman -Qi and grep :)
Maybe, but i think this script would still be very useful to show what you could install and what for. I actually found it useful just now as I saw a couple of uninstall optdepends that could be used by more than one program. That makes them far more attractive to install. Allan
participants (6)
-
Allan McRae
-
Dan McGee
-
Ray Rashif
-
Ronald van Haren
-
Xavier
-
Xyne