aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordsomero <xgizzmo@slackbuilds.org>2012-09-27 20:26:22 -0400
committerRobby Workman <rworkman@slackbuilds.org>2012-09-29 17:17:37 -0500
commit59d3e1f8f80b923605363336500ffd1d51278e54 (patch)
tree6be4d1e764181806a4ce559eae1de4d00e1d026f
parentb9b587d751bcfb5fd2c5697a3d0e70164612a324 (diff)
audio/audtty: Fixed (Don't clobber config file)
Signed-off-by: dsomero <xgizzmo@slackbuilds.org>
-rw-r--r--audio/audtty/audtty.SlackBuild3
-rw-r--r--audio/audtty/doinst.sh14
2 files changed, 17 insertions, 0 deletions
diff --git a/audio/audtty/audtty.SlackBuild b/audio/audtty/audtty.SlackBuild
index efe0bc6dfc651..019f098feeb9d 100644
--- a/audio/audtty/audtty.SlackBuild
+++ b/audio/audtty/audtty.SlackBuild
@@ -92,6 +92,8 @@ CXXFLAGS="$SLKCFLAGS" \
make install DESTDIR=$PKG
+mv $PKG/etc/audtty.conf $PKG/etc/audtty.conf.new
+
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
@@ -106,6 +108,7 @@ cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
+cat $CWD/doinst.sh > $PKG/install/doinst.sh
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
diff --git a/audio/audtty/doinst.sh b/audio/audtty/doinst.sh
new file mode 100644
index 0000000000000..fcf851475af53
--- /dev/null
+++ b/audio/audtty/doinst.sh
@@ -0,0 +1,14 @@
+ 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...
+}
+
+config etc/audtty.conf.new \ No newline at end of file