summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormbornet-hl <mbornet.pro@wanadoo.fr>2015-10-01 10:35:38 +0200
committermbornet-hl <mbornet.pro@wanadoo.fr>2015-10-01 10:35:38 +0200
commitfe40c5fa85952ed26fa119d7a8a6f9db913225d0 (patch)
tree7ba6cbd819b475eb80380be200d04a23cdd3f883
parent71d183b1fe90bcd0b399a147bc59713176804758 (diff)
downloadhl-fe40c5fa85952ed26fa119d7a8a6f9db913225d0.zip
hl-fe40c5fa85952ed26fa119d7a8a6f9db913225d0.tar.gz
hl-fe40c5fa85952ed26fa119d7a8a6f9db913225d0.tar.bz2
make_hl_links : scripts must be hard links
-rwxr-xr-xhl_bin/make_hl_links11
1 files changed, 8 insertions, 3 deletions
diff --git a/hl_bin/make_hl_links b/hl_bin/make_hl_links
index 30c91d7..32b7c57 100755
--- a/hl_bin/make_hl_links
+++ b/hl_bin/make_hl_links
@@ -3,7 +3,7 @@
# Script for the creation of command substitutes
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
-# @(#) [MB] cr_make_hl_links Version 1.1 du 15/09/28 -
+# @(#) [MB] cr_make_hl_links Version 1.2 du 15/10/01 -
#
HL_BIN="hl_bin"
@@ -23,6 +23,11 @@ if [ "$CURR_DIR_BASE" != "$HL_BIN" ]; then
fi
HL_GENERIC="hl_generic"
+if [ ! -e "$HL_GENERIC" ]; then
+ echo "$%: \"$HL_GENERIC\" does not exist !" >&2
+ exit 1
+fi
+INUM_HL_GENERIC=$(stat -c "%i" "$HL_GENERIC")
egrep -v '^#|^[ ]*$' <<-EOF | while read cmd
cal
@@ -59,8 +64,8 @@ do
if [ ! -e "$cmd" ]; then
ln "$HL_GENERIC" "$cmd"
else
- cmp -s "$cmd" "$HL_GENERIC"
- if [ $? != 0 ]; then
+ INUM=$(stat -c "%i" "$cmd")
+ if [ "$INUM" != "$INUM_HL_GENERIC" ]; then
rm -f "$cmd"
run_command ln "$HL_GENERIC" "$cmd"
fi