summaryrefslogtreecommitdiff
path: root/pcr/pactools/pt-pacfix
diff options
context:
space:
mode:
authorNicolás Reynolds <fauno@kiwwwi.com.ar>2012-12-31 17:29:39 -0300
committerNicolás Reynolds <fauno@kiwwwi.com.ar>2012-12-31 17:29:39 -0300
commit6f102d1647580e0bb9513c124b26a64c77da4f15 (patch)
tree0340f1f588be251183fe2b251bdba778f2c85c22 /pcr/pactools/pt-pacfix
parent433900b14f11dc9ee55b72e8e5946bf47f65b636 (diff)
parentb6cb10de275cea63bab0bee2a98342afa4fdc4ee (diff)
downloadabslibre-6f102d1647580e0bb9513c124b26a64c77da4f15.tar.gz
abslibre-6f102d1647580e0bb9513c124b26a64c77da4f15.tar.bz2
abslibre-6f102d1647580e0bb9513c124b26a64c77da4f15.zip
Merge branch 'master' of ssh://gparabola/srv/git/abslibre
Diffstat (limited to 'pcr/pactools/pt-pacfix')
-rw-r--r--pcr/pactools/pt-pacfix22
1 files changed, 22 insertions, 0 deletions
diff --git a/pcr/pactools/pt-pacfix b/pcr/pactools/pt-pacfix
new file mode 100644
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)