diff options
author | Bryan Drewery <bryan@shatow.net> | 2021-09-09 03:45:41 +0300 |
---|---|---|
committer | Bryan Drewery <bryan@shatow.net> | 2021-09-09 03:53:04 +0300 |
commit | 55c0131db0b1fbcfba039a4e3ccc73f5c2d11ac8 (patch) | |
tree | 5aaab657720553807204903b5a2275f08784dfff /src/share/poudriere | |
parent | 21d509974a031b7b5d9dde62d489ff4d106da82d (diff) |
pkgqueue_compute_rdeps does not need pkg_deps file
Diffstat (limited to 'src/share/poudriere')
-rw-r--r-- | src/share/poudriere/common.sh | 3 | ||||
-rw-r--r-- | src/share/poudriere/include/pkgqueue.sh | 38 |
2 files changed, 24 insertions, 17 deletions
diff --git a/src/share/poudriere/common.sh b/src/share/poudriere/common.sh index cec37ed5..6f64e45a 100644 --- a/src/share/poudriere/common.sh +++ b/src/share/poudriere/common.sh @@ -6976,7 +6976,8 @@ compute_deps() { sort -u "pkg_deps.unsorted" > "pkg_deps" unlink "pkg_deps.unsorted" - pkgqueue_compute_rdeps "pkg_deps" + bset status "computingrdeps:" + pkgqueue_compute_rdeps find deps rdeps > "pkg_pool" run_hook compute_deps stop diff --git a/src/share/poudriere/include/pkgqueue.sh b/src/share/poudriere/include/pkgqueue.sh index 94a213d5..47551175 100644 --- a/src/share/poudriere/include/pkgqueue.sh +++ b/src/share/poudriere/include/pkgqueue.sh @@ -281,30 +281,36 @@ pkgqueue_remove_many_pipe() { done | xargs rm -rf } +_pkgqueue_compute_rdeps() { + [ "${PWD}" = "${MASTERMNT}/.p" ] || \ + err 1 "_pkgqueue_compute_rdeps requires PWD=${MASTERMNT}/.p" + [ $# -eq 0 ] || eargs _pkgqueue_compute_rdeps + local rdep_dir_name job dep_job + + find deps -mindepth 3 -maxdepth 3 -type f | + sed -e 's,deps/,,' | + cut -d / -f 2- | + awk -F/ '{print $1, $2}' | + while mapfile_read_loop_redir job dep_job; do + pkgqueue_dir rdep_dir_name "${dep_job}" + echo "${rdep_dir_name}/${job}" + done +} + # Compute back references for quickly finding things to skip if this job # fails. pkgqueue_compute_rdeps() { [ "${PWD}" = "${MASTERMNT}/.p" ] || \ err 1 "pkgqueue_compute_rdeps requires PWD=${MASTERMNT}/.p" - [ $# -eq 1 ] || eargs pkgqueue_compute_rdeps pkg_deps - local pkg_deps="$1" + [ $# -eq 0 ] || eargs pkgqueue_compute_rdeps local job rdep_dir_name dep - bset status "computingrdeps:" # cd into rdeps to allow xargs mkdir to have more args. - ( - cd "rdeps" - awk '{print $2}' "../${pkg_deps}" | sort -u | \ - while mapfile_read_loop_redir job; do - pkgqueue_dir rdep_dir_name "${job}" - echo "${rdep_dir_name}" - done | xargs mkdir -p - awk '{print $2 " " $1}' "../${pkg_deps}" | \ - while mapfile_read_loop_redir job dep; do - pkgqueue_dir rdep_dir_name "${job}" - echo "${rdep_dir_name}/${dep}" - done | xargs touch - ) + _pkgqueue_compute_rdeps | + sed -e 's,/[^/]*$,,' | + ( cd rdeps && xargs mkdir -p ) + _pkgqueue_compute_rdeps | + ( cd rdeps && xargs touch ) } pkgqueue_remaining() { |