desktop/ion: Fixed (Don't clobber config files)

Signed-off-by: dsomero <xgizzmo@slackbuilds.org>
This commit is contained in:
dsomero 2012-09-28 20:27:01 -04:00 committed by Robby Workman
parent 3032ce580f
commit 6142ca91e2
2 changed files with 44 additions and 2 deletions

37
desktop/ion/doinst.sh Normal file
View file

@ -0,0 +1,37 @@
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/ion3/look_ios.lua.new
config etc/ion3/look_cleanios.lua.new
config etc/ion3/cfg_kludges.lua.new
config etc/ion3/look_greenlight.lua.new
config etc/ion3/cfg_pwm.lua.new
config etc/ion3/look_brownsteel.lua.new
config etc/ion3/cfg_layouts.lua.new
config etc/ion3/lookcommon_emboss.lua.new
config etc/ion3/cfg_ion.lua.new
config etc/ion3/lookcommon_clean.lua.new
config etc/ion3/cfg_menu.lua.new
config etc/ion3/look_newviolet.lua.new
config etc/ion3/cfg_defaults.lua.new
config etc/ion3/cfg_tiling.lua.new
config etc/ion3/look_cleanviolet.lua.new
config etc/ion3/cfg_statusbar.lua.new
config etc/ion3/look_simpleblue.lua.new
config etc/ion3/look_dusky.lua.new
config etc/ion3/look_clean.lua.new
config etc/ion3/cfg_ioncore.lua.new
config etc/ion3/look_greyviolet.lua.new
config etc/ion3/cfg_dock.lua.new
config etc/ion3/cfg_sp.lua.new
config etc/ion3/cfg_query.lua.new

View file

@ -8,7 +8,7 @@
PRGNAM=ion
VERSION=3_20090110
BUILD=${BUILD:-2}
BUILD=${BUILD:-3}
TAG=${TAG:-_SBo}
if [ -z "$ARCH" ]; then
@ -72,7 +72,11 @@ make install \
# Install an xinitrc file so that ion will show up in xwmconfig
# We also need to patch the reference to the X11 lib directory when
# running on x86_64.
install -D -m 0755 $CWD/xinitrc.ion $PKG/etc/X11/xinit/xinitrc.ion
install -D -m 0755 $CWD/xinitrc.ion $PKG/etc/X11/xinit/xinitrc.ion.new
cd $PKG/etc/ion3
for f in * ; do mv $f $f.new ; done
cd -
# Add ion3 as a valid session in login managers
install -D -m 0755 $CWD/ion3.desktop $PKG/usr/share/xsessions/ion3.desktop
@ -86,6 +90,7 @@ cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}