From f04c2bd8cc0e5414809a6fab870f3ba2798b4b9b Mon Sep 17 00:00:00 2001 From: Techlive Zheng Date: Wed, 22 May 2013 04:19:05 +0800 Subject: [PATCH] Add the ability to always build from the repo's HEAD --- scripts/makepkg.sh.in | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index c27c74d..cd7ed48 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -557,6 +557,9 @@ download_git() { if ! git fetch --all -p; then # only warn on failure to allow offline builds warning "$(gettext "Failure while updating %s %s repo")" "${repo}" "git" + else + git fetch origin HEAD + echo "$(git rev-parse FETCH_HEAD)" > HEAD fi fi } @@ -597,6 +600,9 @@ extract_git() { branch) ref=origin/${fragment##*=} ;; + HEAD) + ref=HEAD + ;; *) error "$(gettext "Unrecognized reference: %s")" "${fragment}" plain "$(gettext "Aborting...")" @@ -604,6 +610,8 @@ extract_git() { esac fi + ref=$(git rev-parse "$ref") + if [[ -n $ref ]]; then if ! git checkout -b makepkg $ref; then error "$(gettext "Failure while creating working copy of %s %s repo")" "${repo}" "git" -- 1.8.3