mirror of
https://github.com/Ponce/slackbuilds
synced 2024-11-24 10:02:29 +01:00
06f9a9c223
The doinst.sh was calling config() and then preserve_perms() (which calls config() again) which would cat nothing (file already removed in config()) to $NEW.incoming, and move that to $NEW, which the second call to config() would leave for the admin to consider. Signed-off-by: Robby Workman <rworkman@slackbuilds.org>
38 lines
1.1 KiB
Bash
38 lines
1.1 KiB
Bash
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...
|
|
}
|
|
|
|
preserve_perms() {
|
|
NEW="$1"
|
|
OLD="$(dirname $NEW)/$(basename $NEW .new)"
|
|
if [ -e $OLD ]; then
|
|
cp -a $OLD ${NEW}.incoming
|
|
cat $NEW > ${NEW}.incoming
|
|
mv ${NEW}.incoming $NEW
|
|
fi
|
|
config $NEW
|
|
}
|
|
|
|
if [ -x /usr/bin/update-desktop-database ]; then
|
|
/usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1
|
|
fi
|
|
|
|
if [ -x /usr/bin/update-mime-database ]; then
|
|
/usr/bin/update-mime-database usr/share/mime >/dev/null 2>&1
|
|
fi
|
|
|
|
config etc/rox/xdg/rox.sourceforge.net/MIME-types/application_postscript.new
|
|
config etc/rox/xdg/rox.sourceforge.net/MIME-types/text.new
|
|
config etc/rox/xdg/rox.sourceforge.net/MIME-types/text_html.new
|
|
|
|
preserve_perms etc/profile.d/rox-filer.sh.new
|
|
preserve_perms etc/profile.d/rox-filer.csh.new
|