|
#!/bin/bash
|
|
#
|
|
# --- ROCK-COPYRIGHT-NOTE-BEGIN ---
|
|
#
|
|
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
|
|
# Please add additional copyright information _after_ the line containing
|
|
# the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
|
|
# the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
|
|
#
|
|
# ROCK Linux: rock-src/scripts/Create-UpdList
|
|
# ROCK Linux is Copyright (C) 1998 - 2004 Clifford Wolf
|
|
#
|
|
# This program is free software; you can redistribute it and/or modify
|
|
# it under the terms of the GNU General Public License as published by
|
|
# the Free Software Foundation; either version 2 of the License, or
|
|
# (at your option) any later version. A copy of the GNU General Public
|
|
# License can be found at Documentation/COPYING.
|
|
#
|
|
# Many people helped and are helping developing ROCK Linux. Please
|
|
# have a look at http://www.rocklinux.org/ and the Documentation/TEAM
|
|
# file for details.
|
|
#
|
|
# --- ROCK-COPYRIGHT-NOTE-END ---
|
|
|
|
config=default
|
|
ignore_chksum=0
|
|
root=
|
|
|
|
while [ "$1" ] ; do
|
|
case "$1" in
|
|
-cfg)
|
|
config=$2 ; shift ; shift ;;
|
|
-root)
|
|
root=$2 ; shift ; shift ;;
|
|
-ignore-chksum)
|
|
ignore_chksum=1 ; shift ;;
|
|
*)
|
|
echo ; echo "Usage: $0 [ -cfg <config> ] [ -ignore-chksum ]"
|
|
echo
|
|
echo " Create a list of packages which are active in the current configuration and"
|
|
echo " have changed since the binaries installed on the local system have been"
|
|
echo " generated. The compare is done using the package source checksums stored"
|
|
echo " in /var/adm/packages/<package-name>."
|
|
echo
|
|
echo " -cfg <config> only packages active in this configuration are checked"
|
|
echo " -ignore-chksum ignore checksums on package source directories when"
|
|
echo " determining changed packages"
|
|
echo ; exit 1 ;;
|
|
esac
|
|
done
|
|
|
|
. scripts/parse-config
|
|
|
|
grep '^X' config/$config/packages | cut -f5 -d' ' | \
|
|
egrep -vx 'rock-debug|rock-src' | \
|
|
while read package ; do
|
|
confdir=""
|
|
for x in package/* ; do
|
|
if [ -d "$x/$package" ] ; then
|
|
if [ "$confdir" ] ; then confdir=X
|
|
else confdir="$x/$package" ; fi
|
|
fi
|
|
done
|
|
|
|
if [ -z "$confdir" ] ; then
|
|
echo "$package: No such package."
|
|
elif [ "$confdir" = X ] ; then
|
|
echo "$package: Package in multiple trees."
|
|
elif [ ! -f $root/var/adm/packages/$package ] ; then
|
|
echo "$package: Not installed."
|
|
else
|
|
o_ver=$(grep '^Package Name and Version' \
|
|
$root/var/adm/packages/$package | cut -f6 -d' ')
|
|
n_ver=$(grep '^\[V\] ' $confdir/$package.desc | cut -f2 -d' ')
|
|
if [ "$o_ver" != "$n_ver" -a "$n_ver" != "0000" ] ; then
|
|
echo "$package: New version ($o_ver -> $n_ver)."
|
|
else
|
|
if [ $ignore_chksum = 0 ] ; then
|
|
o_ck=$(grep '^ROCK Linux Package Source Checksum' \
|
|
$root/var/adm/packages/$package | cut -f6 -d' ')
|
|
n_ck=$(md5sum package/*/$package/* 2> /dev/null | \
|
|
grep -v '\.cache$' | md5sum | cut -f1 -d' ')
|
|
if [ "$o_ck" != "$n_ck" ] ; then
|
|
echo "$package: New source checksum ($n_ck)."
|
|
fi
|
|
fi
|
|
fi
|
|
fi
|
|
done
|