summaryrefslogtreecommitdiffhomepage
path: root/build.subr
diff options
context:
space:
mode:
authorLucio Andrés Illanes Albornoz (arab, vxp) <l.illanes@gmx.de>2016-07-11 19:07:00 +0000
committerLucio Andrés Illanes Albornoz (arab, vxp) <l.illanes@gmx.de>2016-07-11 19:39:54 +0000
commit49b310339d45f9e4a109d80254006c05069b1563 (patch)
treecef728e804154a180b4b3dbf13ae2f347560f364 /build.subr
parent672107a200f15d952f2d8c3750e8c58be5035ee3 (diff)
downloadmidipix_build-49b310339d45f9e4a109d80254006c05069b1563.tar.bz2
midipix_build-49b310339d45f9e4a109d80254006c05069b1563.tar.xz
Adds ${PKG_GIT_BRANCH}; correctly handle Git branches.
Diffstat (limited to 'build.subr')
-rw-r--r--build.subr13
1 files changed, 10 insertions, 3 deletions
diff --git a/build.subr b/build.subr
index 32b4f4c4..168e9721 100644
--- a/build.subr
+++ b/build.subr
@@ -34,11 +34,18 @@ fetch() {
};
fetch_git() {
- _fg_subdir="${1}"; _fg_url="${2}"; _fg_git_args_extra="${3}";
+ _fg_subdir="${1}"; _fg_url="${2}"; _fg_branch="${3}";
if [ -e "${DLCACHEDIR}/${_fg_subdir}" ]; then
- (cd ${DLCACHEDIR}/${_fg_subdir} && git pull origin main);
+ cd ${DLCACHEDIR}/${_fg_subdir} &&\
+ git pull origin ${_fg_branch:-main} && cd ${OLDPWD};
else
- git clone ${_fg_git_args_extra} ${_fg_url} ${DLCACHEDIR}/${_fg_subdir};
+ git clone ${_fg_url} ${DLCACHEDIR}/${_fg_subdir};
+ if [ -n "${_fg_branch}" -a \
+ \( -z "${_fg_branch#main}" \) -a \
+ \( -z "${_fg_branch#master}" \) ]; then
+ cd ${DLCACHEDIR}/${_fg_subdir} &&\
+ git checkout -b ${_fg_branch} && cd ${OLDPWD};
+ fi;
fi;
rm_if_exists ${_fg_subdir};
echo cp -pr ${DLCACHEDIR}/${_fg_subdir} .;