build: refactor cloning for upcoming regress foo

This commit is contained in:
Franco Fichtner 2014-12-28 11:01:40 +01:00
parent 0c6533a3e9
commit a502bcee71
2 changed files with 11 additions and 11 deletions

View File

@ -84,6 +84,14 @@ git_describe()
export REPO_COMMENT=${COMMENT}
}
setup_clone()
{
echo ">>> Setting up ${2} in ${1}"
# excludes git history on purpose...
tar -C/ -cf - --exclude=.${2}/.git .${2} | tar -C${1} -pxf -
}
setup_chroot()
{
echo ">>> Setting up chroot in ${1}"

View File

@ -51,25 +51,17 @@ git_clear ${SRCDIR}
setup_stage ${STAGEDIR}
setup_base ${STAGEDIR}
setup_packages ${STAGEDIR} ${PACKAGES}
setup_clone ${STAGEDIR} ${PORTSDIR}
setup_clone ${STAGEDIR} ${SRCDIR}
setup_chroot ${STAGEDIR}
echo ">>> Setting up ports in ${STAGEDIR}"
echo ">>> Building packages..."
MAKE_CONF="${TOOLSDIR}/config/current/make.conf"
if [ -f ${MAKE_CONF} ]; then
cp ${MAKE_CONF} ${STAGEDIR}/etc/make.conf
fi
tar -C/ -cf - --exclude=.${PORTSDIR}/.git .${PORTSDIR} | \
tar -C${STAGEDIR} -pxf -
echo ">>> Setting up src in ${STAGEDIR}"
tar -C/ -cf - --exclude=.${SRCDIR}/.git .${SRCDIR} | \
tar -C${STAGEDIR} -pxf -
echo ">>> Building packages..."
chroot ${STAGEDIR} /bin/sh -es <<EOF || true
if pkg -N; then
# no need to rebuild