summaryrefslogtreecommitdiffstats
path: root/compat32-tools
diff options
context:
space:
mode:
author Eric Hameleers <alien@slackware.com>2011-10-11 21:36:58 +0000
committer Eric Hameleers <alien@slackware.com>2011-10-11 21:36:58 +0000
commit7ce2ad46e39677e01f8229850d8639e533566238 (patch)
tree7db2a9ad69d3d92ef050b6de37a2dd8a6eb4cb92 /compat32-tools
parent4665c770b787e6d9d1f1d7599536d8e66af617a1 (diff)
downloadmultilib-7ce2ad46e39677e01f8229850d8639e533566238.tar.gz
multilib-7ce2ad46e39677e01f8229850d8639e533566238.tar.xz
Fix new location of etc/gtk-2.0/i486-slackware-linux/im-multipress.conf.new;
Add back a config() function in doinst.sh if there was one originally
Diffstat (limited to 'compat32-tools')
-rwxr-xr-xcompat32-tools/convertpkg-compat3226
1 files changed, 23 insertions, 3 deletions
diff --git a/compat32-tools/convertpkg-compat32 b/compat32-tools/convertpkg-compat32
index c818b5b..409fe42 100755
--- a/compat32-tools/convertpkg-compat32
+++ b/compat32-tools/convertpkg-compat32
@@ -197,15 +197,35 @@ then
rm -f install/doinst.sh.2
if [ "$PKGNAM" = "gtk+2" ]; then
# Deal with the .new file in gtk+2 that does not get processed:
- echo "config etc/gtk-2.0/i486-slackware-linux/im-multipress.conf.new" \
+ echo "config etc/gtk-2.0/im-multipress.conf.new" \
>> install/doinst.sh
fi
elif [ -f install/doinst.sh ]; then
+ # Check for a 'config()' section:
+ if grep -q 'config()' install/doinst.sh ; then
+ cat <<-"EOT" > install/doinst.sh.1
+ 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...
+ }
+ EOT
+ else
+ echo -n "" > install/doinst.sh.1
+ fi
# Only keep lines that deal with symlinks in bin/32 and lib directories:
( cat install/doinst.sh |grep -v "etc/ld.so.conf" \
|grep -E '(usr/bin |lib |lib/)' > install/doinst.sh.2
- cat install/doinst.sh.2 |sed -e 's#usr/bin#usr/bin/32#g' > install/doinst.sh
- rm -f install/doinst.sh.2 ) || true
+ cat install/doinst.sh.1 install/doinst.sh.2 \
+ |sed -e 's#usr/bin#usr/bin/32#g' > install/doinst.sh
+ rm -f install/doinst.sh.1 install/doinst.sh.2 ) || true
fi
# The cxxlibs need some extra consideration because the libraries in