diff options
author | Nitish Ragoomundun <lrugratz@gmail.com> | 2017-05-09 14:23:26 +0100 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2017-05-13 06:58:49 +0700 |
commit | e196e8f941a3ea123f73ba3778f755a4faa0d9b0 (patch) | |
tree | 7291234062ff2b085eed6d2ecaf37ca6b31711e6 /libraries/pgplot/doinst.sh | |
parent | fbe0107f7827921d4b35f61fdcfd3e1461381b1c (diff) | |
download | slackbuilds-e196e8f941a3ea123f73ba3778f755a4faa0d9b0.tar.gz |
libraries/pgplot: Added (graphics subroutine library).
Signed-off-by: David Spencer <idlemoor@slackbuilds.org>
Diffstat (limited to 'libraries/pgplot/doinst.sh')
-rw-r--r-- | libraries/pgplot/doinst.sh | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/libraries/pgplot/doinst.sh b/libraries/pgplot/doinst.sh new file mode 100644 index 0000000000..e14444b033 --- /dev/null +++ b/libraries/pgplot/doinst.sh @@ -0,0 +1,26 @@ +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/profile.d/pgplot.sh.new +preserve_perms etc/profile.d/pgplot.csh.new |