From 9cce2f098d5d77a2748952e1221127b9f0614566 Mon Sep 17 00:00:00 2001 From: aurelien Date: Thu, 22 Nov 2012 09:49:46 +0100 Subject: + gtkmm pactools ttf-roboto --- pcr/pactools/pt-pacfix | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 pcr/pactools/pt-pacfix (limited to 'pcr/pactools/pt-pacfix') 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) -- cgit v1.2.3-2-g168b