You are not logged in.
Hey everyone,
I recently wrote this simple python script, and as I've found it quite useful I thought I'd share it with you.
The script first reads the pacman.log file and finds the date of the last full system upgrade. It then iterates over the news entries in the archlinux.org RSS feed, and compare the publication date of the entries with the date of the last full system upgrade. News entries with a publication date after (more recent than) the most recent system upgrade are considered relevant. If no relevant news entries are found, the script simply runs "pacman -Syu".
Otherwise, the relevant posts are displayed and the user is prompted whether or not to proceed with the update.
The script can be found at http://tobiasrang.com/svn/archupdate/update.py
I'd love to hear any thoughts or feedback you might have.
/edagar
Offline
I'm subscribed to the arch-announce mailing list, which is very low volume. I update much more often :-)
There's https://www.archlinux.org/packages/comm … /pacmatic/
Offline
Have you seen pacnanny?
http://brandon.invergo.net/software/pacnanny.html
https://github.com/brandoninvergo/pacnanny
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
I'm subscribed to the arch-announce mailing list, which is very low volume. I update much more often :-)
This is a good point, and also why I wrote the script the way I did - to only display news that may be relevant to the current upgrade.
I suspected that similar tools were around, but i've never heard of pacnanny or pacmatic before.
I'll check them out. thanks ![]()
Offline
This is my update script function part for the last two news items
bgreen () {(tput bold; tput setaf 2)}
bred () {(tput bold; tput setaf 1)}
yellow () {(tput setaf 3)}
last_news_items () {
wget -O /tmp/al.rss https://www.archlinux.org/feeds/news/ 2>/dev/null
rsscat () {(cat /tmp/al.rss | xmlstarlet sel -T -t -v $1 )}
time=$(rsscat '/rss/channel/item[1]/pubDate')
title=$(rsscat '/rss/channel/item[1]/title')
description=$(rsscat '/rss/channel/item[1]/description')is
time2=$(rsscat '/rss/channel/item[2]/pubDate')
title2=$(rsscat '/rss/channel/item[2]/title')
description2=$(rsscat '/rss/channel/item[2]/description')
bgreen ; printf "$title" ; yellow ;echo " ${time//+0000/}"
tput sgr0; echo "$description" | sed -e 's/<[^>]*>//g'
bgreen ; printf "$title2" ; yellow ;echo " ${time2//+0000/}"
tput sgr0; echo "$description2" | sed -e 's/<[^>]*>//g'
rm /tmp/al.rss
}„Je verdinglichter die Welt, je dichter das Netz, das der Natur überworfen wurde, desto mehr beansprucht ideologisch das Denken, das jenes Netz spinnt, seinerseits Natur, Urerfahrung zu sein." Theodor W. Adorno [aus: Wozu noch Philosopie]
Offline
This is my update script function part for the last two news items
bgreen () {(tput bold; tput setaf 2)} bred () {(tput bold; tput setaf 1)} yellow () {(tput setaf 3)} last_news_items () { wget -O /tmp/al.rss https://www.archlinux.org/feeds/news/ 2>/dev/null rsscat () {(cat /tmp/al.rss | xmlstarlet sel -T -t -v $1 )} time=$(rsscat '/rss/channel/item[1]/pubDate') title=$(rsscat '/rss/channel/item[1]/title') description=$(rsscat '/rss/channel/item[1]/description')is time2=$(rsscat '/rss/channel/item[2]/pubDate') title2=$(rsscat '/rss/channel/item[2]/title') description2=$(rsscat '/rss/channel/item[2]/description') bgreen ; printf "$title" ; yellow ;echo " ${time//+0000/}" tput sgr0; echo "$description" | sed -e 's/<[^>]*>//g' bgreen ; printf "$title2" ; yellow ;echo " ${time2//+0000/}" tput sgr0; echo "$description2" | sed -e 's/<[^>]*>//g' rm /tmp/al.rss }
Cool. Thanks for sharing your implementation ![]()
Offline