aboutsummaryrefslogtreecommitdiff
path: root/network/haproxy
diff options
context:
space:
mode:
authordsomero <xgizzmo@slackbuilds.org>2011-03-23 18:17:38 -0400
committerRobby Workman <rworkman@slackbuilds.org>2011-03-24 19:23:15 -0500
commit24a857c6cc4902982b68f70ba2c360c1d83d7061 (patch)
treeba3bf89104856fdf1d6c5bd8d58616dc5d40e901 /network/haproxy
parent8f1db0beb92bb478ffc59323bf873c9a9aa7fed8 (diff)
network/haproxy: Handle .new files correctly.
Signed-off-by: dsomero <xgizzmo@slackbuilds.org>
Diffstat (limited to 'network/haproxy')
-rw-r--r--network/haproxy/doinst.sh21
-rw-r--r--network/haproxy/haproxy.SlackBuild6
2 files changed, 16 insertions, 11 deletions
diff --git a/network/haproxy/doinst.sh b/network/haproxy/doinst.sh
index ead1b65ea434..a69f0862583d 100644
--- a/network/haproxy/doinst.sh
+++ b/network/haproxy/doinst.sh
@@ -11,11 +11,18 @@ config() {
# Otherwise, we leave the .new copy for the admin to consider...
}
-# Keep same perms on rc.haproxy.new:
-if [ -e etc/rc.d/rc.haproxy ]; then
- cp -a etc/rc.d/rc.haproxy etc/rc.d/rc.haproxy.new.incoming
- cat etc/rc.d/rc.haproxy.new > etc/rc.d/rc.haproxy.new.incoming
- mv etc/rc.d/rc.haproxy.new.incoming etc/rc.d/rc.haproxy.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
+}
+
+preserve_perms etc/rc.d/rc.haproxy.new
+config etc/haproxy/haproxy.cfg.new
+
-config etc/rc.d/rc.haproxy.new
diff --git a/network/haproxy/haproxy.SlackBuild b/network/haproxy/haproxy.SlackBuild
index 2513ce6fcc97..517af87d56a0 100644
--- a/network/haproxy/haproxy.SlackBuild
+++ b/network/haproxy/haproxy.SlackBuild
@@ -112,10 +112,8 @@ cat $CWD/haproxy.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/haproxy.SlackBuild
mv $PKG/usr/share/man $PKG/usr/
rm -rf $PKG/usr/{share,/doc/haproxy}
-( cd $PKG/usr/man
- find . -type f -exec gzip -9 {} \;
- for i in $(find . -type l) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
-)
+find $PKG/usr/man -type f -exec gzip -9 {} \;
+for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true