build-sys: force git hooks on.
authorKrisztian Litkey <krisztian.litkey@intel.com>
Tue, 7 May 2013 09:31:12 +0000 (12:31 +0300)
committerKrisztian Litkey <krisztian.litkey@intel.com>
Tue, 7 May 2013 09:36:14 +0000 (12:36 +0300)
Makefile.am

index a0fe011..29d89ee 100644 (file)
@@ -3,7 +3,7 @@ doc_DATA = AUTHORS ChangeLog COPYING INSTALL NEWS README
 
 # This is the only way with automake I know of to force 'check-git-hooks'
 # to be evaluated before 'all'. If there is a nicer way, I'm all ears...
-BUILT_SOURCES = check-git-hooks
+BUILT_SOURCES = install-git-hooks
 
 ###################################
 # git hook management
@@ -15,7 +15,8 @@ install-git-hooks:
                case $$hook in                                      \
                    *.sample|*~|*.swp) continue;;                   \
                esac;                                               \
-               if test -x $$hook; then                             \
+               if test -x $$hook -a                                \
+                     ! -x .git/hooks/$${hook##*/}; then            \
                    echo "Installing git hook $${hook##*/}...";     \
                    cp $$hook .git/hooks;                           \
                    chmod a+x .git/hooks/$${hook##*/};              \