diff options
author | Bryan Drewery <bryan@shatow.net> | 2021-09-10 07:14:27 +0300 |
---|---|---|
committer | Bryan Drewery <bryan@shatow.net> | 2021-09-25 19:38:56 +0300 |
commit | 607b3b3e02308c20c3c0258583e774201c9945c9 (patch) | |
tree | f5ff7851b6a4f61c0315a49351a69193d118b6a0 | |
parent | 2b3a4e92c6955de978b3b6cf70743efb49b81019 (diff) |
Track {MASTERMNT,mnt}/.p relatively as {MASTER,MNT}_DATADIR
-rw-r--r-- | src/share/poudriere/common.sh | 32 | ||||
-rw-r--r-- | src/share/poudriere/include/fs.sh | 2 |
2 files changed, 20 insertions, 14 deletions
diff --git a/src/share/poudriere/common.sh b/src/share/poudriere/common.sh index cdcdbbb2..72552b76 100644 --- a/src/share/poudriere/common.sh +++ b/src/share/poudriere/common.sh @@ -1678,7 +1678,7 @@ common_mtree() { cat <<-EOF ./.npkg - ./.p + ./${DATADIR_NAME} ./.poudriere-snap-* .${HOME}/.ccache ./compat/linux/proc @@ -2169,6 +2169,17 @@ do_portbuild_mounts() { local setname="$4" local optionsdir opt o msgmount msgdev + # Create our data dirs + MNT_DATADIR="${mnt}/${DATADIR_NAME}" + mkdir -p "${MNT_DATADIR}" + add_relpath_var MNT_DATADIR + if [ ${TMPFS_DATA} -eq 1 -o ${TMPFS_ALL} -eq 1 ]; then + mnt_tmpfs data "${MNT_DATADIR}" + fi + mkdir -p \ + "${MNT_DATADIR}/tmp" \ + "${MNT_DATADIR}/var/run" + # clone will inherit from the ref jail if [ ${mnt##*/} = "ref" ]; then mkdir -p "${mnt}${PORTSDIR}" \ @@ -2185,17 +2196,9 @@ do_portbuild_mounts() { mkdir -p "${mnt}${OVERLAYSDIR}/${o}" done ln -fs "usr/home" "${mnt}/home" + MASTER_DATADIR="${MNT_DATADIR}" + add_relpath_var MASTER_DATADIR fi - # Create our data dirs - mkdir -p "${mnt}/.p" - if [ ${TMPFS_DATA} -eq 1 -o ${TMPFS_ALL} -eq 1 ]; then - mnt_tmpfs data "${mnt}/.p" - fi - - mkdir -p \ - "${mnt}/.p/tmp" \ - "${mnt}/.p/var/run" - if [ -d "${CCACHE_DIR:-/nonexistent}" ]; then ${NULLMOUNT} ${CCACHE_DIR} ${mnt}${HOME}/.ccache fi @@ -3126,7 +3129,7 @@ jail_start() { \( -depth 1 -name .ccache -prune \) -o \ \( -depth 1 -name .cpignore -prune \) -o \ \( -depth 1 -name .npkg -prune \) -o \ - \( -depth 1 -name .p -prune \) -o \ + \( -depth 1 -name "${DATADIR_NAME}" -prune \) -o \ \( -depth 1 -name distfiles -prune \) -o \ \( -depth 1 -name packages -prune \) -o \ \( -path "${tomnt}/${PORTSDIR}" -prune \) -o \ @@ -4978,6 +4981,8 @@ build_pkg() { if [ -n "${MAX_MEMORY_BYTES}" -o -n "${MAX_FILES}" ]; then JEXEC_LIMITS=1 fi + MNT_DATADIR="${mnt}/${DATADIR_NAME}" + add_relpath_var MNT_DATADIR if [ ${TMPFS_LOCALBASE} -eq 1 -o ${TMPFS_ALL} -eq 1 ]; then if [ -f "${mnt}/${LOCALBASE:-/usr/local}/.mounted" ]; then @@ -7774,7 +7779,7 @@ prepare_ports() { err 1 "Failed to lookup global ports metadata" PKG_EXT="${P_PKG_SUFX#.}" - PKG_BIN="/.p/pkg-static" + PKG_BIN="/${DATADIR_NAME}/pkg-static" PKG_ADD="${PKG_BIN} add" PKG_DELETE="${PKG_BIN} delete -y -f" PKG_VERSION="${PKG_BIN} version" @@ -8763,6 +8768,7 @@ INTERACTIVE_MODE=0 : ${SHASH_VAR_PATH_DEFAULT:=${POUDRIERE_TMPDIR}} : ${SHASH_VAR_PATH:=${SHASH_VAR_PATH_DEFAULT}} : ${SHASH_VAR_PREFIX:=sh-} +: ${DATADIR_NAME:=".p"} : ${USE_CACHED:=no} diff --git a/src/share/poudriere/include/fs.sh b/src/share/poudriere/include/fs.sh index 9ef2b8e8..9b85a9cd 100644 --- a/src/share/poudriere/include/fs.sh +++ b/src/share/poudriere/include/fs.sh @@ -338,7 +338,7 @@ clonefs() { do_clone -r ${cpignore:+-X "${cpignore}"} "${from}" "${mnt}" if [ "${snap}" = "clean" ]; then rm -f "${cpignore}" - echo ".p" >> "${mnt}/.cpignore" + echo "${DATADIR_NAME}" >> "${mnt}/.cpignore" fi fi } |