diff options
author | Eric Hameleers <alien@slackware.com> | 2008-06-23 11:22:52 +0000 |
---|---|---|
committer | Eric Hameleers <alien@slackware.com> | 2008-06-23 11:22:52 +0000 |
commit | 563ee688bf9e13bf78319cbe1fe86f1e5a69a454 (patch) | |
tree | 053f38f46e96e31253c8dde5adab86b6fd54c836 | |
parent | 017f42dc14c1cf85cfc69723cc7ed86867472c79 (diff) | |
download | asb-563ee688bf9e13bf78319cbe1fe86f1e5a69a454.tar.gz asb-563ee688bf9e13bf78319cbe1fe86f1e5a69a454.tar.xz |
Treat conf file better
-rwxr-xr-x | slim/build/slim.SlackBuild | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/slim/build/slim.SlackBuild b/slim/build/slim.SlackBuild index 7fa53e5e..aa0d6f85 100755 --- a/slim/build/slim.SlackBuild +++ b/slim/build/slim.SlackBuild @@ -164,6 +164,32 @@ else make DESTDIR=$PKG install 2>&1 |tee $OUTPUT/install-${PRGNAM}.log fi +# Move slim.conf so that it does not overwrite customized versions: +mv $PKG/etc/slim.conf{,.new} + +# Add this to the doinst.sh: +! [ -d $PKG/install ] && mkdir -p $PKG/install +cat <<EOINS >> $PKG/install/doinst.sh +# Handle the incoming configuration files: +config() { + for infile in \$1; do + NEW="\$infile" + 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... + done +} + +config etc/slim.conf.new + +EOINS + # Add documentation: mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION || true |