diff options
author | Bryan Drewery <bryan@shatow.net> | 2022-09-16 07:49:40 +0300 |
---|---|---|
committer | Bryan Drewery <bryan@shatow.net> | 2022-09-16 07:52:43 +0300 |
commit | 083cafbdb6d8b7338884daab1dcada6886bff49c (patch) | |
tree | 5fbf17b60902a344657bb34b449b7bbace08a79f | |
parent | 6d68c64c288fc738f020d5f8e89ab79f70b7fe74 (diff) |
Use sort -o to allow vfork in some cases.
Redirections prevent sh from using vfork.
-rwxr-xr-x | src/share/poudriere/common.sh | 8 | ||||
-rwxr-xr-x | src/share/poudriere/distclean.sh | 4 | ||||
-rw-r--r-- | src/share/poudriere/include/pkgqueue.sh | 4 |
3 files changed, 8 insertions, 8 deletions
diff --git a/src/share/poudriere/common.sh b/src/share/poudriere/common.sh index 27957ca1..2a736ceb 100755 --- a/src/share/poudriere/common.sh +++ b/src/share/poudriere/common.sh @@ -4549,9 +4549,9 @@ build_port() { done fi - sort ${add} > ${add1} - sort ${del} > ${del1} - sort ${mod} > ${mod1} + sort "${add}" -o "${add1}" + sort "${del}" -o "${del1}" + sort "${mod}" -o "${mod1}" comm -12 ${add1} ${del1} >> ${mod1} comm -23 ${add1} ${del1} > ${add} comm -13 ${add1} ${del1} > ${del} @@ -7270,7 +7270,7 @@ compute_deps() { fi sort -u "${MASTER_DATADIR}/pkg_deps.unsorted" \ - > "${MASTER_DATADIR}/pkg_deps" + -o "${MASTER_DATADIR}/pkg_deps" unlink "${MASTER_DATADIR}/pkg_deps.unsorted" bset status "computingrdeps:" diff --git a/src/share/poudriere/distclean.sh b/src/share/poudriere/distclean.sh index 3057ba17..8a78c9e5 100755 --- a/src/share/poudriere/distclean.sh +++ b/src/share/poudriere/distclean.sh @@ -173,7 +173,7 @@ for PTNAME in ${PTNAMES}; do done # Remove duplicates -sort -u ${DISTFILES_LIST} > ${DISTFILES_LIST}.expected +sort -u "${DISTFILES_LIST}" -o "${DISTFILES_LIST}.expected" # Gather list of actual files msg "Gathering list of actual distfiles" @@ -181,7 +181,7 @@ msg "Gathering list of actual distfiles" [ -n "${DISTFILES_CACHE}" ] || err 1 "DISTFILES_CACHE must be set (cf. poudriere.conf)" find -x ${DISTFILES_CACHE}/ -type f ! -name '.*' | \ - sort > ${DISTFILES_LIST}.actual + sort -o "${DISTFILES_LIST}.actual" comm -1 -3 ${DISTFILES_LIST}.expected ${DISTFILES_LIST}.actual \ > ${DISTFILES_LIST}.unexpected diff --git a/src/share/poudriere/include/pkgqueue.sh b/src/share/poudriere/include/pkgqueue.sh index db8ce4bc..8ca42d77 100644 --- a/src/share/poudriere/include/pkgqueue.sh +++ b/src/share/poudriere/include/pkgqueue.sh @@ -453,7 +453,7 @@ pkgqueue_find_dead_packages() { dead_top=$(mktemp -t dead_packages.top) find deps -mindepth 2 > "${dead_all}" # All packages in the queue - cut -d / -f 3 "${dead_all}" | sort -u > "${dead_top}" + cut -d / -f 3 "${dead_all}" | sort -u -o "${dead_top}" # All packages with dependencies cut -d / -f 4 "${dead_all}" | sort -u | sed -e '/^$/d' > "${dead_deps}" # Find all packages only listed as dependencies (not in queue) @@ -535,7 +535,7 @@ pkgqueue_trim_orphaned_build_deps() { fi done } | pkgqueue_list_deps_pipe > "${tmp}" - pkgqueue_list | sort > "${tmp}.actual" + pkgqueue_list | sort -o "${tmp}.actual" comm -13 "${tmp}" "${tmp}.actual" | pkgqueue_remove_many_pipe rm -f "${tmp}" "${tmp}.actual" } |