This was generated by AI during work-loop execution.
Context
#1510 ("ci: enable staged shell-portability-lint classes") enables two of the three STAGED
shell-portability-lint classes (date -d, stat -c), fixing/annotating every corpus site each
touches. mktemp -p was deliberately left STAGED in that PR: unlike the other two classes, its
corpus (~24 files, ~56 call sites — scripts/shell-portability-tokens.txt's original "roughly 20
sites" estimate undercounted call sites vs. files) is all shared hook-test scaffolding across ~13
different plugins, none with a BSD-portable counterpart today (BSD mktemp has no -p). Migrating
it is a real, mechanical effort that touches every one of those plugins' release surface (a
plugin.json version bump + CHANGELOG entry per touched plugin under this repo's convention) — out
of scope for #1510's PR, which stays to check-shell-portability.sh/shell-portability-tokens.txt
plus the two dual-dialect script fixes.
Proposed work
- Migrate each
mktemp -p "$DIR" prefix.XXXXXX site to the portable
mktemp "$DIR/prefix.XXXXXX" form (works identically on GNU and BSD mktemp — the directory rides
in the template instead of the -p flag).
- Migrate each
mktemp -d -p "$DIR" prefix.XXXXXX site to mktemp -d "$DIR/prefix.XXXXXX".
- Migrate each bare
mktemp -p "$DIR" (no explicit template) site to an explicit-template form,
e.g. mktemp "$DIR/tmp.XXXXXXXXXX" — do not rely on TMPDIR-inheritance semantics, which differ
between GNU and BSD mktemp when no template is given.
- Uncomment the
mktemp -p token in scripts/shell-portability-tokens.txt's ACTIVE section once
the corpus is clean, and update the STAGED section comment to drop the now-resolved entry.
- Run
scripts/check-shell-portability.sh --all after uncommenting and confirm it is clean (or
every remaining hit carries a reviewed portability-ok:).
- Bump
plugin.json's version and add a CHANGELOG entry for every plugin whose test-scaffolding
files are touched.
Acceptance criteria
References
Metadata
| Field |
Value |
| Category |
unspecified |
| Area |
security |
| Ecosystem |
unspecified |
This was generated by AI during work-loop execution.
Context
#1510 ("ci: enable staged shell-portability-lint classes") enables two of the three STAGED
shell-portability-lint classes (
date -d,stat -c), fixing/annotating every corpus site eachtouches.
mktemp -pwas deliberately left STAGED in that PR: unlike the other two classes, itscorpus (~24 files, ~56 call sites —
scripts/shell-portability-tokens.txt's original "roughly 20sites" estimate undercounted call sites vs. files) is all shared hook-test scaffolding across ~13
different plugins, none with a BSD-portable counterpart today (BSD
mktemphas no-p). Migratingit is a real, mechanical effort that touches every one of those plugins' release surface (a
plugin.jsonversion bump + CHANGELOG entry per touched plugin under this repo's convention) — outof scope for #1510's PR, which stays to
check-shell-portability.sh/shell-portability-tokens.txtplus the two dual-dialect script fixes.
Proposed work
mktemp -p "$DIR" prefix.XXXXXXsite to the portablemktemp "$DIR/prefix.XXXXXX"form (works identically on GNU and BSD mktemp — the directory ridesin the template instead of the
-pflag).mktemp -d -p "$DIR" prefix.XXXXXXsite tomktemp -d "$DIR/prefix.XXXXXX".mktemp -p "$DIR"(no explicit template) site to an explicit-template form,e.g.
mktemp "$DIR/tmp.XXXXXXXXXX"— do not rely on TMPDIR-inheritance semantics, which differbetween GNU and BSD mktemp when no template is given.
mktemp -ptoken inscripts/shell-portability-tokens.txt's ACTIVE section oncethe corpus is clean, and update the STAGED section comment to drop the now-resolved entry.
scripts/check-shell-portability.sh --allafter uncommenting and confirm it is clean (orevery remaining hit carries a reviewed
portability-ok:).plugin.json's version and add a CHANGELOG entry for every plugin whose test-scaffoldingfiles are touched.
Acceptance criteria
mktemp -p/mktemp -d -pcall site in the corpus (enumerate fresh viagrep -rn "mktemp[^\n]*-p" --include="*.sh"at execution time — the count above is asnapshot, not a fixed list) is migrated to a portable form, or carries a reviewed
portability-ok:annotation with a stated reason.mktemp -ptoken inscripts/shell-portability-tokens.txtis uncommented (moved to theACTIVE section).
scripts/check-shell-portability.sh --allexits 0 against the full repo.bash scripts/check-shell-portability.test.shstill passes (the staged-classes-inactive testat the bottom of that suite needs updating once all three classes are active).
plugin.jsonversion is bumped with a matching CHANGELOG entry.References
date -d/stat -cclasses; leavesmktemp -pstaged for this item.scripts/shell-portability-tokens.txtSTAGED section — themktemp -pentry this item resolves.Metadata