From 379bf96c4ada9a163844ff6fd6d37fc04f0ef386 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 23 Dec 2019 07:13:45 +0100 Subject: [PATCH] build: fix issue with "make update-portsref" ... which is only used with "make skim". Since HBSD moves to another git server soon this seems like a good idea to fix. --- Makefile | 7 ++++--- README.md | 2 +- build/common.sh | 13 +++++++++++-- build/update.sh | 7 ++++--- 4 files changed, 20 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 16bb4ae..5fa6555 100644 --- a/Makefile +++ b/Makefile @@ -85,10 +85,11 @@ UPLOADDIR?= . _VERSION!= date '+%Y%m%d%H%M' VERSION?= ${_VERSION} STAGEDIRPREFIX?=/usr/obj -# XXX GITBASE modifier -PORTSREFBASE?= https://github.com/hardenedbsd + +PORTSREFURL?= https://github.com/hardenedbsd/hardenedbsd-ports PORTSREFDIR?= /usr/hardenedbsd-ports PORTSREFBRANCH?=master + PLUGINSENV?= PLUGIN_PHP=${PHP} PLUGIN_ABI=${SETTINGS} \ PLUGIN_PYTHON=${PYTHON3} PLUGINSDIR?= /usr/plugins @@ -153,7 +154,7 @@ ${STEP}: lint-steps -H "${COREENV}" -u "${UEFI:tl}" -U "${SUFFIX}" \ -V "${ADDITIONS}" -O "${GITBASE}" -r "${SERVER}" \ -q "${VERSIONS}" -h "${PLUGINSENV}" -I "${UPLOADDIR}" \ - -D "${DEVELBRANCH}" ${${STEP}_ARGS} + -D "${DEVELBRANCH}" -A "${PORTSREFURL}" ${${STEP}_ARGS} .endfor .for SCRIPT in ${SCRIPTS} diff --git a/README.md b/README.md index d10d44e..73d80ae 100644 --- a/README.md +++ b/README.md @@ -186,7 +186,7 @@ Updating all or individual repositories can be done as follows: # make update[-[,...]] -Available update options are: core, plugins, ports, src, tools +Available update options are: core, plugins, ports, portsref, src, tools Regression tests ---------------- diff --git a/build/common.sh b/build/common.sh index 3b5ffc9..8001dc5 100644 --- a/build/common.sh +++ b/build/common.sh @@ -28,10 +28,13 @@ set -e -OPTS="a:B:b:C:c:D:d:E:e:F:f:G:g:H:h:I:K:k:L:l:m:n:O:o:P:p:q:R:r:S:s:T:t:U:u:v:V:" +OPTS="A:a:B:b:C:c:D:d:E:e:F:f:G:g:H:h:I:K:k:L:l:m:n:O:o:P:p:q:R:r:S:s:T:t:U:u:v:V:" while getopts ${OPTS} OPT; do case ${OPT} in + A) + export PORTSREFURL=${OPTARG} + ;; a) export PRODUCT_TARGET=${OPTARG%%:*} export PRODUCT_ARCH=${OPTARG##*:} @@ -315,7 +318,13 @@ git_clone() echo ">>> Cloning ${1}:" - git clone "${PRODUCT_GITBASE}/$(basename ${1})" ${1} + URL=${2} + + if [ -z "${URL}" ]; then + URL=${PRODUCT_GITBASE}/$(basename ${1}) + fi + + git clone "${URL}" ${1} } git_pull() diff --git a/build/update.sh b/build/update.sh index 27e0775..35d9f0f 100644 --- a/build/update.sh +++ b/build/update.sh @@ -37,6 +37,8 @@ if [ -z "${ARGS}" ]; then fi for ARG in ${ARGS}; do + URL= + case ${ARG} in core) BRANCHES="${DEVELBRANCH} ${COREBRANCH}" @@ -51,10 +53,9 @@ for ARG in ${ARGS}; do DIR=${PORTSDIR} ;; portsref) - # XXX needs GITBASE=https://github.com/hardenedbsd BRANCHES=${PORTSREFBRANCH} DIR=${PORTSREFDIR} - ACCOUNT=hardenedbsd + URL=${PORTSREFURL} ;; src) BRANCHES=${SRCBRANCH} @@ -69,7 +70,7 @@ for ARG in ${ARGS}; do ;; esac - git_clone ${DIR} + git_clone ${DIR} "${URL}" git_fetch ${DIR} for BRANCH in ${BRANCHES}; do git_pull ${DIR} ${BRANCH}