diff options
author | Michales Michaloudes <korgie@gmail.com> | 2011-08-02 08:54:49 -0300 |
---|---|---|
committer | Niels Horn <niels.horn@slackbuilds.org> | 2011-08-02 08:54:49 -0300 |
commit | 0f664d787dae81172b4548e61b3bf45c137bd61c (patch) | |
tree | 67dcb2c617ef21145a2b5d4abb6b0bea7c65637c /libraries/libinstpatch/doinst.sh | |
parent | b7af29bae74b9eed1c39e93f084ba26fd147dfcd (diff) | |
download | slackbuilds-0f664d787dae81172b4548e61b3bf45c137bd61c.tar.gz |
libraries/libinstpatch: Added (digital sample processing library)
Signed-off-by: Niels Horn <niels.horn@slackbuilds.org>
Diffstat (limited to 'libraries/libinstpatch/doinst.sh')
-rw-r--r-- | libraries/libinstpatch/doinst.sh | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/libraries/libinstpatch/doinst.sh b/libraries/libinstpatch/doinst.sh new file mode 100644 index 0000000000..cb44d46a56 --- /dev/null +++ b/libraries/libinstpatch/doinst.sh @@ -0,0 +1,50 @@ +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 +} + +schema_install() { + SCHEMA="$1" + GCONF_CONFIG_SOURCE="xml::etc/gconf/gconf.xml.defaults" \ + chroot . gconftool-2 --makefile-install-rule \ + /etc/gconf/schemas/$SCHEMA \ + 1>/dev/null +} + +schema_install blah.schemas +preserve_perms etc/rc.d/rc.INIT.new +config etc/configfile.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 + +if [ -e usr/share/icons/hicolor/icon-theme.cache ]; then + if [ -x /usr/bin/gtk-update-icon-cache ]; then + /usr/bin/gtk-update-icon-cache usr/share/icons/hicolor >/dev/null 2>&1 + fi +fi + |