#!/bin/sh
# a quick script to analyze what's changed between release packages
# (first take: --lastchange)
# 2007, Michael Shigorin
TMP="${TMPDIR-/tmp}"

OLDVER="4.0.0"
NEWVER="4.0.1"

RPMS_OLD="$TMP/$OLDVER.rpms"
RPMS_NEW="$TMP/$NEWVER.rpms"

PREFIX=/var/ftp/pub/Linux/ALT/4.0/Server
SUFFIX="i586/RPMS.main"
SRCSFX="files/SRPMS"

pushd $PREFIX/ >/dev/null

ls -1 "$OLDVER/$SUFFIX/" > "$RPMS_OLD"
ls -1 "$NEWVER/$SUFFIX/" > "$RPMS_NEW"

comm -13 "$RPMS_OLD" "$RPMS_NEW" \
| while read binary; do
	rpm -qip "$NEWVER/$SUFFIX/$binary" \
	| sed -n 's/^.*Source RPM: \(.*\)/\1/p'
done \
| sort -u \
| while read source; do
	echo "Last change in ${source%%.src.rpm}":
	rpm -qp --lastchange "$NEWVER/$SRCSFX/$source"
	echo -e "--- \n"
done \
| sed 's/\(@altlinux\).\(ru|org|com\)/\1/'

rm "$RPMS_OLD" "$RPMS_NEW"

popd >/dev/null
