diff options
author | Grissiom <chaos.proton@gmail.com> | 2010-06-27 16:01:15 -0500 |
---|---|---|
committer | Erik Hanson <erik@slackbuilds.org> | 2010-06-29 00:36:35 -0500 |
commit | f06623ea51f1b733a06797527bd2a15ae7d57265 (patch) | |
tree | 71b6a56ba82540ec1ebfee108d36b704cdbb6f10 /misc/sunpinyin/doinst.sh | |
parent | 842ea71a3ad91c062324acbf7ffeeaf0ee372d0a (diff) |
misc/sunpinyin: Added (Chinese input method)
Signed-off-by: Robby Workman <rworkman@slackbuilds.org>
Diffstat (limited to 'misc/sunpinyin/doinst.sh')
-rw-r--r-- | misc/sunpinyin/doinst.sh | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/misc/sunpinyin/doinst.sh b/misc/sunpinyin/doinst.sh new file mode 100644 index 0000000000000..f6ed560b3167e --- /dev/null +++ b/misc/sunpinyin/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/sunpinyin.csh.new +preserve_perms etc/profile.d/sunpinyin.sh.new |