Loading configure.ac +1 −1 Original line number Diff line number Diff line Loading @@ -15,7 +15,7 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. # AC_INIT([git-hooks], [0.1.3]) AC_INIT([git-hooks], [0.1.4]) AM_INIT_AUTOMAKE gitcoredir=`git --exec-path` Loading hook-scripts/post-receive/auto-build +30 −21 Original line number Diff line number Diff line #! /bin/bash config () { git config --get auto-build`printf ".%s" "$@"` } config () { git config --get auto-build`printf ".%s" "$@"`; } config-all () { git config --get-all auto-build`printf ".%s" "$@"`; } profile () { Loading Loading @@ -93,7 +91,7 @@ _get_config_section () echo "Finding match for $1 in" printf " %s\n" "${sections[@]}" } >&2 for prefix in '' heads/ tags/ refs/ refs/heads/ refs/tags/; do for prefix in refs/tags/ refs/heads/ refs/ heads/ tags/ ''; do for sec in "${sections[@]}"; do case "$1" in $prefix$sec) Loading Loading @@ -209,22 +207,32 @@ build () cd "$dir" ( unset GIT_DIR remote_ref="${ref/heads/remotes/origin}" git fetch origin git checkout -B "${ref/heads\//}" "${ref/heads/remotes/origin}" git fetch origin --tags case "${ref%%/*}" in heads) git checkout -B "${ref/heads\//}" "$remote_ref" ;; *) git checkout -B build/ref/"$ref" "$remote_ref" ;; esac git clean -f -d -q -x git reset --hard ) # get the settings for this build profile=`config "$confsec" profile || determine_profile` cmd=`config "$confsec" command || profile "$profile" build` pattern=`config "$confsec" pattern || profile "$profile" pattern` replace_cmd=`profile "$profile" replace_cmd` backup=`config "$confsec" backup | tr '[:upper:]' '[:lower:]' || echo yes` IFS=$'\n' cmds=( `config-all "$confsec" command || profile "$profile" build` ) for cmd in "${cmds[@]}"; do # normalise $cmd pushd "$GIT_DIR" >/dev/null eval cmd=( $cmd ) eval "cmd=( $cmd )" cmd[0]=`readlink -e "${cmd[0]}" || echo "${cmd[0]}"` popd >/dev/null Loading @@ -237,6 +245,7 @@ build () return 1 fi ) done # find the generated files pattern=`$replace_cmd "$pattern"` Loading Loading
configure.ac +1 −1 Original line number Diff line number Diff line Loading @@ -15,7 +15,7 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. # AC_INIT([git-hooks], [0.1.3]) AC_INIT([git-hooks], [0.1.4]) AM_INIT_AUTOMAKE gitcoredir=`git --exec-path` Loading
hook-scripts/post-receive/auto-build +30 −21 Original line number Diff line number Diff line #! /bin/bash config () { git config --get auto-build`printf ".%s" "$@"` } config () { git config --get auto-build`printf ".%s" "$@"`; } config-all () { git config --get-all auto-build`printf ".%s" "$@"`; } profile () { Loading Loading @@ -93,7 +91,7 @@ _get_config_section () echo "Finding match for $1 in" printf " %s\n" "${sections[@]}" } >&2 for prefix in '' heads/ tags/ refs/ refs/heads/ refs/tags/; do for prefix in refs/tags/ refs/heads/ refs/ heads/ tags/ ''; do for sec in "${sections[@]}"; do case "$1" in $prefix$sec) Loading Loading @@ -209,22 +207,32 @@ build () cd "$dir" ( unset GIT_DIR remote_ref="${ref/heads/remotes/origin}" git fetch origin git checkout -B "${ref/heads\//}" "${ref/heads/remotes/origin}" git fetch origin --tags case "${ref%%/*}" in heads) git checkout -B "${ref/heads\//}" "$remote_ref" ;; *) git checkout -B build/ref/"$ref" "$remote_ref" ;; esac git clean -f -d -q -x git reset --hard ) # get the settings for this build profile=`config "$confsec" profile || determine_profile` cmd=`config "$confsec" command || profile "$profile" build` pattern=`config "$confsec" pattern || profile "$profile" pattern` replace_cmd=`profile "$profile" replace_cmd` backup=`config "$confsec" backup | tr '[:upper:]' '[:lower:]' || echo yes` IFS=$'\n' cmds=( `config-all "$confsec" command || profile "$profile" build` ) for cmd in "${cmds[@]}"; do # normalise $cmd pushd "$GIT_DIR" >/dev/null eval cmd=( $cmd ) eval "cmd=( $cmd )" cmd[0]=`readlink -e "${cmd[0]}" || echo "${cmd[0]}"` popd >/dev/null Loading @@ -237,6 +245,7 @@ build () return 1 fi ) done # find the generated files pattern=`$replace_cmd "$pattern"` Loading