summaryrefslogtreecommitdiffstats
path: root/system/asbt/doinst.sh
diff options
context:
space:
mode:
author aaditya2014-02-10 01:25:15 +0100
committer Erik Hanson2014-02-11 19:15:07 +0100
commitf1739bc786336345c6f0680278d5b3a298f29215 (patch)
treef02e15a42cac0e33466ba2e00793e84706e3b51f /system/asbt/doinst.sh
parent2037ae7eee4d1f90e07b2e3dcbd0b9ec54aeb305 (diff)
downloadslackbuilds-f1739bc786336345c6f0680278d5b3a298f29215.tar.gz
system/asbt: Added (Managing SBo packages in local repository).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system/asbt/doinst.sh')
-rw-r--r--system/asbt/doinst.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/system/asbt/doinst.sh b/system/asbt/doinst.sh
new file mode 100644
index 0000000000..69b1d2d95c
--- /dev/null
+++ b/system/asbt/doinst.sh
@@ -0,0 +1,16 @@
+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
+ else
+ # Otherwise, we leave the .new copy for the admin to consider...
+ echo -e "New configuration file /etc/asbt/asbt.conf.new created.\nYou may need to merge changes."
+ fi
+}
+
+config etc/asbt/asbt.conf.new