diff options
author | B. Watson <urchlay@slackware.uk> | 2023-08-07 02:30:18 -0400 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2023-08-12 08:29:52 +0700 |
commit | 293813b0209cdcdff47bdff81dc5f11a4a6b4e39 (patch) | |
tree | 7713d5c645dd1b0c5e87355e0a606e7a3ba559b0 /misc/grc/doinst.sh | |
parent | d0c77a87aed72200ab1ebbf06e51b9d108717331 (diff) |
misc/grc: Updated for version 1.13, new maintainer, support csh.
Signed-off-by: B. Watson <urchlay@slackware.uk>
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'misc/grc/doinst.sh')
-rw-r--r-- | misc/grc/doinst.sh | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/misc/grc/doinst.sh b/misc/grc/doinst.sh index 7be6ad2127134..b50214f79e9a1 100644 --- a/misc/grc/doinst.sh +++ b/misc/grc/doinst.sh @@ -1,17 +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/profile.d/grc.csh.new +preserve_perms etc/profile.d/grc.sh.new config etc/grc.conf.new -config etc/profile.d/grc.bashrc.new -config etc/profile.d/grc.zsh.new -config etc/profile.d/grc.fish.new +config etc/default/grc.new |