From 8dc85a929a33b617177f3f909faca6870ac2529d Mon Sep 17 00:00:00 2001 From: Andriy Gapon Date: Wed, 8 Feb 2017 15:56:17 +0200 Subject: [PATCH] do not copy src directory if -S option is also given when src method is used --- src/share/poudriere/jail.sh | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/src/share/poudriere/jail.sh b/src/share/poudriere/jail.sh index 6ae297aaba..daf8d5878b 100755 --- a/src/share/poudriere/jail.sh +++ b/src/share/poudriere/jail.sh @@ -416,22 +416,24 @@ build_and_install_world() { install_from_src() { local cpignore_flag cpignore - msg_n "Copying ${SRC_BASE} to ${JAILMNT}/usr/src..." - mkdir -p ${JAILMNT}/usr/src - if [ -f ${SRC_BASE}/usr/src/.cpignore ]; then - cpignore_flag="-x" - else - cpignore=$(mktemp -t cpignore) - cpignore_flag="-X ${cpignore}" - # Ignore some files - cat > ${cpignore} <<-EOF - .git - .svn - EOF + if [ -z "$SRCPATH" ] ; then + msg_n "Copying ${SRC_BASE} to ${JAILMNT}/usr/src..." + mkdir -p ${JAILMNT}/usr/src + if [ -f ${SRC_BASE}/usr/src/.cpignore ]; then + cpignore_flag="-x" + else + cpignore=$(mktemp -t cpignore) + cpignore_flag="-X ${cpignore}" + # Ignore some files + cat > ${cpignore} <<-EOF + .git + .svn + EOF + fi + cpdup -i0 ${cpignore_flag} ${SRC_BASE} ${JAILMNT}/usr/src + [ -n "${cpignore}" ] && rm -f ${cpignore} + echo " done" fi - cpdup -i0 ${cpignore_flag} ${SRC_BASE} ${JAILMNT}/usr/src - [ -n "${cpignore}" ] && rm -f ${cpignore} - echo " done" setup_build_env if [ ${BUILD} -eq 0 ]; then