You are not logged in.

#1 2007-12-04 08:14:00

braindump
Member
Registered: 2007-12-04
Posts: 4

List of programs, installed directly?

Hey folks,
is there a possibility to see all programs, i installed directly via pacman, e.g. pacman -S ion? I don't want to see dependencies, libs and so on...

thanks

Offline

#2 2007-12-04 08:54:27

Gilneas
Member
From: Netherlands
Registered: 2006-10-22
Posts: 320

Re: List of programs, installed directly?

Is this what you mean?
pacorphans script

Offline

#3 2007-12-04 08:56:20

mucknert
Member
From: Berlin // Germany
Registered: 2006-06-27
Posts: 510

Re: List of programs, installed directly?

No, he wants to know which packages have been installed via a pacman call. Like pacman -S vim screen and so on. He does not want to see packages that have been pulled in as a dependency of those.


Todays mistakes are tomorrows catastrophes.

Offline

#4 2007-12-04 09:20:57

kumico
Member
Registered: 2007-09-28
Posts: 224
Website

Re: List of programs, installed directly?

Offline

#5 2007-12-04 09:31:25

braindump
Member
Registered: 2007-12-04
Posts: 4

Re: List of programs, installed directly?

Yeah, yaourt -Qe does. Thanks smile

Offline

#6 2007-12-04 09:43:04

kumico
Member
Registered: 2007-09-28
Posts: 224
Website

Re: List of programs, installed directly?

#!/usr/bin/env python
from subprocess import PIPE, Popen
from re import findall

pkglist = findall('(.*) .*\n', Popen(['pacman', '-Q'], stdout=PIPE).stdout.read())
reasons = findall('.*\nInstall Reason : (.*)\n.*', Popen(['pacman', '-Qi']+pkglist, stdout=PIPE).stdout.read())
i = 0
for p in pkglist:
  if 'Explicitly installed' in reasons[i]:
    print p
  i += 1

i was bored so i decided to implement this in python ;; my method prints only the pkglist not the version numbers and is considerably faster ... after the disk cache
0m0.291s vs 0m4.884s

Offline

#7 2007-12-04 10:48:39

braindump
Member
Registered: 2007-12-04
Posts: 4

Re: List of programs, installed directly?

looks like it works nice smile thanks.

Offline

#8 2007-12-04 10:52:11

kumico
Member
Registered: 2007-09-28
Posts: 224
Website

Re: List of programs, installed directly?

yw

Offline

#9 2007-12-04 11:37:21

braindump
Member
Registered: 2007-12-04
Posts: 4

Re: List of programs, installed directly?

And, how about the content of meta-packages like xorg-fonts-* from xorg? I'd like to see just xorg in that case...

Offline

#10 2007-12-04 13:09:03

kumico
Member
Registered: 2007-09-28
Posts: 224
Website

Re: List of programs, installed directly?

#!/usr/bin/env python
import sys

from subprocess import PIPE, Popen
from re import findall

pkgnames = findall('(.*) .*\n', Popen(['pacman', '-Q'], stdout=PIPE).stdout.read())
reasons = findall('.*\nInstall Reason : (.*)\n.*', Popen(['pacman', '-Qi']+pkgnames, stdout=PIPE).stdout.read())
pkggroup = dict((p, g) for (g, p) in findall('(.*) (.*)\n', Popen(['pacman', '-Qg'], stdout=PIPE).stdout.read()))

if '-c' in sys.argv[1:]:
  pkglist = set(pkggroup.get(p, p) for (p, r) in zip(pkgnames, reasons) if 'Explicitly installed' in r)
else:
  pkglist = set(p for (p, r) in zip(pkgnames, reasons) if 'Explicitly installed' in r)
print '\n'.join(pkglist)

looks right .. pass the script the -c arg,, (pmx.py -c) to print the group names instead,, otherwise it acts as it did before

Offline

Board footer

Powered by FluxBB