Teh fun with bash code
Everyone who knows me, knows I need caffeine before I am atleast partial human. Sometimes however my brain throws me some fun and interesting (read weird and twisted) ideas before I am really properly caffeinated [0].
A good example of that is this: [1]
mirror=/usr/local/src/slackware/slackware-current
changelog=$mirror/Changelog.txt
cat $changelog | head -$(grep -n "^+" $changelog | head -1 | awk -F \: '{print $1}') | grep -v "^\+\|^\ \|$(date +%a)" | grep tgz | awk -F \: '{print $1}' | sed -e 's#^#upgradepkg --install-new #'
Basically ‘all‘ this does is to go through the Slackware-current ChangeLog.txt (of my local mirror), and figure out more or less the latest updates and parses them to a file. The output of the script more or less looks like this:
upgradepkg --install-new a/pkgtools-12.0.0-noarch-4.tgz
upgradepkg --install-new kde/kvpnc-0.8.9-i486-1.tgz
upgradepkg --install-new l/gd-2.0.35-i486-1.tgz
upgradepkg --install-new l/gmime-2.2.9-i486-1.tgz
upgradepkg --install-new n/pssh-1.3.1-noarch-1.tgz
upgradepkg --install-new n/samba-3.0.25b-i486-1.tgz
upgradepkg --install-new x/xf86-video-savage-2.1.2-i486-2.tgz
[1] When orginally writing the code, I didn’t use $mirror and $changelog. It made it just slightly more readable and I used it later in the full script.
[2] Please note that this script at the moment does NOT make any distinction between what packages are upgraded or removed or what else. It just looks for any tgz lines in the latest updates from the ChangeLog file.