build: simplify the setup / update of repos

The `update' target has made several advances in the last months,
so that it can be used to collect new changes, switch to the correct
branch and also clone repositories as needed.
This commit is contained in:
Franco Fichtner 2017-08-05 12:43:02 +02:00
parent ef4f808d27
commit a7112fd3e4
2 changed files with 8 additions and 8 deletions

View File

@ -15,13 +15,9 @@ tasks require a root user. Do the following to grab the repositories
# pkg install git
# cd /usr
# rm -rf src ports
# git clone https://github.com/opnsense/plugins
# git clone https://github.com/opnsense/ports
# git clone https://github.com/opnsense/tools
# git clone https://github.com/opnsense/core
# git clone https://github.com/opnsense/src
# cd tools
# make update
TL;DR
=====
@ -171,9 +167,9 @@ distribution files before running the actual build:
# make distfiles
Updating the individual repositories can be done as follows:
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

View File

@ -245,10 +245,14 @@ git_fetch()
git_clone()
{
if [ -d "${1}" ]; then
if [ -d "${1}/.git" ]; then
return
fi
if [ -d "${1}" ]; then
rm -r "${1}"
fi
echo ">>> Cloning ${1}:"
git clone "${PRODUCT_GITBASE}/$(basename ${1})" ${1}