File: cowpoke-exit-hook

package info (click to toggle)
gitpkg 0.29%2Bnmu1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 180 kB
  • sloc: sh: 1,219; makefile: 34
file content (39 lines) | stat: -rw-r--r-- 1,162 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# gitpkg hook script to push the exported package off for building via cowpoke
#
# To enable this hook, use:
# git config gitpkg.exit-hook /usr/share/gitpkg/hooks/cowpoke-exit-hook

# We're out of the repo tree, but want to check git-config
. /usr/share/gitpkg/hooks/repo-config-helper

# See cowpoke(1) for what's valid to set in this one
extract_values_for_option cowpoke "${GITPKG_IOPTS[@]}"

# Command line options override the git config
if [ ${#EXTRACTED_OPTS[@]} -gt 0 ]; then
	COWPOKE_OPTS=( "${EXTRACTED_OPTS[@]}" )
else
    while read opt; do COWPOKE_OPTS+=("$opt")
		done < <(repo_config --get-all gitpkg-cowpoke-exit-hook.options)

    # Having a veto can be handy sometimes
    if [ "$(repo_config --get --bool gitpkg-cowpoke-exit-hook.ask-first)" = "true" ]
    then
	printf "Send $DEB_DSC off to cowpoke now (Y/n)? "
	read -e yesno
	case "$yesno" in
	    N* | n*)
		echo "Ok, you're the boss.  If you change your mind, just run:"
		echo "cowpoke ${COWPOKE_OPTS[@]} $DEB_DSC"
		echo
		exit 0
		;;
	    *) ;;
	esac
    fi
fi

echo "cowpoke ${COWPOKE_OPTS[@]} $DEB_DSC"
cowpoke "${COWPOKE_OPTS[@]}" "$DEB_DSC"

# vi:sts=4:sw=4:noet:foldmethod=marker