diff options
author | root <root@rshg054.dnsready.net> | 2012-11-22 02:31:09 -0800 |
---|---|---|
committer | root <root@rshg054.dnsready.net> | 2012-11-22 02:31:09 -0800 |
commit | 38ea2e71952c00f18230ed0e691532aadff4e2c1 (patch) | |
tree | bc1c7cfd697773062d53a0a23b35afdb0fc775c2 /pcr/pactools/pt-pacfix | |
parent | f48f6c82e23a3bacb8a0952c2d2cf9af1e6bf42d (diff) |
Thu Nov 22 02:27:52 PST 2012
Diffstat (limited to 'pcr/pactools/pt-pacfix')
-rwxr-xr-x | pcr/pactools/pt-pacfix | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/pcr/pactools/pt-pacfix b/pcr/pactools/pt-pacfix new file mode 100755 index 000000000..cd128331e --- /dev/null +++ b/pcr/pactools/pt-pacfix @@ -0,0 +1,22 @@ +#!/usr/bin/env python +# +# pacfix.py: a script by pierluigi to list all the packages currently installed according to /var/log/pacman.log +# 2008-07-04: Modified by Chris Giles to prevent failure when "pacman.log" has lines with only two words + + +pkg=[] + +logfile = open("/var/log/pacman.log","r") +log=logfile.readlines() +for myline in log: + myarray = myline.strip("\n").split(" ") + if len(myarray) >= 3 : + if (myarray[2]=="installed" or myarray[2]=="upgraded"): + if (pkg.count(myarray[3])==0): + pkg.append(myarray[3]) + if (myarray[2]=="removed"): + if (pkg.count(myarray[3])!=0): + pkg.remove(myarray[3]) +pkg.sort() +for p in pkg: + print(p) |