diff options
author | Bryan Drewery <bryan@shatow.net> | 2021-09-03 22:58:13 +0300 |
---|---|---|
committer | Bryan Drewery <bryan@shatow.net> | 2021-09-04 22:18:23 +0300 |
commit | 868b43b9cd805323afe7aae60f26c36910fe9586 (patch) | |
tree | 94f995ea6e06adb7cda62a2d665488dae96b5f19 /src | |
parent | 14d46f876b9d78711129cfc245080bd3056610a4 (diff) |
Fix race with distfile fetch saving
This is more noticeable with FLAVORS.
Fixes #758
Diffstat (limited to 'src')
-rw-r--r-- | src/share/poudriere/common.sh | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/share/poudriere/common.sh b/src/share/poudriere/common.sh index cf8312e9..5e686997 100644 --- a/src/share/poudriere/common.sh +++ b/src/share/poudriere/common.sh @@ -3911,9 +3911,25 @@ gather_distfiles() { shash_get pkgname-depend_specials "${pkgname}" specials || specials= job_msg_dev "${COLOR_PORT}${origin}${flavor:+@${flavor}} | ${pkgname_main}${COLOR_RESET}: distfiles ${from} -> ${to}" + mkdir -p "${to}/${sub}" + ( + cd "${to}/${sub}" + for d in ${dists}; do + case "${d}" in + */*) ;; + *) continue ;; + esac + echo "${d%/*}" + done | sort -u | xargs mkdir -p + ) for d in ${dists}; do - [ -f ${from}/${sub}/${d} ] || continue - do_clone "${from}/${sub}/${d}" "${to}/${sub}/${d}" || return 1 + if [ ! -f "${from}/${sub}/${d}" ]; then + continue + fi + # XXX: A --relative would be nice + install -pS -m 0644 "${from}/${sub}/${d}" \ + "${to}/${sub}/${d}" || + return 1 done for special in ${specials}; do |