[arch-general] Handling optional dependencies with pacman?

David C. Rankin drankinatty at suddenlinkmail.com
Thu Apr 23 18:44:29 EDT 2009


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


More information about the arch-general mailing list