summaryrefslogtreecommitdiff
path: root/pcr/pactools/pt-pacfix
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2012-11-26 23:52:26 -0500
committerLuke Shumaker <LukeShu@sbcglobal.net>2012-11-26 23:52:26 -0500
commit360e56ec622617a2b121c7ec51e3381ad89f0eab (patch)
treee74250415c5e21080779befbb7898bd151039d63 /pcr/pactools/pt-pacfix
parent34b4025bc7b0c6d8d47988decd140df38b1d98ac (diff)
parentb1c14cd929ca53e06945a5cda3965dc6fcd9d6b7 (diff)
Merge branch 'master' of ssh://parabolagnulinux.org:1863/srv/git/abslibre
Diffstat (limited to 'pcr/pactools/pt-pacfix')
-rwxr-xr-xpcr/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 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)