#!/bin/bash # Reports the last date of a package update # Similar to the first entry of the "Latest News" panel of http://packages.qa.debian.org # Thanks to the contributors on http://lists.debian.org/debian-policy/2006/06/msg00019.html PACKAGE=$1 SECTION="main" echo -n "$PACKAGE " SPACKAGE=$(apt-cache show $PACKAGE | grep ^Source: | awk '{print $2}') [ ${SPACKAGE:+set} ] && { echo -n "SRC:$SPACKAGE "; PACKAGE=$SPACKAGE; } ALTSECTION=$(apt-cache show $PACKAGE 2> /dev/null | grep ^Section: | awk '{print $2}') [[ $(echo $ALTSECTION | grep -c "/") != "0" ]] && { ALTSECTION=$(echo $ALTSECTION | awk -F/ '{print $1}'); } || ALTSECTION="" [ ${ALTSECTION:+set} ] && { echo -n "SEC:$ALTSECTION "; SECTION=$ALTSECTION; } echo http://packages.debian.org/changelogs/pool/$SECTION/${PACKAGE::1}/${PACKAGE}/current/changelog.txt CHANGELOG="$(wget -O- -q http://packages.debian.org/changelogs/pool/$SECTION/${PACKAGE::1}/${PACKAGE}/current/changelog.txt)" #echo $? [ ${CHANGELOG:+set} ] && echo "$CHANGELOG" | dpkg-parsechangelog -l- | grep '^Date' #| sed 's/Date: /Last modification: /'