aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobby Workman <rworkman@slackbuilds.org>2010-04-23 11:30:34 -0500
committerRobby Workman <rworkman@slackware.com>2010-04-23 11:30:34 -0500
commit71113015d28d9178e3d013667c09f12d700345d2 (patch)
tree008998d87f4bf02f02b4b212a92d1d385e7ebf32
parent6f8d5bd58fe1344e4cdf90d96908904611431358 (diff)
doinst.sh: add preserve_perms() function
-rw-r--r--doinst.sh18
1 files changed, 11 insertions, 7 deletions
diff --git a/doinst.sh b/doinst.sh
index b5f65c0..1683756 100644
--- a/doinst.sh
+++ b/doinst.sh
@@ -11,14 +11,18 @@ config() {
# Otherwise, we leave the .new copy for the admin to consider...
}
-# Keep same perms on rc.INIT.new:
-if [ -e etc/rc.d/rc.INIT ]; then
- cp -a etc/rc.d/rc.INIT etc/rc.d/rc.INIT.new.incoming
- cat etc/rc.d/rc.INIT.new > etc/rc.d/rc.INIT.new.incoming
- mv etc/rc.d/rc.INIT.new.incoming etc/rc.d/rc.INIT.new
-fi
+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
+}
-config etc/rc.d/rc.INIT.new
+preserve_perms etc/rc.d/rc.INIT.new
config etc/configfile.new
if [ -x /usr/bin/update-desktop-database ]; then