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.
This commit is contained in:
Franco Fichtner 2019-12-23 07:13:45 +01:00
parent ba113bc6db
commit 379bf96c4a
4 changed files with 20 additions and 9 deletions

View File

@ -85,10 +85,11 @@ UPLOADDIR?= .
_VERSION!= date '+%Y%m%d%H%M' _VERSION!= date '+%Y%m%d%H%M'
VERSION?= ${_VERSION} VERSION?= ${_VERSION}
STAGEDIRPREFIX?=/usr/obj STAGEDIRPREFIX?=/usr/obj
# XXX GITBASE modifier
PORTSREFBASE?= https://github.com/hardenedbsd PORTSREFURL?= https://github.com/hardenedbsd/hardenedbsd-ports
PORTSREFDIR?= /usr/hardenedbsd-ports PORTSREFDIR?= /usr/hardenedbsd-ports
PORTSREFBRANCH?=master PORTSREFBRANCH?=master
PLUGINSENV?= PLUGIN_PHP=${PHP} PLUGIN_ABI=${SETTINGS} \ PLUGINSENV?= PLUGIN_PHP=${PHP} PLUGIN_ABI=${SETTINGS} \
PLUGIN_PYTHON=${PYTHON3} PLUGIN_PYTHON=${PYTHON3}
PLUGINSDIR?= /usr/plugins PLUGINSDIR?= /usr/plugins
@ -153,7 +154,7 @@ ${STEP}: lint-steps
-H "${COREENV}" -u "${UEFI:tl}" -U "${SUFFIX}" \ -H "${COREENV}" -u "${UEFI:tl}" -U "${SUFFIX}" \
-V "${ADDITIONS}" -O "${GITBASE}" -r "${SERVER}" \ -V "${ADDITIONS}" -O "${GITBASE}" -r "${SERVER}" \
-q "${VERSIONS}" -h "${PLUGINSENV}" -I "${UPLOADDIR}" \ -q "${VERSIONS}" -h "${PLUGINSENV}" -I "${UPLOADDIR}" \
-D "${DEVELBRANCH}" ${${STEP}_ARGS} -D "${DEVELBRANCH}" -A "${PORTSREFURL}" ${${STEP}_ARGS}
.endfor .endfor
.for SCRIPT in ${SCRIPTS} .for SCRIPT in ${SCRIPTS}

View File

@ -186,7 +186,7 @@ Updating all or individual repositories can be done as follows:
# make update[-<repo1>[,...]] # make update[-<repo1>[,...]]
Available update options are: core, plugins, ports, src, tools Available update options are: core, plugins, ports, portsref, src, tools
Regression tests Regression tests
---------------- ----------------

View File

@ -28,10 +28,13 @@
set -e 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 while getopts ${OPTS} OPT; do
case ${OPT} in case ${OPT} in
A)
export PORTSREFURL=${OPTARG}
;;
a) a)
export PRODUCT_TARGET=${OPTARG%%:*} export PRODUCT_TARGET=${OPTARG%%:*}
export PRODUCT_ARCH=${OPTARG##*:} export PRODUCT_ARCH=${OPTARG##*:}
@ -315,7 +318,13 @@ git_clone()
echo ">>> Cloning ${1}:" 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() git_pull()

View File

@ -37,6 +37,8 @@ if [ -z "${ARGS}" ]; then
fi fi
for ARG in ${ARGS}; do for ARG in ${ARGS}; do
URL=
case ${ARG} in case ${ARG} in
core) core)
BRANCHES="${DEVELBRANCH} ${COREBRANCH}" BRANCHES="${DEVELBRANCH} ${COREBRANCH}"
@ -51,10 +53,9 @@ for ARG in ${ARGS}; do
DIR=${PORTSDIR} DIR=${PORTSDIR}
;; ;;
portsref) portsref)
# XXX needs GITBASE=https://github.com/hardenedbsd
BRANCHES=${PORTSREFBRANCH} BRANCHES=${PORTSREFBRANCH}
DIR=${PORTSREFDIR} DIR=${PORTSREFDIR}
ACCOUNT=hardenedbsd URL=${PORTSREFURL}
;; ;;
src) src)
BRANCHES=${SRCBRANCH} BRANCHES=${SRCBRANCH}
@ -69,7 +70,7 @@ for ARG in ${ARGS}; do
;; ;;
esac esac
git_clone ${DIR} git_clone ${DIR} "${URL}"
git_fetch ${DIR} git_fetch ${DIR}
for BRANCH in ${BRANCHES}; do for BRANCH in ${BRANCHES}; do
git_pull ${DIR} ${BRANCH} git_pull ${DIR} ${BRANCH}