diff options
author | Eric Hameleers <alien@slackware.com> | 2012-10-13 14:00:17 +0000 |
---|---|---|
committer | Eric Hameleers <alien@slackware.com> | 2012-10-13 14:00:17 +0000 |
commit | ed9081f4588d9a9f3c9068817ad76c70ffea01f6 (patch) | |
tree | 4643f99a9733201b6c0cb68d449bb9b047c2a6e4 /mirall/build | |
parent | 359b414a46ea1d690908cd8d68e63842f3623917 (diff) | |
download | asb-ed9081f4588d9a9f3c9068817ad76c70ffea01f6.tar.gz asb-ed9081f4588d9a9f3c9068817ad76c70ffea01f6.tar.xz |
Do not clobber existing configuration files
Diffstat (limited to 'mirall/build')
-rwxr-xr-x | mirall/build/mirall.SlackBuild | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/mirall/build/mirall.SlackBuild b/mirall/build/mirall.SlackBuild index cf989fe3..ce3d504e 100755 --- a/mirall/build/mirall.SlackBuild +++ b/mirall/build/mirall.SlackBuild @@ -195,9 +195,30 @@ Icon=owncloud Categories=Utility;Network; EOT +# Do not clobber existing configuration: +mv -i $PKG/etc/owncloud/sync-exclude.lst{,.new} + # Add this to the doinst.sh: 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/owncloud/sync-exclude.lst.new + # Update the desktop database: if [ -x usr/bin/update-desktop-database ]; then chroot . /usr/bin/update-desktop-database usr/share/applications > /dev/null 2>&1 |