jannet: Add command rpmnew

This commit is contained in:
Jan Lindemann 2012-02-06 10:31:47 +00:00 committed by Jan Lindemann
commit 1745f72eb6

View file

@ -28,6 +28,8 @@ cat << EOT
restore: restore a previous jannet software version state
info: query information about installed software
checklog: update the installation log file if necessary
rpmnew: remove superfluous rpmnew files and show conflicts
for others
EOT
if [ "$1" ]; then
@ -79,6 +81,31 @@ list_all_packages()
sort -u
}
cmd_rpmnew()
{
local file
jannet info |
list_all_packages |
xargs rpm -ql |
while read file; do
if [ -e "$file.rpmnew" ]; then
if diff -q $file $file.rpmnew; then
if [ -l "$file" ]; then
echo ========== skipping link $file
continue
fi
echo mv $file.rpmnew $file
sudo mv $file.rpmnew $file
else
echo =========== $file
diff $file.rpmnew $file
fi
fi
done
}
cmd="$1"
shift
get_opts $*
@ -138,6 +165,9 @@ cpp-glib)
ftp://dspadm@ftp.jannet.de/pub/packages/linux/suse/10.1/inst-source/rpm/i586/glib2-2.8.5-19.i586.rpm
check_ldconfig
;;
rpmnew)
cmd_rpmnew $@
;;
help)
usage 0
;;