diff options
author | Waldemar Brodkorb <wbx@openadk.org> | 2016-02-29 14:38:54 +0100 |
---|---|---|
committer | Waldemar Brodkorb <wbx@openadk.org> | 2016-02-29 14:38:54 +0100 |
commit | f0fc4828501e7e393ce52a311bef249b0c9ec236 (patch) | |
tree | 9e16a57f422e0768313b62e97f15a7a5a6196be4 /mk | |
parent | 6873c8d1e2410d147bd4d687123a8d878b9b2aa4 (diff) |
add new PKG_GIT variable
We can now clone git tags and branches in a more performant
way. No change for specific hashes, other then PKG_GIT is required
now. Do not remove .git dirs, as the downloaded code might be
used to add a patch and send upstream.
Add git as requirement for downloading.
Remove unmaintained u-boot-git package.
Diffstat (limited to 'mk')
-rw-r--r-- | mk/buildhlp.mk | 2 | ||||
-rw-r--r-- | mk/fetch.mk | 30 |
2 files changed, 21 insertions, 11 deletions
diff --git a/mk/buildhlp.mk b/mk/buildhlp.mk index f664e19b7..0b6979ab2 100644 --- a/mk/buildhlp.mk +++ b/mk/buildhlp.mk @@ -81,7 +81,7 @@ ${WRKDIST}/.prepared: ${WRKDIST}/.extract_done [ ! -d ./src ] || (cd src; $(PREVENT_PATCH) cp -Rp . ${WRKDIST}/) \ $(MAKE_TRACE) @${MAKE} post-patch $(MAKE_TRACE) - # always use latest config.sub/config.guess from OpenADK scripts directory + @# always use latest config.sub/config.guess from OpenADK scripts directory @cd ${WRKDIST}; \ for i in $$(find . -name config.sub);do \ if [ -f $$i ]; then \ diff --git a/mk/fetch.mk b/mk/fetch.mk index 13673b452..edfc208de 100644 --- a/mk/fetch.mk +++ b/mk/fetch.mk @@ -64,20 +64,30 @@ $(1): for url in "${PKG_SITES}"; do case $$$$url in \ git://*|*.git) \ rm -rf $${PKG_NAME}-$${PKG_VERSION}; \ - git clone --quiet $${PKG_SITES} $${PKG_NAME}-$${PKG_VERSION}; \ - if [ $$$$(echo $${PKG_VERSION}|wc -c) -eq 41 ]; then \ - (cd $${PKG_NAME}-$${PKG_VERSION}; \ - echo "Checking out $${PKG_VERSION}"; \ - git checkout --quiet $${PKG_VERSION}) >/dev/null; \ - else \ - echo "Using head"; \ - fi; \ - touch $$$${filename}.nohash; \ - rm -rf $${PKG_NAME}-$${PKG_VERSION}/.git; \ + if [ ! -z "$${PKG_GIT}" ]; then \ + case "$${PKG_GIT}" in \ + tag|branch) \ + echo "Using git tag/branch: $${PKG_VERSION}"; \ + git clone --depth 1 --branch $${PKG_VERSION} $(GITOPTS) $${PKG_SITES} $${PKG_NAME}-$${PKG_VERSION}; \ + ;; \ + hash) \ + echo "Using git hash: $${PKG_VERSION}"; \ + git clone $(GITOPTS) $${PKG_SITES} $${PKG_NAME}-$${PKG_VERSION}; \ + (cd $${PKG_NAME}-$${PKG_VERSION}; git checkout $(GITOPTS) $${PKG_VERSION}); \ + ;; \ + head) \ + echo "Using git head"; \ + git clone $(GITOPTS) $${PKG_SITES} $${PKG_NAME}-$${PKG_VERSION}; \ + ;; \ + esac ;\ tar cJf $${PKG_NAME}-$${PKG_VERSION}.tar.xz $${PKG_NAME}-$${PKG_VERSION}; \ + touch $$$${filename}.nohash; \ rm -rf $${PKG_NAME}-$${PKG_VERSION}; \ : check the size here; \ [[ ! -e $$$$filename ]] || exit 0; \ + else \ + echo "PKG_GIT is missing" ;\ + fi; \ ;; \ http://*|https://*|ftp://*) \ for site in $${PKG_SITES} $${MASTER_SITE_BACKUP}; do \ |