diff options
author | Bryan Drewery <bryan@shatow.net> | 2019-12-04 07:29:38 +0300 |
---|---|---|
committer | Bryan Drewery <bryan@shatow.net> | 2019-12-04 07:29:38 +0300 |
commit | 2e3ddbfaabd9c2ee3980c3cf1bd61d0600125122 (patch) | |
tree | 8e60abcd6f2f70a9907947722b1bb50a78fb9afe | |
parent | 3adede0931647e786aa6f53023e5201bf4b3bc25 (diff) | |
parent | 0faf9c040a79b4920676620a7fc3c492c7c18d49 (diff) |
Merge remote-tracking branch 'origin/master' into overlay
-rw-r--r-- | .cirrus.yml | 18 | ||||
-rw-r--r-- | README.md | 9 | ||||
-rw-r--r-- | completions/zsh/_poudriere | 2 | ||||
-rw-r--r-- | src/etc/poudriere.conf.sample | 2 | ||||
-rw-r--r-- | src/poudriere-sh/mapfile.c | 2 | ||||
-rw-r--r-- | src/poudriere-sh/mkfifo.c | 5 | ||||
-rwxr-xr-x | src/share/poudriere/common.sh | 81 | ||||
-rw-r--r-- | src/share/poudriere/include/display.sh | 5 | ||||
-rw-r--r-- | src/share/poudriere/include/fs.sh | 5 | ||||
-rw-r--r-- | src/share/poudriere/include/hash.sh | 10 | ||||
-rwxr-xr-x | src/share/poudriere/jail.sh | 27 | ||||
-rwxr-xr-x | src/share/poudriere/pkgclean.sh | 2 | ||||
-rwxr-xr-x | src/share/poudriere/testport.sh | 2 | ||||
-rw-r--r-- | test/Makefile | 10 | ||||
-rw-r--r-- | test/common.bulk.sh | 25 | ||||
-rw-r--r-- | test/common.sh | 3 | ||||
-rw-r--r-- | test/prep.sh | 3 |
17 files changed, 126 insertions, 85 deletions
diff --git a/.cirrus.yml b/.cirrus.yml new file mode 100644 index 00000000..5b8cd597 --- /dev/null +++ b/.cirrus.yml @@ -0,0 +1,18 @@ +check_task: + compile_script: + - ./configure + - make + test_jail_prep_script: + - make -C test prep + check_script: make -C test check + check_stock_script: make -C test check-stock + matrix: + - name: freebsd11-amd64 + freebsd_instance: + image: freebsd-11-2-release-amd64 + - name: freebsd12-amd64 + freebsd_instance: + image: freebsd-12-0-release-amd64 + - name: freebsd13-amd64 + freebsd_instance: + image_family: freebsd-13-0-snap @@ -38,9 +38,6 @@ Getting started with poudriere Build status ------------------------------ -* i386 [![FreeBSD i386](https://jenkins.mouf.net/job/poudriere/label=i386/badge/icon)](https://jenkins.mouf.net/job/poudriere/label=i386) -* amd64 [![FreeBSD amd64](https://jenkins.mouf.net/job/poudriere/label=amd64/badge/icon)](https://jenkins.mouf.net/job/poudriere/label=amd64) -* armv6 [![FreeBSD armv6](https://jenkins.mouf.net/job/poudriere/label=armv6/badge/icon)](https://jenkins.mouf.net/job/poudriere/label=armv6) -* armv7 [![FreeBSD armv7](https://jenkins.mouf.net/job/poudriere/label=armv7/badge/icon)](https://jenkins.mouf.net/job/poudriere/label=armv7) -* aarch64 [![FreeBSD aarch64](https://jenkins.mouf.net/job/poudriere/label=aarch64/badge/icon)](https://jenkins.mouf.net/job/poudriere/label=aarch64) -* powerpc64 [![FreeBSD powerpc64](https://jenkins.mouf.net/job/poudriere/label=powerpc64/badge/icon)](https://jenkins.mouf.net/job/poudriere/label=powerpc64) +* [![FreeBSD 11.2 amd64](https://api.cirrus-ci.com/github/freebsd/poudriere.svg?task=freebsd11-amd64&branch=master)](https://cirrus-ci.com/github/freebsd/poudriere) +* [![FreeBSD 12.0 amd64](https://api.cirrus-ci.com/github/freebsd/poudriere.svg?task=freebsd12-amd64&branch=master)](https://cirrus-ci.com/github/freebsd/poudriere) +* [![FreeBSD 13.0 amd64](https://api.cirrus-ci.com/github/freebsd/poudriere.svg?task=freebsd13-amd64&branch=master)](https://cirrus-ci.com/github/freebsd/poudriere) diff --git a/completions/zsh/_poudriere b/completions/zsh/_poudriere index 07cb6297..0f01f7db 100644 --- a/completions/zsh/_poudriere +++ b/completions/zsh/_poudriere @@ -89,7 +89,7 @@ _jail=( '-t[version of FreeBSD to upgrade the jail to]::version' '-U[specify a url to fetch the sources (with method git and/or svn)]::url' '-x[build and setup native-xtools cross compile tools in jail when building for a different TARGET ARCH than the host]' - '-C[clean remaining data existing in pourdiere data folder]::clean:(all cache logs packages wrkdirs)' + '-C[clean remaining data existing in poudriere data folder]::clean:(all cache logs packages wrkdirs)' '-p[specify which ports tree to start/stop the jail with]::tree:_poudriere_pt' '-z[specify which SET the jail to start/stop with]::set' ) diff --git a/src/etc/poudriere.conf.sample b/src/etc/poudriere.conf.sample index 65702aca..91f2657a 100644 --- a/src/etc/poudriere.conf.sample +++ b/src/etc/poudriere.conf.sample @@ -30,7 +30,7 @@ FREEBSD_HOST=_PROTO_://_CHANGE_THIS_ # By default the jails have no /etc/resolv.conf, you will need to set -# RESOLV_CONF to a file on your hosts system that will be copied has +# RESOLV_CONF to a file on your hosts system that will be copied to # /etc/resolv.conf for the jail, except if you don't need it (using an http # proxy for example) RESOLV_CONF=/etc/resolv.conf diff --git a/src/poudriere-sh/mapfile.c b/src/poudriere-sh/mapfile.c index e88b43d4..9c318b0c 100644 --- a/src/poudriere-sh/mapfile.c +++ b/src/poudriere-sh/mapfile.c @@ -134,7 +134,7 @@ mapfilecmd(int argc, char **argv) break; } } - if (mapped_files[nextidx] != NULL) + if (nextidx == -1 || mapped_files[nextidx] != NULL) errx(EX_SOFTWARE, "%s", "mapped files stack exceeded"); file = argv[2]; diff --git a/src/poudriere-sh/mkfifo.c b/src/poudriere-sh/mkfifo.c index 51314630..f6dfa294 100644 --- a/src/poudriere-sh/mkfifo.c +++ b/src/poudriere-sh/mkfifo.c @@ -73,7 +73,7 @@ int main(int argc, char *argv[]) { const char *modestr = NULL; - const void *modep; + void *modep; mode_t fifomode; int ch, exitval; @@ -115,6 +115,9 @@ main(int argc, char *argv[]) errx(1, "invalid file mode: %s", modestr); } fifomode = getmode(modep, BASEMODE); +#ifdef SHELL + free(modep); +#endif } else { fifomode = BASEMODE; } diff --git a/src/share/poudriere/common.sh b/src/share/poudriere/common.sh index 09f905e0..23e07e17 100755 --- a/src/share/poudriere/common.sh +++ b/src/share/poudriere/common.sh @@ -77,12 +77,8 @@ err() { # Try to set status so other processes know this crashed # Don't set it from children failures though, only master if [ "${PARALLEL_CHILD:-0}" -eq 0 ] && was_a_bulk_run; then - if [ -n "${MY_JOBID}" ]; then - bset ${MY_JOBID} status "${EXIT_STATUS:-crashed:}" \ - 2>/dev/null || : - else - bset status "${EXIT_STATUS:-crashed:}" 2>/dev/null || : - fi + bset ${MY_JOBID} status "${EXIT_STATUS:-crashed:}" \ + 2>/dev/null || : fi if [ ${1} -eq 0 ]; then msg "$2" || : @@ -122,9 +118,9 @@ _msg_n() { arrow="=>>" fi if [ -n "${COLOR_ARROW}" ] || [ -z "${1##*\033[*}" ]; then - printf "${COLOR_ARROW}${elapsed}${DRY_MODE}${arrow:+${COLOR_ARROW}${arrow}${COLOR_RESET} }${1}${COLOR_RESET}${NL}" + printf "${COLOR_ARROW}${elapsed}${DRY_MODE}${arrow:+${COLOR_ARROW}${arrow}${COLOR_RESET} }${*}${COLOR_RESET}${NL}" else - printf "${elapsed}${DRY_MODE}${arrow:+${arrow} }${1}${NL}" + printf "${elapsed}${DRY_MODE}${arrow:+${arrow} }${*}${NL}" fi } @@ -1079,6 +1075,22 @@ update_stats() { lock_release update_stats } +update_stats_queued() { + [ $# -eq 0 ] || eargs update_stats_queued + local nbq nbi nbs + + nbq=$(pkgqueue_list | wc -l) + # Need to add in pre-build ignored/skipped + _bget nbi stats_ignored || nbi=0 + _bget nbs stats_skipped || nbs=0 + nbq=$((nbq + nbi + nbs)) + + # Add 1 for the main port to test + was_a_testport_run && \ + nbq=$((${nbq} + 1)) + bset stats_queued ${nbq##* } +} + sigpipe_handler() { EXIT_STATUS="sigpipe:" SIGNAL="SIGPIPE" @@ -2951,7 +2963,7 @@ check_leftovers() { ( cd "${mnt}" && \ mtree -X "${MASTERMNT}/.p/mtree.preinstexclude${PORTTESTING}" \ -f "${mnt}/.p/mtree.preinst" -p . ) | \ - while read l; do + while mapfile_read_loop_redir l; do local changed read_again changed= @@ -3375,7 +3387,8 @@ build_port() { injail /usr/bin/env PORTSDIR=${PORTSDIR} \ ${PORT_FLAGS} /bin/sh \ ${PORTSDIR}/Mk/Scripts/check_leftovers.sh \ - ${port} | while read modtype data; do + ${port} | while \ + mapfile_read_loop_redir modtype data; do case "${modtype}" in +) echo "${data}" >> ${add} ;; -) echo "${data}" >> ${del} ;; @@ -3510,7 +3523,8 @@ may show failures if the port does not respect PREFIX." # everything was fine we can copy the package to the package # directory find "${PACKAGES}/.npkg/${pkgname}" \ - -mindepth 1 \( -type f -or -type l \) | while read pkg_path; do + -mindepth 1 \( -type f -or -type l \) | \ + while mapfile_read_loop_redir pkg_path; do pkg_file="${pkg_path#${PACKAGES}/.npkg/${pkgname}}" pkg_base="${pkg_file%/*}" mkdir -p "${PACKAGES}/${pkg_base}" @@ -3535,15 +3549,13 @@ save_wrkdir() { local wrkdir [ "${SAVE_WRKDIR}" != "no" ] || return 0 - # Only save if not in fetch/checksum phase - [ "${failed_phase}" != "fetch" -a "${failed_phase}" != "checksum" -a \ - "${failed_phase}" != "extract" ] || return 0 + # Don't save pre-extract + case ${phase} in + check-sanity|pkg-depends|fetch-depends|fetch|checksum|extract-depends|extract) return 0 ;; + esac - if [ -n "${MY_JOBID}" ]; then - bset ${MY_JOBID} status "save_wrkdir:" - else - bset status "save_wrkdir:" - fi + job_msg "Saving ${COLOR_PORT}${originspec} | ${pkgname}${COLOR_RESET} wrkdir" + bset ${MY_JOBID} status "save_wrkdir:" mkdir -p ${tardir} # Tar up the WRKDIR, and ignore errors @@ -4235,8 +4247,8 @@ build_pkg() { fi msg "Cleaning up wrkdir" - injail /usr/bin/make -C "${portdir}" ${MAKE_ARGS} \ - -DNOCLEANDEPENDS clean || : + injail /usr/bin/make -C "${portdir}" -k \ + -DNOCLEANDEPENDS clean ${MAKE_ARGS} || : rm -rf ${mnt}/wrkdirs/* || : clean_pool "${pkgname}" "${originspec}" "${clean_rdepends}" @@ -6681,7 +6693,8 @@ origin_should_use_dep_args() { listed_ports() { if have_ports_feature DEPENDS_ARGS; then - _listed_ports "$@" | while read originspec; do + _listed_ports "$@" | \ + while mapfile_read_loop_redir originspec; do map_py_slave_port "${originspec}" originspec || : echo "${originspec}" done @@ -7093,6 +7106,7 @@ trim_ignored() { done # Update ignored/skipped stats update_stats + update_stats_queued } trim_ignored_pkg() { @@ -7165,7 +7179,7 @@ clean_build_queue() { prepare_ports() { local pkg local log log_top - local n nbq nbi nbs resuming_build + local n resuming_build local cache_dir sflag delete_pkg_list shash_bucket _log_path log @@ -7390,6 +7404,10 @@ prepare_ports() { export LOCALBASE=${LOCALBASE:-/usr/local} clean_build_queue + if was_a_bulk_run && [ "${resuming_build}" -eq 0 ]; then + # Update again after trimming the build queue + update_stats_queued + fi # Call the deadlock code as non-fatal which will check for cycles msg "Sanity checking build queue" @@ -7398,17 +7416,6 @@ prepare_ports() { if was_a_bulk_run; then if [ "${resuming_build}" -eq 0 ]; then - nbq=$(pkgqueue_list | wc -l) - # Need to add in pre-build ignored/skipped - _bget nbi stats_ignored || nbi=0 - _bget nbs stats_skipped || nbs=0 - nbq=$((nbq + nbi + nbs)) - - # Add 1 for the main port to test - was_a_testport_run && \ - nbq=$((${nbq} + 1)) - bset stats_queued ${nbq##* } - # Generate ports.queued list after the queue was # trimmed. local _originspec _pkgname _rdep _ignore tmp @@ -7535,11 +7542,7 @@ balance_pool() { return 0 fi - if [ -n "${MY_JOBID}" ]; then - bset ${MY_JOBID} status "balancing_pool:" - else - bset status "balancing_pool:" - fi + bset ${MY_JOBID} status "balancing_pool:" # For everything ready-to-build... for pkg_dir in pool/unbalanced/*; do diff --git a/src/share/poudriere/include/display.sh b/src/share/poudriere/include/display.sh index 9450390b..97e1e68d 100644 --- a/src/share/poudriere/include/display.sh +++ b/src/share/poudriere/include/display.sh @@ -64,7 +64,7 @@ display_output() { format="${_DISPLAY_FORMAT}" # Determine optimal format - while read line; do + while mapfile_read_loop_redir line; do eval "set -- ${line}" cnt=0 for arg in "$@"; do @@ -109,7 +109,8 @@ display_output() { # Sort as configured in display_setup() echo "${_DISPLAY_DATA}" | tail -n +2 | \ - sort ${_DISPLAY_COLUMN_SORT} | while read line; do + sort ${_DISPLAY_COLUMN_SORT} | \ + while mapfile_read_loop_redir line; do eval "set -- ${line}" printf "${format}\n" "$@" done diff --git a/src/share/poudriere/include/fs.sh b/src/share/poudriere/include/fs.sh index fe09b0e8..9facc3c1 100644 --- a/src/share/poudriere/include/fs.sh +++ b/src/share/poudriere/include/fs.sh @@ -155,7 +155,7 @@ findmounts() { mount | awk -v mnt="${mnt}${pattern}" '$3 ~ mnt {print $1 " " $3}' | \ sort -r -k 2 | \ - while read dev pt; do + while mapfile_read_loop_redir dev pt; do if [ "${dev#/dev/md*}" != "${dev}" ]; then umount ${UMOUNT_NONBUSY} "${pt}" || \ umount -f "${pt}" || : @@ -275,11 +275,12 @@ clonefs() { [ ${TMPFS_ALL} -eq 1 ] && mnt_tmpfs all "${mnt}" if [ "${snap}" = "clean" ]; then skippaths="$(nullfs_paths "${mnt}")" + skippaths="${skippaths} /proc" skippaths="${skippaths} /usr/src" skippaths="${skippaths} /usr/lib/debug" skippaths="${skippaths} /var/db/etcupdate" skippaths="${skippaths} /var/db/freebsd-update" - while read basepath dirs; do + while mapfile_read_loop_redir basepath dirs; do cpignore="${from}${basepath%/}/.cpignore" for dir in ${dirs}; do echo "${dir}" diff --git a/src/share/poudriere/include/hash.sh b/src/share/poudriere/include/hash.sh index 2afd6e01..6d5e6231 100644 --- a/src/share/poudriere/include/hash.sh +++ b/src/share/poudriere/include/hash.sh @@ -38,10 +38,12 @@ fi # Based on Shell Scripting Recipes - Chris F.A. Johnson (c) 2005 # Replace a pattern without needing a subshell/exec _gsub() { - [ $# -ne 3 ] && eargs _gsub string pattern replacement + [ $# -eq 3 -o $# -eq 4 ] || eargs _gsub string pattern replacement \ + var_return local string="$1" local pattern="$2" local replacement="$3" + local var_return="${4:-_gsub}" local result_l= result_r="${string}" while :; do @@ -56,7 +58,7 @@ _gsub() { esac done - _gsub="${result_l}${result_r}" + setvar "${var_return}" "${result_l}${result_r}" } if ! type _gsub_var_name 2>/dev/null >&2; then @@ -75,7 +77,9 @@ gsub() { local _gsub _gsub "$@" - echo "${_gsub}" + if [ $# -ne 4 ]; then + echo "${_gsub}" + fi } _hash_var_name() { diff --git a/src/share/poudriere/jail.sh b/src/share/poudriere/jail.sh index 438a18c6..6a8269e7 100755 --- a/src/share/poudriere/jail.sh +++ b/src/share/poudriere/jail.sh @@ -71,7 +71,7 @@ Options: Will only be used if -m is svn*. Options for -d: - -C clean -- Clean remaining data existing in pourdiere data folder. + -C clean -- Clean remaining data existing in poudriere data folder. See poudriere(8) for more details. Can be one of: all, cache, logs, packages, wrkdirs Options for -s and -k: @@ -173,8 +173,12 @@ cleanup_new_jail() { update_version() { local version_extra="$1" - eval `grep "^[RB][A-Z]*=" ${SRC_BASE}/sys/conf/newvers.sh ` - RELEASE=${REVISION}-${BRANCH} + if [ -r "${SRC_BASE}/sys/conf/newvers.sh" ]; then + eval `grep "^[RB][A-Z]*=" ${SRC_BASE}/sys/conf/newvers.sh ` + RELEASE=${REVISION}-${BRANCH} + else + RELEASE=$(jget ${JAILNAME} version) + fi [ -n "${version_extra}" ] && RELEASE="${RELEASE} ${version_extra}" jset ${JAILNAME} version "${RELEASE}" @@ -361,17 +365,17 @@ installworld() { msg "Starting make installworld" ${MAKE_CMD} -C "${SRC_BASE}" ${make_jobs} installworld \ - DESTDIR=${destdir} DB_FROM_SRC=1 || \ + DESTDIR=${destdir} DB_FROM_SRC=1 ${MAKEWORLDARGS} || \ err 1 "Failed to 'make installworld'" ${MAKE_CMD} -C "${SRC_BASE}" ${make_jobs} DESTDIR=${destdir} \ - DB_FROM_SRC=1 distrib-dirs || \ + DB_FROM_SRC=1 distrib-dirs ${MAKEWORLDARGS} || \ err 1 "Failed to 'make distrib-dirs'" ${MAKE_CMD} -C "${SRC_BASE}" ${make_jobs} DESTDIR=${destdir} \ - distribution || err 1 "Failed to 'make distribution'" + distribution ${MAKEWORLDARGS} || err 1 "Failed to 'make distribution'" if [ -n "${KERNEL}" ]; then msg "Starting make installkernel" ${MAKE_CMD} -C "${SRC_BASE}" ${make_jobs} installkernel \ - KERNCONF=${KERNEL} DESTDIR=${destdir} || \ + KERNCONF=${KERNEL} DESTDIR=${destdir} ${MAKEWORLDARGS} || \ err 1 "Failed to 'make installkernel'" fi @@ -619,7 +623,7 @@ install_from_ftp() { esac DISTS="${DISTS} base games" - [ -z "${SRCPATH}" ] && DISTS="${DISTS} src" + [ -z "${SRCPATH}" -a "${NO_SRC:-no}" = "no" ] && DISTS="${DISTS} src" DISTS="${DISTS} ${EXTRA_DISTS}" case "${V}" in @@ -726,7 +730,8 @@ install_from_ftp() { fetch_file ${JAILMNT}/fromftp/MANIFEST ${URL}/MANIFEST fi - DISTS="${DISTS} lib32" + [ "${NO_LIB32:-no}" = "no" ] && + DISTS="${DISTS} lib32" [ -n "${KERNEL}" ] && DISTS="${DISTS} kernel" [ -s "${JAILMNT}/fromftp/MANIFEST" ] || err 1 "Empty MANIFEST file." for dist in ${DISTS}; do @@ -967,7 +972,7 @@ info_jail() { if [ -n "${timestamp}" ]; then echo "Jail updated: $(date -j -r ${timestamp} "+%Y-%m-%d %H:%M:%S")" fi - if porttree_exists ${PTNAME}; then + if [ "${PTNAME_ARG:-0}" -eq 1 ] && porttree_exists ${PTNAME}; then _pget pmethod ${PTNAME} method echo "Tree name: ${PTNAME}" echo "Tree method: ${pmethod:--}" @@ -1076,6 +1081,7 @@ while getopts "biJ:j:v:a:z:m:nf:M:sdkK:lqcip:r:uU:t:z:P:S:DxC:" FLAG; do ;; p) PTNAME=${OPTARG} + PTNAME_ARG=1 ;; P) [ -r ${OPTARG} ] || err 1 "No such patch" @@ -1225,6 +1231,7 @@ case "${CREATE}${INFO}${LIST}${STOP}${START}${DELETE}${UPDATE}${RENAME}" in ;; 00000100) [ -z "${JAILNAME}" ] && usage JAILNAME + jail_exists ${JAILNAME} || err 1 "No such jail: ${JAILNAME}" confirm_if_tty "Are you sure you want to delete the jail?" || \ err 1 "Not deleting jail" maybe_run_queued "${saved_argv}" diff --git a/src/share/poudriere/pkgclean.sh b/src/share/poudriere/pkgclean.sh index 3a71279c..5ddfab14 100755 --- a/src/share/poudriere/pkgclean.sh +++ b/src/share/poudriere/pkgclean.sh @@ -229,7 +229,7 @@ END { if (origin_count[pkgbase] > 1) print origins[pkgbase],packages[pkgbase] } -' | while read origin packages; do +' | while mapfile_read_loop_redir origin packages; do lastpkg= lastver=0 for pkg in $packages; do diff --git a/src/share/poudriere/testport.sh b/src/share/poudriere/testport.sh index 11063231..e7c3ff6d 100755 --- a/src/share/poudriere/testport.sh +++ b/src/share/poudriere/testport.sh @@ -340,6 +340,7 @@ if [ ${ret} -ne 0 ]; then bset_job_status "failed/${failed_phase}" "${ORIGINSPEC}" \ "${PKGNAME}" msg_error "Build failed in phase: ${COLOR_PHASE}${failed_phase}${COLOR_RESET}" + show_log_info set +e exit 1 fi @@ -366,6 +367,7 @@ if [ ${INTERACTIVE_MODE} -gt 0 ]; then bset_job_status "failed/${failed_phase}" \ "${ORIGINSPEC}" "${PKGNAME}" msg_error "Build failed in phase: ${COLOR_PHASE}${failed_phase}${COLOR_RESET}" + show_log_info set +e exit 1 fi diff --git a/test/Makefile b/test/Makefile index f298c61e..d018b8bc 100644 --- a/test/Makefile +++ b/test/Makefile @@ -41,12 +41,16 @@ TESTS=\ bulk-flavor-metadata-queue-ordering-multi-pass.sh \ bulk-flavor-ignore-all.sh -all: check check-stock +all: prep check check-stock -check: .PHONY +prep: .PHONY + @echo "Prepping test jail" + @sh prep.sh + +check: .PHONY prep @echo "Running tests against modified sh" @sh runtests.sh sh ${TESTS} -check-stock: .PHONY +check-stock: .PHONY prep @echo "Running tests against stock /bin/sh" @sh runtests.sh /bin/sh ${TESTS} diff --git a/test/common.bulk.sh b/test/common.bulk.sh index 2c87150f..6e3b8c17 100644 --- a/test/common.bulk.sh +++ b/test/common.bulk.sh @@ -357,10 +357,6 @@ INJAIL_HOST=1 . common.sh -if [ ${ALL:-0} -eq 0 ]; then - assert_not "" "${LISTPORTS}" "LISTPORTS empty" -fi - SUDO= if [ $(id -u) -ne 0 ]; then if ! which sudo >/dev/null 2>&1; then @@ -371,10 +367,10 @@ if [ $(id -u) -ne 0 ]; then fi : ${BUILDNAME:=${0%.sh}} -POUDRIERE="${POUDRIEREPATH} -e /usr/local/etc" +POUDRIERE="${POUDRIEREPATH} -e ${THISDIR}/etc" ARCH=$(uname -p) -JAILNAME="poudriere-10${ARCH}" -JAIL_VERSION="10.3-RELEASE" +JAILNAME="poudriere-test-${ARCH}$(echo "${THISDIR}" | tr '/' '_')" +JAIL_VERSION="11.3-RELEASE" JAILMNT=$(${POUDRIERE} api "jget ${JAILNAME} mnt" || echo) export UNAME_r=$(freebsd-version) export UNAME_v="FreeBSD $(freebsd-version)" @@ -393,12 +389,18 @@ if [ -z "${JAILMNT}" ]; then echo "Done setting up test jail" >&2 echo >&2 fi +if [ ${BOOTSTRAP_ONLY:-0} -eq 1 ]; then + exit 0 +fi + +if [ ${ALL:-0} -eq 0 ]; then + assert_not "" "${LISTPORTS}" "LISTPORTS empty" +fi . ${SCRIPTPREFIX}/common.sh : ${PORTSDIR:=${THISDIR}/../test-ports} PTMNT="${PORTSDIR}" -: ${JAILNAME:=bulk} : ${PTNAME:=test} : ${SETNAME:=} export PORT_DBDIR=/dev/null @@ -412,13 +414,6 @@ set -e pset "${PTNAME}" mnt "${PTMNT}" pset "${PTNAME}" method "-" -# Import jail -jset "${JAILNAME}" version "${JAIL_VERSION}" -jset "${JAILNAME}" timestamp $(clock -epoch) -jset "${JAILNAME}" arch "${ARCH}" -jset "${JAILNAME}" mnt "${JAILMNT}" -jset "${JAILNAME}" method "null" - MASTERNAME=${JAILNAME}-${PTNAME}${SETNAME:+-${SETNAME}} _mastermnt MASTERMNT export POUDRIERE_BUILD_TYPE=bulk diff --git a/test/common.sh b/test/common.sh index 2dc537df..ba1337c2 100644 --- a/test/common.sh +++ b/test/common.sh @@ -24,6 +24,9 @@ USE_FDESCFS=no NOLINUX=yes ${FLAVOR_DEFAULT_ALL:+FLAVOR_DEFAULT_ALL=${FLAVOR_DEFAULT_ALL}} ${FLAVOR_ALL:+FLAVOR_ALL=${FLAVOR_ALL}} +# jail -c options +NO_LIB32=yes +NO_SRC=yes EOF : ${VERBOSE:=1} diff --git a/test/prep.sh b/test/prep.sh new file mode 100644 index 00000000..ff6292ee --- /dev/null +++ b/test/prep.sh @@ -0,0 +1,3 @@ +#! /bin/sh +BOOTSTRAP_ONLY=1 +. common.bulk.sh |