From 563165ede2f35a659202ff0a8beb47b80e86e6c1 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Sun, 24 Feb 2019 18:33:44 +0100 Subject: [PATCH] build: make DEVELBRANCH optional; closes #117 --- Makefile | 9 +++++++-- build/common.sh | 5 ++++- build/core.sh | 5 ++--- build/plugins.sh | 4 ++-- build/rewind.sh | 14 ++++++-------- build/update.sh | 12 +++--------- 6 files changed, 24 insertions(+), 25 deletions(-) diff --git a/Makefile b/Makefile index 806e532..e201b7e 100644 --- a/Makefile +++ b/Makefile @@ -81,10 +81,12 @@ MIRRORS?= https://opnsense.c0urier.net \ http://mirror.fra10.de.leaseweb.net/opnsense \ http://mirror.ams1.nl.leaseweb.net/opnsense SERVER?= user@does.not.exist -UPLOADDIR?= +UPLOADDIR?= # empty _VERSION!= date '+%Y%m%d%H%M' VERSION?= ${_VERSION} STAGEDIRPREFIX?=/usr/obj +# XXX GITBASE modifier +PORTSREFBASE?= https://github.com/hardenedbsd PORTSREFDIR?= /usr/hardenedbsd-ports PORTSREFBRANCH?=master PLUGINSENV?= PLUGIN_PHP=${PHP} PLUGIN_ABI=${SETTINGS} @@ -98,6 +100,9 @@ COREENV?= CORE_PHP=${PHP} CORE_ABI=${SETTINGS} SRCDIR?= /usr/src SRCBRANCH?= master +# for ports and core +DEVELBRANCH?= #master + # A couple of meta-targets for easy use and ordering: ports distfiles: base @@ -146,7 +151,7 @@ ${STEP}: lint-steps -H "${COREENV}" -Q "${QUICK}" -u "${UEFI:tl}" -U "${SUFFIX}" \ -V "${ADDITIONS}" -O "${GITBASE}" -r "${SERVER}" \ -q "${VERSIONS}" -h "${PLUGINENV}" -I "${UPLOADDIR}" \ - ${${STEP}_ARGS} + -D "${DEVELBRANCH}" ${${STEP}_ARGS} .endfor .for SCRIPT in ${SCRIPTS} diff --git a/build/common.sh b/build/common.sh index d46ab39..a5660f1 100644 --- a/build/common.sh +++ b/build/common.sh @@ -28,7 +28,7 @@ set -e -OPTS="a:B:b:C:c:d:E:e:F:f:G:g:H:h:I:K:k:L:l:m:n:O:o:P:p:Q:q:R:r:S:s:T:t:U:u:v:V:" +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:q:R:r:S:s:T:t:U:u:v:V:" while getopts ${OPTS} OPT; do case ${OPT} in @@ -52,6 +52,9 @@ while getopts ${OPTS} OPT; do d) export PRODUCT_DEVICE=${OPTARG} ;; + D) + export DEVELBRANCH=${OPTARG} + ;; E) export COREBRANCH=${OPTARG} ;; diff --git a/build/core.sh b/build/core.sh index 9aa2481..ed39cfc 100644 --- a/build/core.sh +++ b/build/core.sh @@ -1,6 +1,6 @@ #!/bin/sh -# Copyright (c) 2014-2017 Franco Fichtner +# Copyright (c) 2014-2019 Franco Fichtner # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -41,11 +41,10 @@ setup_chroot ${STAGEDIR} extract_packages ${STAGEDIR} remove_packages ${STAGEDIR} ${@} -# register persistent packages to avoid bouncing install_packages ${STAGEDIR} pkg git lock_packages ${STAGEDIR} -for BRANCH in master ${COREBRANCH}; do +for BRANCH in ${DEVELBRANCH} ${COREBRANCH}; do setup_copy ${STAGEDIR} ${COREDIR} git_reset ${STAGEDIR}${COREDIR} ${BRANCH} diff --git a/build/plugins.sh b/build/plugins.sh index 568961d..f3e4903 100644 --- a/build/plugins.sh +++ b/build/plugins.sh @@ -1,6 +1,6 @@ #!/bin/sh -# Copyright (c) 2015-2018 Franco Fichtner +# Copyright (c) 2015-2019 Franco Fichtner # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -79,7 +79,7 @@ remove_packages ${STAGEDIR} ${@} install_packages ${STAGEDIR} pkg git lock_packages ${STAGEDIR} -for BRANCH in master ${PLUGINSBRANCH}; do +for BRANCH in ${DEVELBRANCH} ${PLUGINSBRANCH}; do setup_copy ${STAGEDIR} ${PLUGINSDIR} git_reset ${STAGEDIR}${PLUGINSDIR} ${BRANCH} diff --git a/build/rewind.sh b/build/rewind.sh index 99ed1a4..53f20b9 100644 --- a/build/rewind.sh +++ b/build/rewind.sh @@ -1,6 +1,6 @@ #!/bin/sh -# Copyright (c) 2018 Franco Fichtner +# Copyright (c) 2018-2019 Franco Fichtner # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -31,6 +31,11 @@ SELF=rewind . ./common.sh +if [ -n "${DEVELBRANCH}" ]; then + echo ">>> Cannot rewind, please unset DEVELBRANCH=${DEVELBRANCH}" + exit 1 +fi + ARGS="src ports plugins core tools" for ARG in ${ARGS}; do @@ -60,14 +65,7 @@ for ARG in ${ARGS}; do ;; esac - # XXX When we start rewind set a marker - # for the build process to ignore master - # branch development package builds. - # - # This flag may be cleared by "make update". - git_tag ${DIR} ${PRODUCT_VERSION} - continue; # XXX here be dragons git_pull ${DIR} ${BRANCH} git_reset ${DIR} done diff --git a/build/update.sh b/build/update.sh index 050e1a4..ccf62a9 100644 --- a/build/update.sh +++ b/build/update.sh @@ -1,6 +1,6 @@ #!/bin/sh -# Copyright (c) 2017 Franco Fichtner +# Copyright (c) 2017-2019 Franco Fichtner # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -39,18 +39,12 @@ fi for ARG in ${ARGS}; do case ${ARG} in core) - BRANCHES=${COREBRANCH} + BRANCHES="${DEVELBRANCH} ${COREBRANCH}" DIR=${COREDIR} - if [ ${BRANCHES} != master ]; then - BRANCHES="master ${BRANCHES}" - fi ;; plugins) - BRANCHES=${PLUGINSBRANCH} + BRANCHES="${DEVELBRANCH} ${PLUGINSBRANCH}" DIR=${PLUGINSDIR} - if [ ${BRANCHES} != master ]; then - BRANCHES="master ${BRANCHES}" - fi ;; ports) BRANCHES=${PORTSBRANCH}