diff options
author | David Spencer <baildon.research@googlemail.com> | 2014-02-05 00:01:02 +0700 |
---|---|---|
committer | Erik Hanson <erik@slackbuilds.org> | 2014-02-08 11:10:10 -0600 |
commit | b9fe91a6a6ca4c16369b0867db2e65f51ab39984 (patch) | |
tree | 6527795ca1ccaa3e00a87d4e866ae931fc1a572a /gis/gpsd/doinst.sh | |
parent | 774dab7d85268a94737b5a6bed2e8dc76af48062 (diff) | |
download | slackbuilds-b9fe91a6a6ca4c16369b0867db2e65f51ab39984.tar.gz |
gis/gpsd: Updated for version 3.10 + Moved from System category.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'gis/gpsd/doinst.sh')
-rw-r--r-- | gis/gpsd/doinst.sh | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/gis/gpsd/doinst.sh b/gis/gpsd/doinst.sh new file mode 100644 index 0000000000..81e9fca8c2 --- /dev/null +++ b/gis/gpsd/doinst.sh @@ -0,0 +1,30 @@ +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 +} + +preserve_perms etc/rc.d/rc.gpsd.new +config etc/rc.d/rc.gpsd.conf.new + +if [ -x /usr/bin/update-desktop-database ]; then + /usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1 +fi |