Project Info Name.......: gnu-hello
Description: GNU Hello


gnu-hello       
Info
Commit...:bbefd4b1076a7f2ea3c2d833ccbda9b7a441b318
Author...:Sami Kerola
Committer:Sami Kerola
Date.....:Sun Dec 28 10:59:54 2014 +0000
Parents..:df30334c1183b643e3821e81022ed774cd983f56

Message
scripts: check files exist before comparing

* bootstrap.conf: Add if clause before cmp(1) call.

Changes
diff --git a/bootstrap.conf b/bootstrap.conf
line changes: +5/-3
index 4e0b388..072e74d
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -109,9 +109,11 @@ bootstrap_epilogue()
   if test $backup = 1; then
     hooks=$(cd scripts/git-hooks && git ls-files)
     for f in $hooks; do
-      # If it is identical, skip it.
-      cmp scripts/git-hooks/$f .git/hooks/$f > /dev/null \
-	&& continue
+      if [ -f .git/hooks/$f ]; then
+	# If it is identical, skip it.
+	cmp scripts/git-hooks/$f .git/hooks/$f > /dev/null \
+	  && continue
+      fi
       cp --backup=numbered scripts/git-hooks/$f .git/hooks
       chmod a-w .git/hooks/$f
     done

This website is licensed under AGPL-3.0. Feel free to copy!