Skip to content

Commit 347c500

Browse files
committed
version_sources: unique temp dir per html_listing call
shvr_versions_from_html_listing wrote its temp files to ${TMPDIR}/shvr_html_listing.$$, but $$ is the main shell's PID — identical in every nested subshell call. shvr_update_bash is the only updater that nests the helper (it streams the baseline listing while calling the helper again per baseline to scrape that baseline's -patches/ dir). The inner call clobbered the outer's temp files, so patch discovery returned empty and every bash baseline composed to "<baseline>.0". Since that is below the committed patch level, the series-filter merge kept the old version — `update` reported "no changes" and bash was frozen (stuck at 5.3.9 with 5.3.15 available). Give each call its own `mktemp -d` directory so nested calls can't collide.
1 parent 95d8592 commit 347c500

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

common/version_sources/html_listing.sh

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,17 @@ shvr_versions_from_html_listing ()
2626
url="$1"
2727
regex="$2"
2828

29-
base="${TMPDIR:-/tmp}/shvr_html_listing.$$"
30-
raw="${base}.raw"
31-
err="${base}.err"
32-
out="${base}.out"
33-
trap 'rm -f "$raw" "$err" "$out"' EXIT INT TERM
29+
# A unique temp dir per call: $$ is the (shared) main-shell PID even inside this
30+
# subshell function, so the previous "$$"-based paths collided when one call
31+
# nested inside another — e.g. shvr_update_bash streams the baseline listing
32+
# while calling this helper again per baseline to scrape its -patches/ dir. The
33+
# inner call clobbered the outer's temp files, so patch discovery returned empty
34+
# and every bash baseline composed to "<baseline>.0", freezing updates.
35+
base="$(mktemp -d "${TMPDIR:-/tmp}/shvr_html_listing.XXXXXX")"
36+
raw="${base}/raw"
37+
err="${base}/err"
38+
out="${base}/out"
39+
trap 'rm -rf "$base"' EXIT INT TERM
3440

3541
if ! curl -fsSL "$url" > "$raw" 2> "$err"
3642
then

0 commit comments

Comments
 (0)