summaryrefslogtreecommitdiff
path: root/distcc
diff options
context:
space:
mode:
authorDanny Rawlins <romster@shortcircuit.net.au>2008-05-08 21:51:46 +1000
committerDanny Rawlins <romster@shortcircuit.net.au>2008-05-08 21:51:46 +1000
commitd5c9441c4377fa8a1e32a5f186cde241cbec8254 (patch)
tree5a85ebed331c58b403065400ef46b44db958a07c /distcc
parentf296f95f4f477c0e313d6aa057ac1533818cc9bd (diff)
downloadcontrib-d5c9441c4377fa8a1e32a5f186cde241cbec8254.tar.gz
contrib-d5c9441c4377fa8a1e32a5f186cde241cbec8254.tar.xz
distcc: minor improvements to post-install and post-remove
Diffstat (limited to 'distcc')
-rwxr-xr-xdistcc/post-install27
-rwxr-xr-xdistcc/post-remove1
2 files changed, 20 insertions, 8 deletions
diff --git a/distcc/post-install b/distcc/post-install
index c4471bfed..ab2aecce6 100755
--- a/distcc/post-install
+++ b/distcc/post-install
@@ -1,5 +1,7 @@
#!/usr/bin/env sh
DIRECTORY='/usr/lib/distcc'
+SYMLINKS='cc c++ gcc g++'
+unset NOT_INSTALLED
if [ ! -d "$DIRECTORY" ]; then
if [ -w '/usr/lib' ]; then
install -d "$DIRECTORY"
@@ -8,21 +10,30 @@ if [ ! -d "$DIRECTORY" ]; then
else
echo "post-install: '$DIRECTORY' created."
fi
- pushd "$DIRECTORY"
- for c in cc c++ gcc g++; do
- if [ ! -e $c ]; then
- ln -s ../../bin/distcc $c
+ cd "$DIRECTORY"
+ for c in $SYMLINKS; do
+ if [ ! -e "$DIRECTORY/$c" ]; then
+ NOT_INSTALLED='yes'
+ fi
+ done
+ if [ "$NOT_INSTALLED" ]; then
+ echo "post-install: in directory '$DIRECTORY'."
+ fi
+ for c in $SYMLINKS; do
+ if [ ! -e "$DIRECTORY/$c" ]; then
+ ln -s '../../bin/distcc' "$c"
if [ $? -gt 0 ]; then
- echo "post-install: error creating symlink '../../bin/distcc $c'."
+ echo "post-install: error creating symlink '../../bin/distcc -> $c'."
exit 1
else
- echo "post-install: create symlink '../../bin/distcc $c'."
+ echo "post-install: create symlink '../../bin/distcc -> $c'."
fi
fi
done
- popd
+ cd - > /dev/null
else
- echo "Error: no permission to write to '/usr/lib'."
+ echo "post-install: error no permission to create symlinks in '$DIRECTORY'."
fi
fi
+unset NOT_INSTALLED SYMLINKS DIRECTORY
# End of file
diff --git a/distcc/post-remove b/distcc/post-remove
index 3ad629ef7..987699385 100755
--- a/distcc/post-remove
+++ b/distcc/post-remove
@@ -12,4 +12,5 @@ if [ -d "$DIRECTORY" ]; then
echo "post-remove: error no permission to remove '$DIRECTORY'."
fi
fi
+unset DIRECTORY
# End of file

Generated by cgit