summaryrefslogtreecommitdiff
path: root/system/guix/doinst.sh
diff options
context:
space:
mode:
authorHunter Sezen <ovariegata@yahoo.com>2015-11-25 17:59:55 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2015-11-28 07:25:59 +0700
commit9e52f8ff4d01d52018b0c1ec6b5df65b6c33d484 (patch)
tree69c3836311d9564550a5cb27b92293be2e22ac5d /system/guix/doinst.sh
parentce3fdfd907faed3b1cfbf2640809da5359bfc1ec (diff)
downloadslackbuilds-9e52f8ff4d01d52018b0c1ec6b5df65b6c33d484.tar.gz
system/guix: Added (package manager).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system/guix/doinst.sh')
-rw-r--r--system/guix/doinst.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/system/guix/doinst.sh b/system/guix/doinst.sh
new file mode 100644
index 0000000000..3e203807ec
--- /dev/null
+++ b/system/guix/doinst.sh
@@ -0,0 +1,25 @@
+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.guix.new