multimedia/huludesktop: Fixed (Don't clobber config files)

Signed-off-by: dsomero <xgizzmo@slackbuilds.org>
This commit is contained in:
dsomero 2012-09-29 21:43:21 -04:00 committed by Robby Workman
parent 19c515a3cc
commit eff6eefd3f
2 changed files with 18 additions and 1 deletions

View file

@ -1,3 +1,18 @@
config() {
NEW="$1"
OLD="$(dirname $NEW)/$(basename $NEW .new)"
# If there's no config file by that name, mv it over:
if [ ! -r $OLD ]; then
mv $NEW $OLD
elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
# toss the redundant copy
rm $NEW
fi
# Otherwise, we leave the .new copy for the admin to consider...
}
config etc/huludesktop/hd_keymap.ini.new
if [ -x /usr/bin/update-desktop-database ]; then
/usr/bin/update-desktop-database -q usr/share/applications &> /dev/null
fi

View file

@ -24,7 +24,7 @@
PRGNAM=huludesktop
VERSION=0.9.8
BUILD=${BUILD:-1}
BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
CWD=$(pwd)
@ -56,6 +56,8 @@ mv $PKG/usr/share/doc/huludesktop $PKG/usr/doc/$PRGNAM-$REAL_VER
rmdir $PKG/usr/share/doc
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$REAL_VER/$PRGNAM.SlackBuild
mv $PKG/etc/huludesktop/hd_keymap.ini $PKG/etc/huludesktop/hd_keymap.ini.new
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh