3 # pacfix.py: a script by pierluigi to list all the packages currently installed according to /var/log/pacman.log
4 # 2008-07-04: Modified by Chris Giles to prevent failure when "pacman.log" has lines with only two words
9 logfile
= open("/var/log/pacman.log","r")
10 log
=logfile
.readlines()
12 myarray
= myline
.strip("\n").split(" ")
13 if len(myarray
) >= 3 :
14 if (myarray
[2]=="installed" or myarray
[2]=="upgraded"):
15 if (pkg
.count(myarray
[3])==0):
16 pkg
.append(myarray
[3])
17 if (myarray
[2]=="removed"):
18 if (pkg
.count(myarray
[3])!=0):
19 pkg
.remove(myarray
[3])