diff options
author | Michael Drake <michael.drake@codethink.co.uk> | 2021-02-26 12:06:17 +0000 |
---|---|---|
committer | Michael Drake <mdrake.unique@gmail.com> | 2022-10-23 17:22:56 +0100 |
commit | d1610a1cdb3c62e45cdffc3032abaa7700228c73 (patch) | |
tree | 0fb09a402f3e23c68f2bbfa60f7acf43a8613664 /docs/env.sh | |
parent | ce6a2c87da8ca2c81b0cab272e0f21906e643c85 (diff) | |
download | netsurf-d1610a1cdb3c62e45cdffc3032abaa7700228c73.tar.gz netsurf-d1610a1cdb3c62e45cdffc3032abaa7700228c73.tar.bz2 |
env.sh: Add NetSurf clone skip and shallow clone switches.
Diffstat (limited to 'docs/env.sh')
-rw-r--r-- | docs/env.sh | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/docs/env.sh b/docs/env.sh index 80292a40c..a9e52a3be 100644 --- a/docs/env.sh +++ b/docs/env.sh @@ -344,19 +344,40 @@ ns-pull() # clone all repositories ns-clone() { + SHALLOW="" + while [ $# -gt 0 ] + do + case "$1" in + -n | --not-netsurf) NS_BROWSER= + shift + ;; + -s | --shallow) SHALLOW="--depth 1" + shift + ;; + -*) echo "Error: Unknown option: $1" >&2 + exit 1 + ;; + *) # No more options + break + ;; + esac + done + mkdir -p ${TARGET_WORKSPACE} for REPO in $(echo ${NS_BUILDSYSTEM} ${NS_INTERNAL_LIBS} ${NS_FRONTEND_LIBS} ${NS_RISCOS_LIBS} ${NS_TOOLS} ${NS_BROWSER}) ; do echo -n " GIT: Cloning ${REPO}: " if [ -f ${TARGET_WORKSPACE}/${REPO}/.git/config ]; then echo "Repository already present" else - (cd ${TARGET_WORKSPACE} && git clone ${NS_GIT}/${REPO}.git; ) + (cd ${TARGET_WORKSPACE} && git clone ${SHALLOW} ${NS_GIT}/${REPO}.git; ) fi done # put current env.sh in place in workspace - if [ ! -f "${TARGET_WORKSPACE}/env.sh" -a -f ${TARGET_WORKSPACE}/${NS_BROWSER}/docs/env.sh ]; then - cp ${TARGET_WORKSPACE}/${NS_BROWSER}/docs/env.sh ${TARGET_WORKSPACE}/env.sh + if [ "x$NS_BROWSER" = "x" ]; then + if [ ! -f "${TARGET_WORKSPACE}/env.sh" -a -f ${TARGET_WORKSPACE}/${NS_BROWSER}/docs/env.sh ]; then + cp ${TARGET_WORKSPACE}/${NS_BROWSER}/docs/env.sh ${TARGET_WORKSPACE}/env.sh + fi fi } |