build/update: simple update script
This commit is contained in:
parent
a474ed948f
commit
e7bcd88360
9
Makefile
9
Makefile
|
@ -25,8 +25,8 @@
|
|||
|
||||
STEPS= base boot cdrom chroot clean core distfiles info \
|
||||
kernel nano plugins ports prefetch print rebase \
|
||||
release rename serial sign skim test verify vga \
|
||||
vm xtools
|
||||
release rename serial sign skim test update verify \
|
||||
vga vm xtools
|
||||
.PHONY: ${STEPS}
|
||||
|
||||
PAGER?= less
|
||||
|
@ -72,6 +72,7 @@ _VERSION!= date '+%Y%m%d%H%M'
|
|||
VERSION?= ${_VERSION}
|
||||
STAGEDIRPREFIX?=/usr/obj
|
||||
PORTSREFDIR?= /usr/freebsd-ports
|
||||
PORTSREFBRANCH?=master
|
||||
PLUGINSDIR?= /usr/plugins
|
||||
PLUGINSBRANCH?= master
|
||||
PORTSDIR?= /usr/ports
|
||||
|
@ -121,6 +122,6 @@ ${STEP}: lint
|
|||
-K "${PUBKEY}" -l "${SIGNCHK}" -L "${SIGNCMD}" -d ${DEVICE} \
|
||||
-m ${MIRRORS:Ox:[1]} -o "${STAGEDIRPREFIX}" -c ${SPEED} \
|
||||
-b ${SRCBRANCH} -B ${PORTSBRANCH} -e ${PLUGINSBRANCH} \
|
||||
-g ${TOOLSBRANCH} -E ${COREBRANCH} -u "${UEFI:tl}" \
|
||||
-U "${SUFFIX}" -V "${ADDITIONS}" ${${STEP}_ARGS}
|
||||
-g ${TOOLSBRANCH} -E ${COREBRANCH} -G ${PORTSREFBRANCH} \
|
||||
-u "${UEFI:tl}" -U "${SUFFIX}" -V "${ADDITIONS}" ${${STEP}_ARGS}
|
||||
.endfor
|
||||
|
|
|
@ -164,6 +164,12 @@ distribution files before running the actual build:
|
|||
|
||||
# make distfiles
|
||||
|
||||
Updating the individual repositories can be done as follows:
|
||||
|
||||
# make update-<repo1>[,...]
|
||||
|
||||
Available update options are: core, plugins, ports, src, tools
|
||||
|
||||
Compiled sets can be prefetched from a mirror, while removing
|
||||
any previously available set:
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
set -e
|
||||
|
||||
OPTS="a:B:b:C:c:d:E:e:f:F:g:K:k:L:l:m:n:o:P:p:R:S:s:T:t:U:u:v:V:"
|
||||
OPTS="a:B:b:C:c:d:E:e:F:f:G:g:K:k:L:l:m:n:o:P:p:R:S:s:T:t:U:u:v:V:"
|
||||
SCRUB_ARGS=":"
|
||||
|
||||
while getopts ${OPTS} OPT; do
|
||||
|
@ -67,12 +67,16 @@ while getopts ${OPTS} OPT; do
|
|||
export PLUGINSBRANCH=${OPTARG}
|
||||
SCRUB_ARGS=${SCRUB_ARGS};shift;shift
|
||||
;;
|
||||
F)
|
||||
export PRODUCT_KERNEL=${OPTARG}
|
||||
SCRUB_ARGS=${SCRUB_ARGS};shift;shift
|
||||
;;
|
||||
f)
|
||||
export PRODUCT_FLAVOUR=${OPTARG}
|
||||
SCRUB_ARGS=${SCRUB_ARGS};shift;shift
|
||||
;;
|
||||
F)
|
||||
export PRODUCT_KERNEL=${OPTARG}
|
||||
G)
|
||||
export PORTSREFBRANCH=${OPTARG}
|
||||
SCRUB_ARGS=${SCRUB_ARGS};shift;shift
|
||||
;;
|
||||
g)
|
||||
|
@ -251,9 +255,11 @@ git_checkout()
|
|||
|
||||
git_update()
|
||||
{
|
||||
git -C ${1} fetch --all --prune
|
||||
if [ -n "${2}" ]; then
|
||||
git_checkout ${1} ${2}
|
||||
git -C ${1} checkout ${2}
|
||||
git -C ${1} pull
|
||||
else
|
||||
git -C ${1} fetch --all --prune
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ done
|
|||
)
|
||||
|
||||
git_branch ${PORTSDIR} ${PORTSBRANCH} PORTSBRANCH
|
||||
git_update ${PORTSREFDIR} origin/master
|
||||
git_update ${PORTSREFDIR} ${PORTSREFBRANCH}
|
||||
git_checkout ${PORTSDIR} HEAD
|
||||
|
||||
UNUSED=1
|
||||
|
|
|
@ -0,0 +1,63 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Copyright (c) 2017 Franco Fichtner <franco@opnsense.org>
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
#
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
# SUCH DAMAGE.
|
||||
|
||||
set -e
|
||||
|
||||
SELF=update
|
||||
|
||||
. ./common.sh && $(${SCRUB_ARGS})
|
||||
|
||||
for ARG in ${@}; do
|
||||
case ${ARG} in
|
||||
core)
|
||||
BRANCH=${COREBRANCH}
|
||||
DIR=${COREDIR}
|
||||
;;
|
||||
plugins)
|
||||
BRANCH=${PLUGINSBRANCH}
|
||||
DIR=${PLUGINSDIR}
|
||||
;;
|
||||
ports)
|
||||
BRANCH=${PORTSBRANCH}
|
||||
DIR=${PORTSDIR}
|
||||
;;
|
||||
src)
|
||||
BRANCH=${SRCBRANCH}
|
||||
DIR=${SRCDIR}
|
||||
;;
|
||||
tools)
|
||||
BRANCH=${TOOLSBRANCH}
|
||||
DIR=${TOOLSDIR}
|
||||
;;
|
||||
*)
|
||||
continue
|
||||
;;
|
||||
esac
|
||||
|
||||
echo ">>> Updating branch ${BRANCH} of ${DIR}..."
|
||||
git_update ${DIR} ${BRANCH}
|
||||
done
|
Loading…
Reference in New Issue