I hate wading through the huge file looking at which files have been modified, so I decided to write a little script to extract just the updates/additions for me. I thought that this might be useful for others, so I would like to share it with you:
Code: Select all
#!/usr/bin/python
#
# Dump update information from /var/log/hda-updates.log
#!/usr/bin/python
#
# Display the date and files that were modified/installed.
#
# Reads the hda-updates log file and parses out just the file updates/additions.
# It helps to see what has been modified and when.
#
# radioz
# 11/8/2010
#
log = '/var/log/hda-updates.log'
f = open(log, 'r')
lines = f.readlines()
f.close()
gotUpdates = False
firstUpdate = False
dateInfo = ''
for ll in lines :
l = ll.strip()
# Ignore dependency heading
if l == 'Installing for dependencies:' :
continue
if l == '' :
# A blank line terminates the updates for a particular date
if gotUpdates :
# Display a blank line between dates
print
gotUpdates = False
continue
if gotUpdates :
if firstUpdate :
# Display the date above the first update
print '%s:' % dateInfo
firstUpdate = False
# Reformat the file info slightly
updateInfo = l.split()
print ' %-16s %-6s %-20s %-16s %-5s %s' % (tuple(updateInfo))
if 'hda update attempt' in l :
# This header appears once per hour in the log. Very few represent real updates.
# Save the date information in case this is a real update.
dateInfo = ' '.join(l.split()[5:])
if 'Updating:' in l :
# This is a real update, set up the flags
gotUpdates = True
firstUpdate = True
Then just type hda-updates and it will print out all of the Amahi file updates.
This is an example of its output:
Code: Select all
Tue Aug 31 05:01:23 PDT 2010:
hda-platform noarch 5.5-1 amahi 1.1 M
hdactl i386 3.5-1 amahi 218 k
wol i686 0.7.1-4.fc12 fedora 38 k
Sat Sep 4 15:02:32 PDT 2010:
hdactl i386 3.5.1-1 amahi 218 k
Sat Oct 30 22:02:14 PDT 2010:
hda-greyhole i386 0.6.28-1 amahi 47 k
hda-platform noarch 5.6-1 amahi 1.0 M
hdactl i386 3.6-1 amahi 218 k
Sun Nov 7 20:01:29 PST 2010:
hda-platform noarch 5.6-8 amahi 1.0 M