PKGBUILDs/scripts/pkgverchecker
2010-10-27 02:51:39 -05:00

32 lines
980 B
Text
Executable file

# This is a simple package version checker (for now)
#
# So far it only lists the names and versions of packages in ABS.
# Planned is to grab repository pkgvers, then ABS vers, and only
# output the differences, i.e. what packages need to be upgraded.
ABSDIR=/build/abs
REPODIR=/build/packages
cd $ABSDIR/$1
if [[ ! $* ]]; then
echo "usage: $0 <repository>"
exit 1
fi
echo "$1"
echo ""
cd $REPODIR/$1
for i in `find . -maxdepth 1 -mindepth 1 -type d|sort`; do
PKGNAME=`grep ^pkgname= $i/PKGBUILD | sed -e 's/pkgname=//'`
PKGVER=`grep ^pkgver= $i/PKGBUILD | sed -e 's/pkgver=//'`
PKGREL=`grep ^pkgrel= $i/PKGBUILD | sed -e 's/pkgrel=/-/'`
if [[ -e $ABSDIR/$1/$i ]]; then
ABSVER=`grep ^pkgver= $ABSDIR/$1/$i/PKGBUILD | sed -e 's/pkgver=//'`
ABSREL=`grep ^pkgrel= $ABSDIR/$1/$i/PKGBUILD | sed -e 's/pkgrel=/-/'`
if [[ "$ABSVER$ABSREL" != "$PKGVER$PKGREL" ]]; then
echo "$PKGNAME $PKGVER$PKGREL -> $ABSVER$ABSREL"
fi
fi
done