You are not logged in.

#1 2009-11-06 17:57:28

Alain2
Member
From: France
Registered: 2009-11-06
Posts: 17

[SOLVED] pacman log optional dependencies

Hi,

Coming from ubuntu, just been trying Arch to get to know better the linux system and try a more KISS approach. I really like it, however I had a few troubles on the way which I am resolving slowly.. however concrenng pacman, maybe I am blind but I can't find a way to get all the messages displayed during some package installation in the pacman.log ; in particular all the optional dependencies are not listed there..

Is there a way to get the full pacman log as shown during the installation in a log file ?

Last edited by Alain2 (2009-11-08 02:05:52)

Offline

#2 2009-11-07 03:12:11

x33a
Forum Fellow
Registered: 2009-08-15
Posts: 4,587

Re: [SOLVED] pacman log optional dependencies

if you are looking for the dependencies of a package, try

pacman -Si <pkgname>

Offline

#3 2009-11-07 07:14:14

kermana
Member
Registered: 2009-04-13
Posts: 60

Re: [SOLVED] pacman log optional dependencies

I think you are right.  When I remove xarchiver and install again:

Optional dependencies for xarchiver
    tar: TAR support
    gzip: GZIP support
    bzip2: BZIP2 support
    zip: ZIP support
    unzip: ZIP support
    unrar: RAR support
    p7zip: 7z support
    arj: ARJ support
    lha: LHA support
    lzma-utils: LZMA support
    lzop: LZOP support

This is written to the console but not to the logs ... maybe on purpose ?

Last edited by kermana (2009-11-07 07:22:14)

Offline

#4 2009-11-07 07:44:19

MadTux
Member
Registered: 2009-09-20
Posts: 553

Re: [SOLVED] pacman log optional dependencies

As far as I understand it, the logs contain only stuff which was really installed. There is no value in adding information about stuff you could also install but didn't choose to do so.

Offline

#5 2009-11-07 07:50:53

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: [SOLVED] pacman log optional dependencies

Why pollute the log with irrelevant info? Pacman's log only contains information about installed packages. It also contains the post-install messages, if I'm not mistaken (would have to check that, and I'm not on a Linux box atm).

There is no point in having information like this in a log - you can query any package about its dependencies - optional or required - and pacman will tell you about it. It would be totally redundant.


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#6 2009-11-07 14:32:11

skipio
Member
Registered: 2009-01-27
Posts: 12

Re: [SOLVED] pacman log optional dependencies

#!/bin/bash
#
# list optional dependencies of installed packages
#

for i in $(pacman -Qq)
do
    deps="$(pacman -Qi ${i} | grep "Optional Deps" | sed 's/Optional Deps[ ]*:[ ]//g')"
    if [ "$deps" != "None" ]; then
        echo "$i >> $deps"
    fi
done

this is my output:

alsa-lib >> python
avahi >> qt3: Qt3 UI support
bootchart >> java-runtime: for bootchart-render
cups >> php: for included phpcups.so module
deluge >> python-chardet: used to load non-UTF8 encoded torrents
exaile >> cddb-py: for CD playback
foomatic-filters >> perl: for the "beh" Backend End Handler used by cups
gamin >> python: If you want to use the python module, that is.
geany >> vte: for terminal support
gettext >> cvs: for autopoint tool
ghostscript >> texlive-core:    dvipdf
gimp >> gutenprint: for sophisticated printing only as gimp has
git >> tk: gitk and git gui
gnomad2 >> dbus-glib and hal: for device autodetection
gtk-engine-murrine >> murrine-themes-collection: themes for Murrine engine
hdparm >> sh: required by idectl and ultrabayd
hwdetect >> cryptsetup: for encrypt mkinitcpio config support
initscripts >> bridge-utils: Network bridging support
kernel26 >> crda: to set the correct wireless channels of your country
kernel26-custom >> crda: to set the correct wireless channels of your country
libdv >> gtk and libxv: for using playdv
libdvdread >> libdvdcss: for decoding encrypted DVDs
libglade >> python: libglade-convert script
libmpeg2 >> sdl:        requiered for mpeg2dec
libproxy >> libxmu: KDE and GNOME plugins
librsvg >> python: rsvg commandline utility
libsndfile >> jack-audio-connection-kit: for JACK support
libtiff >> freeglut: for using tiffgt
man-db >> less
mkinitcpio >> xz-utils: Use lzma compression for the initramfs image
nvidia-utils >> gtk2: nvidia-settings
openbox >> pyxdg: for the xdg-autostart script
openjdk6 >> xulrunner: for the browser plugin
openoffice-base >> java-runtime:        adds java support
openssl >> ca-certificates
pacman >> fakeroot: for makepkg usage as normal user
patch >> ed: Interpret the patch as an ed script; for patch -e
pciutils >> sh: required by update-pciids
poppler >> poppler-data
pygtk >> python-numpy
python >> tk: for IDLE, pynche and modulator
qt >> postgresql-libs
recorder >> vcdimager, cdrdao: Support for VCD/SVCD modes
syslog-ng >> logrotate
tzdata >> sh: required by tzselect
vim >> perl: the runtime provides a view useful perl scripts
vlc >> libnotify
wget >> ca-certificates: HTTPS downloads
wpa_supplicant >> wpa_supplicant_gui: wpa_gui program
xarchiver >> tar: TAR support
xchat >> enchant: for spell checking support
xulrunner >> libgnomeui

maybe there's a more elegant solution, anyway this one works with both pacman and abs packages.

Last edited by skipio (2009-11-07 14:42:58)

Offline

#7 2009-11-07 16:22:15

Alain2
Member
From: France
Registered: 2009-11-06
Posts: 17

Re: [SOLVED] pacman log optional dependencies

@All
Thanks for you quick replies smile

MadTux wrote:

As far as I understand it, the logs contain only stuff which was really installed. There is no value in adding information about stuff you could also install but didn't choose to do so.

It is not that I chose not to install, it's more I was not aware of the optional dependency and that information interests me to investigate relevance or not for me. Please consider that I am new to linux (just started on ubuntu about a month ago after years on windows systems), and I am not well aware of all the common useful packages / dependencies as I am on a windows system. The learning curve is quite steep for me at this point..

B wrote:

Why pollute the log with irrelevant info? Pacman's log only contains information about installed packages. It also contains the post-install messages, if I'm not mistaken (would have to check that, and I'm not on a Linux box atm).

There is no point in having information like this in a log - you can query any package about its dependencies - optional or required - and pacman will tell you about it. It would be totally redundant.

Well I don't fully share your point of view, I think it is a relevant information, I think it would be good if we were able to set the verbosity level of the log file produced by pacman to add this information displayed during installation (so considered relevant enough during installation to be shown..) for people like me who are not yet well versed in all the packages available and their interest.. If I wanted to push your reasoning, why log package xxx installed at all in the log, you can get this information very easily with pacman -Q for instance, just log the warnings...
Also this is really a problem for me occuring during installation of group packages (as per the Beginner's guide) where lots of packages are installed at once, and although my screen is 1600x1200, I don't have time to read and take good note of all these information displayed.
But thank you (and x33a) for making me realize this information is actually the same as displayed in the information pacman -Si or -Qi shows

@skipio
Thanks! I still have not had time to learn bash shell scripting so I can't really modify your script to my need, but you have the basic good idea! The problem is that your script only capture the first line optional dependency listed for a package, and for instance for the xarchiver package as mentionned by kermana the output is:

xarchiver >> tar: TAR support

Do you think there is there a way to improve your script so it would capture all the optional dependencies ? From the output of a pacman -Qi, I would guess to capture all lines from [grep "Optional Deps"]=true up to the first line starting with a character different from a space char.. ?

Offline

#8 2009-11-07 18:19:34

skipio
Member
Registered: 2009-01-27
Posts: 12

Re: [SOLVED] pacman log optional dependencies

i didn't notice that bug tongue

#!/bin/bash
#
# list optional dependencies of installed packages
#

for i in $(pacman -Qq)
do
    deps="$(pacman -Qi ${i} | awk '/Optional/,/Required/' | grep -v "Required" | sed -e 's/Optional Deps[ ]*://g' -e 's/^[ ]*/ /')"
    if [ "$deps" != " None" ]; then
        echo "$i"
        echo "$deps"
        echo ""
    fi
done

i'm not really good with awk, sed, etc. hopefully someone will improve this script. anyway this one should grab all the dependencies correctly.

Offline

#9 2009-11-07 19:18:38

xduugu
Member
Registered: 2008-10-16
Posts: 292

Re: [SOLVED] pacman log optional dependencies

optdepsmeta might be interesting for you, too. However, there is a "bug" with optional dependencies without a description and I haven't found a way to solve it yet (the problem is pacman's 'line-wrap' feature, which will be fixed in pacman 3.4).

Offline

#10 2009-11-08 02:05:33

Alain2
Member
From: France
Registered: 2009-11-06
Posts: 17

Re: [SOLVED] pacman log optional dependencies

Thanks skipio!

Not sure it is entirely bullet-proof code, I have for instance this in the return of the script:

gnome-games-extra-data
 None
 Description    : Optional extra data for gnome-games

but that seems to do a good enough job indeed for me smile

@xduugu
Thanks for your post, I will have a look at your script when I get a bit more comfortable with the arch building system.

I'll tag the thread as closed then.

Last edited by Alain2 (2009-11-08 02:09:04)

Offline

#11 2009-11-08 14:00:21

harryNID
Member
From: P3X-1971
Registered: 2009-06-12
Posts: 117

Re: [SOLVED] pacman log optional dependencies

Hi All,

I saw this and had to take up the challenge.

How's this? It's pure sed at work. It shows both required and optional dependencies.

pacman -Qi | sed -n '/^Name/,/^Required By/{ /^Version/,/^Provides/d; /^Required By/d; /^Name/{x;p;x}; p }'

This is a command line version of course so just make an alias for it in .bashrc. If you want to log it then create a cron script to update it. By the way this should alleviate the multi-line issue you were having as I did some reverse thinking on this. I just eliminated what we didn't need as opposed to just trying to find what we did need. Sometimes that works better. 

Here's an example output: (The actual output is nice and tidy. Pasting into the forum here mucked the alignment up. ) lol! big_smile

Name           : pcmciautils
Depends On     : glibc  sysfsutils  module-init-tools>=3.2pre9 
Optional Deps  : None

Name           : pcre
Depends On     : gcc-libs 
Optional Deps  : None

Name           : perl
                 perl-archive-tar=1.52  perl-autodie=2.06_01 
                 perl-attribute-handlers=0.85  perl-autoloader=5.68 
                 perl-b-debug=1.11  perl-b-lint=1.11  perl-base=2.14 
                 perl-bignum=0.23  perl-cgi=3.43  perl-class-isa=0.33 
                 perl-compress-raw-bzib2=2.020  perl-compress-raw-zlib=2.020 
                 perl-constant=1.17  perl-cpan=1.9402  perl-cpanplus=0.88 
                 perl-db_file=1.820  perl-dprof=20080331.00 
                 perl-data-dumper=2.124  perl-devel-ppport=3.19 
                 perl-devel-peek=1.04  perl-digest=1.16  perl-digest-md5=2.39 
                 perl-digest-sha=5.47  perl-encode=2.35 
                 perl-encoding-warnings=0.11  perl-exporter=5.63 
                 perl-extutils-cbuilder=0.2602  perl-extutils-command=1.16 
                 perl-extutils-constant=0.22  perl-extutils-embed=1.28 
                 perl-extutils-install=1.54  perl-extutils-makemaker=6.55_02 
                 perl-extutils-manifest=1.56  perl-extutils-parsexs=2.2002 
                 perl-file-fetch=0.20  perl-file-path=2.07_03 
                 perl-file-temp=0.22  perl-filter=1.37 
                 perl-filter-simple=0.84  perl-getopt-long=2.38  perl-if=0.05 
                 perl-io=1.25  perl-io-compress=2.020  perl-io-zlib=1.09 
                 perl-ipc-cmd=0.46  perl-ipc-sysv=2.01  perl-libnet=1.22 
                 perl-locale-codes=2.07  perl-locale-maketext=0.13 
                 perl-locale-maketext-simple=0.18  perl-log-message=0.02 
                 perl-log-message-simple=0.04  perl-mime-base64=3.08 
                 perl-math-bigint=1.89  perl-math-bigint-fastcalc=0.19 
                 perl-math-bigrat=0.22  perl-math-complex=1.56 
                 perl-memoize=1.01_03  perl-module-build=0.340201 
                 perl-module-corelist=2.18  perl-module-load=0.16 
                 perl-module-load-conditional=0.30  perl-module-loaded=0.02 
                 perl-module-pluggable=3.9  perl-next=0.64  perl-net-ping=2.36 
                 perl-object-accessor=0.34  perl-package-constants=0.02 
                 perl-params-check=0.26  perl-parent=0.221 
                 perl-parse-cpan-meta=1.39  perl-pathtools=3.30 
                 perl-pod-escapes=1.04  perl-pod-latex=0.58 
                 perl-pod-parser=1.37  perl-pod-perldoc=3.14_04 
                 perl-pod-simple=3.07  perl-podlators=2.2.2  perl-safe=2.18 
                 perl-scalar-list-utils=1.21  perl-selfloader=1.17 
                 perl-shell=0.72_01  perl-storable=2.20  perl-switch=2.14 
                 perl-sys-syslog=0.27  perl-term-cap=1.12  perl-term-ui=0.20 
                 perl-test=1.25_02  perl-test-harness=3.17 
                 perl-test-simple=0.92  perl-text-balanced=2.0.0 
                 perl-text-parsewords=3.27  perl-text-soundex=3.03 
                 perl-text-tabs+wraps=2009.0305  perl-thread-queue=2.11 
                 perl-thread-semaphore=2.09  perl-threads=1.72 
                 perl-threads-shared=1.29  perl-tie-file=0.97_02 
                 perl-tie-refhash=1.38  perl-time-hires=1.9719 
                 perl-time-local=1.1901  perl-time-piece=1.15 
                 perl-unicode-collate=0.52  perl-unicode-normalize=1.03 
                 perl-version=0.77  perl-win32=0.39  perl-win32api-file=0.1101 
                 perl-xsloader=0.10  perlio-via-quotedprint=0.06 
Depends On     : gdbm  db>=4.8  coreutils  glibc  sh 
Optional Deps  : None

Name           : perl-crypt-ssleay
Depends On     : perl>=5.10.0 
Optional Deps  : None

Have a nice day!!
Hope this helps tongue

P.S. Here's another little tool I wrote you might find useful. Add to .bashrc

   wtd: (What They Do)

alias wtd="pacman -Qi | sed -n '/Version/,/Install\ Script/!p' | grep -F -A2 "

Just type:

wtd program name

This will output the description for the program(s) with program name in the title.

Example:

wtd grep

Name            : cgrep
Description    : Provides many of the features of grep, egrep, and fgrep with
                        greatly enhanced performance

--
Name            : grep
Description    : A string search utility

Edit: Well, I just showed above with Perl (duh!) I'm still having a multi-line issue with the Provides line. Where a program shows more than one Provides entry it's only deleting the first line.  I'll work on it and get back. Other than that this works (at least it should).

Edit2: Here is a slightly hacked form of the above command that at least fixes the perl issue. This will still fail when encountering other multi-line Provides lines. I think those are fairly rare so I'm leaving it at that. Sed does have limits and I'm sure a more complex command could be written using sed but I think this will get you in the ballpark.

pacman -Qi | sed -n '/^Name/,/^Required By/{ /^Version/,/^Provides/d; /^  *perl.*$/d; /^Required By/d; /^Name/{x;p;x}; p }'

Last edited by harryNID (2009-11-08 19:12:03)


In solving a problem of this sort, the grand thing is to be able to reason backward. That is a very useful accomplishment, and a very easy one, but people do not practice it much. In the everyday affairs of life it is more useful to reason forward, and so the other comes to be neglected. There are fifty who can reason synthetically for one who can reason analytically.  --Sherlock Holmes

Offline

#12 2009-11-18 23:42:00

harryNID
Member
From: P3X-1971
Registered: 2009-06-12
Posts: 117

Re: [SOLVED] pacman log optional dependencies

Not to beat a dead horse but I finally came up with a sed command that does the trick. This only shows you:

Name               : pkgname
Version             : pkgver-pkgrel
Depends On     : whatever 
Optional Deps  : if_any


and prints a nice formatted output. This will show you all Dependencies and Optional Dependencies no matter if they span multiple lines.

pacman -Qi | sed '/^Depends On/,/^Required By/{ s/^Required By.*$//; H; d }; /^Name/!d; /^Name/{ n;x;}'| sed '/^$/s//==================================================================================/'

Have fun!
P.S. I'm learning sed so I thought this would make good practice.


In solving a problem of this sort, the grand thing is to be able to reason backward. That is a very useful accomplishment, and a very easy one, but people do not practice it much. In the everyday affairs of life it is more useful to reason forward, and so the other comes to be neglected. There are fifty who can reason synthetically for one who can reason analytically.  --Sherlock Holmes

Offline

Board footer

Powered by FluxBB