summaryrefslogtreecommitdiff
path: root/support/fixlinks
diff options
context:
space:
mode:
authorJari Aalto <jari.aalto@cante.net>1996-12-23 17:02:34 +0000
committerJari Aalto <jari.aalto@cante.net>2009-09-12 16:46:49 +0000
commitccc6cda312fea9f0468ee65b8f368e9653e1380b (patch)
treeb059878adcfd876c4acb8030deda1eeb918c7e75 /support/fixlinks
parent726f63884db0132f01745f1fb4465e6621088ccf (diff)
downloadbash-ccc6cda312fea9f0468ee65b8f368e9653e1380b.tar.gz
Imported from ../bash-2.0.tar.gz.
Diffstat (limited to 'support/fixlinks')
-rwxr-xr-xsupport/fixlinks10
1 files changed, 8 insertions, 2 deletions
diff --git a/support/fixlinks b/support/fixlinks
index b82ca4dd..bc286e5a 100755
--- a/support/fixlinks
+++ b/support/fixlinks
@@ -10,8 +10,9 @@ while [ $# -gt 0 ]; do
case "$1" in
-s) shift; SRCDIR=$1 ;;
-u) unfix=yes ;;
+ -h) hardlinks=yes ;;
-*) echo "$0: $1: bad option" 1>&2
- echo "$0: usage: $0 [-u] [-s srcdir] [linkmap]" 1>&2
+ echo "$0: usage: $0 [-hu] [-s srcdir] [linkmap]" 1>&2
exit 1;;
*) break ;;
esac
@@ -35,11 +36,16 @@ if [ ! -f "$linkfile" ]; then
fi
rm -f /tmp/z
-if (ln -s /dev/null /tmp/z) >/dev/null 2>&1; then
+# if the user specified hard links, then do that. otherwise, try to use
+# symlinks if they're present
+if [ -n "$hardlinks" ]; then
+ LN=ln
+elif (ln -s /dev/null /tmp/z) >/dev/null 2>&1; then
LN="ln -s"
else
LN=ln
fi
+rm -f /tmp/z
while read name target
do