[arch-general] Handling optional dependencies with pacman?
Listmates, Is there a better way to handle optional dependencies than just manually creating a list and checking it against the current installed packages to see if you need to install them before issuing the sync command and having some of the packages reinstalled? Basically, after installing packages (most recently openoffice and gimp), I just cut-and-paste the names into a for loop and check the names against the installed packages with the query option to eliminate the packages that are already installed. For openoffice and gimp, the optional dependencies were: Targets (9): libwpd-0.8.14-1 icu-4.0-2 hsqldb-java-1.8.0.10-1 openoffice-base-3.0.1-1 babl-0.0.22-1 gegl-0.0.22-1 gimp-2.6.6-1 gimp-refocus-0.9.0-2 gimp-ufraw-0.15-2 Total Download Size: 172.88 MB Total Installed Size: 422.08 MB Proceed with installation? [Y/n] :: Retrieving packages from extra... <snip> Optional dependencies for openoffice-base java-runtime: adds java support libcups: adds printing support gconf: adds additional gnome support nss: adds support for signed files/macros pstoedit: translates PostScript and PDF graphics into other vector formats <snip> Optional dependencies for gimp gutenprint: for sophisticated printing only as gimp has built-in cups print support libwebkit: for the help browser poppler-glib: for pdf support hal: for Linux input event controller module alsa-lib: for MIDI event controller module <snip> Optional dependencies for gimp-ufraw gimp: to use the gimp import plugin for raw images cinepaint: to use the cinepaint import plugin for raw images So I then do: for i in gutenprint libwebkit poppler-glib alsa-lib cinepaint java-runtime libcups gconf nss pstoedit; do pacman -Q $i; done Which tells me: error: package "gutenprint" not found error: package "libwebkit" not found error: package "poppler-glib" not found alsa-lib 1.0.19-1 error: package "cinepaint" not found error: package "java-runtime" not found libcups 1.3.10-1 gconf 2.26.0-3 error: package "nss" not found error: package "pstoedit" not found So I then know I need to install: gutenprint libwebkit poppler-glib cinepaint java-runtime nss pstoedit. That brings up a couple of questions. First, for those packages I have reinstalled I notice "Total Download Size: 0.0 MB", so I know I'm not re-downloading, but is the package actually "reinstalling" where the config files with end up with x.pacnew packages?? Next, is there any wrapper for pacman that will catch the output in a temporary file and then grep for "Optional dependencies" and then do something like: while read line; do tmparray[$count]=(${line%%:*}) done < tmpfile And then do something useful with tmparray like compare it against the installed packages and maybe write it out in something like ~/tmp/pacman/optDeps$(date '+%Y%m%d')? Just checking to see if there is an easy way to avoid a few cut and pastes. -- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com
On Thu, Apr 23, 2009 at 7:44 PM, David C. Rankin <drankinatty@suddenlinkmail.com> wrote:
So I then do:
for i in gutenprint libwebkit poppler-glib alsa-lib cinepaint java-runtime libcups gconf nss pstoedit; do pacman -Q $i; done
I would go for: pacman --asdeps --needed gutenprint libwebkit poppler-glib alsa-lib cinepaint java-runtime libcups gconf nss pstoedit --asdeps will install the packages as dependencies --needed will prevent pacman from reinstalling up-to-date packages as for the wrapper, I don't know Guilherme/Nirev -- Malformed message exception
I would go for:
pacman --asdeps --needed gutenprint libwebkit poppler-glib alsa-lib cinepaint java-runtime libcups gconf nss pstoedit
Oops, forgot the -S pacman --asdeps --needed -S <packages> -- Malformed message exception
Am Thu, 23 Apr 2009 20:11:33 -0300 schrieb "Guilherme M. Nogueira" <g.maionogueira@gmail.com>:
pacman --asdeps --needed -S <packages>
That's the same method I use in such cases. But what always bugged me about it is that packages installed that way will show up as unneeded deps when using pacman -Qdt (only if they are not needed by another package, but still)
David C. Rankin wrote:
Listmates,
Is there a better way to handle optional dependencies than just manually creating a list and checking it against the current installed packages to see if you need to install them before issuing the sync command and having some of the packages reinstalled?
I can think of one: just don't install those packages at all until you need them! DR
On Fri, 24 Apr 2009 10:34:15 -0400 David Rosenstrauch <darose@darose.net> wrote:
David C. Rankin wrote:
Listmates,
Is there a better way to handle optional dependencies than just manually creating a list and checking it against the current installed packages to see if you need to install them before issuing the sync command and having some of the packages reinstalled?
I can think of one: just don't install those packages at all until you need them!
DR
i use 2 custom bash functions. http://bbs.archlinux.org/viewtopic.php?id=59385 There are some rough plans to someday improve optdeps support in pacman itself though :) See http://wiki.archlinux.org/index.php/User:Allan/Pacman_OptDepends Dieter
Dieter Plaetinck wrote:
On Fri, 24 Apr 2009 10:34:15 -0400 David Rosenstrauch <darose@darose.net> wrote:
David C. Rankin wrote:
Listmates,
Is there a better way to handle optional dependencies than just manually creating a list and checking it against the current installed packages to see if you need to install them before issuing the sync command and having some of the packages reinstalled? I can think of one: just don't install those packages at all until you need them!
DR
i use 2 custom bash functions. http://bbs.archlinux.org/viewtopic.php?id=59385
There are some rough plans to someday improve optdeps support in pacman itself though :) See http://wiki.archlinux.org/index.php/User:Allan/Pacman_OptDepends
Dieter
Great, Thanks, that gives me something to shoot for in my spare time ;-) From what I can tell from watching the optional dependencies scroll by, it shouldn't be that bad to capture then, do the necessary checks and then handle the install of the dependencies in some sane manner. The real challenge will be getting more than 3 people to agree on any one way to do it... -- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com
Well, they're optional dependencies. Generally, I don't want them installed, if you mean that pacman should install them automatically. If you mean more that there should be a way to manually install optional dependencies sanely in some way, I agree. I think, though, the problem's not installing them but rather tracking them. Allan's opt dep tracking proposal at the given wiki link sounds like a really good plan though. I'm all for that, nothing further is needed. -AT On Fri, Apr 24, 2009 at 6:38 PM, David C. Rankin <drankinatty@suddenlinkmail.com> wrote:
Dieter Plaetinck wrote:
On Fri, 24 Apr 2009 10:34:15 -0400 David Rosenstrauch <darose@darose.net> wrote:
David C. Rankin wrote:
Listmates,
Is there a better way to handle optional dependencies than just manually creating a list and checking it against the current installed packages to see if you need to install them before issuing the sync command and having some of the packages reinstalled? I can think of one: just don't install those packages at all until you need them!
DR
i use 2 custom bash functions. http://bbs.archlinux.org/viewtopic.php?id=59385
There are some rough plans to someday improve optdeps support in pacman itself though :) See http://wiki.archlinux.org/index.php/User:Allan/Pacman_OptDepends
Dieter
Great,
Thanks, that gives me something to shoot for in my spare time ;-) From what I can tell from watching the optional dependencies scroll by, it shouldn't be that bad to capture then, do the necessary checks and then handle the install of the dependencies in some sane manner. The real challenge will be getting more than 3 people to agree on any one way to do it...
-- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com
participants (6)
-
Andrei Thorp
-
David C. Rankin
-
David Rosenstrauch
-
Dieter Plaetinck
-
Guilherme M. Nogueira
-
Thomas Haider