Browse Source

templates modpod: build-synced punk-runtime.cmd (toml-aware list -remote era)

Assisted-by: harness=claude; primary-model=claude-fable-5; api-location=anthropic.com
master
Julian Noble 6 days ago
parent
commit
78d21c5de1
  1. 38
      src/modules/punk/mix/#modpod-templates-999999.0a1.0/templates/project_layouts/vendor/punk/project-0.1/bin/punk-runtime.cmd

38
src/modules/punk/mix/#modpod-templates-999999.0a1.0/templates/project_layouts/vendor/punk/project-0.1/bin/punk-runtime.cmd vendored

@ -1747,8 +1747,19 @@ case "$action" in
echo "server default for $archtail: $platform_default"
fi
if [[ -n "$activename" ]]; then
#the default names an immutable -r<N> ARTIFACT while the active is
#typically its materialized WORKING name - the beside-toml's 'name'
#field records which artifact the working copy came from, so match
#on either identity
active_artifact=""
activetoml="$archdir/$(rootname_of "$activename").toml"
if [[ -f "$activetoml" ]]; then
active_artifact=$(sed -n 's/^[[:space:]]*name[[:space:]]*=[[:space:]]*"\(.*\)".*/\1/p' "$activetoml" | head -n 1)
fi
matchnote=""
[[ -n "$platform_default" && "$activename" == "$platform_default" ]] && matchnote=" (= server default)"
if [[ -n "$platform_default" ]] && [[ "$activename" == "$platform_default" || "$active_artifact" == "$platform_default" ]]; then
matchnote=" (= server default)"
fi
echo "active (local): $activename$matchnote"
fi
echo "-----------------------------------------------------------------------"
@ -1775,6 +1786,12 @@ case "$action" in
#mode but bash read does not - without this a locally-present runtime
#also shows as a remote-only row (\r-suffixed name fails the -f test)
tr -d '\r' < "$sha1local" | sed -n 's/^[0-9a-fA-F]\{40\} \*\(.*\)$/\1/p' | LC_ALL=C sort | while IFS= read -r rname; do
#skip support files riding in the server's sha1sums beside the
#runtimes (artifact metadata tomls etc) - same extension set the
#local candidate filter excludes
case "$rname" in
*.txt|*.toml|*.tm|*.tmp|*.log) continue;;
esac
if [[ -n "$rname" && ! -f "$archdir/$rname" ]]; then
annot=""
[[ -n "$platform_default" && "$rname" == "$platform_default" ]] && annot=" (server default)"
@ -3063,8 +3080,20 @@ function psmain {
Write-host "server default for ${arch}: $platform_default"
}
if ($activename -ne "") {
#the default names an immutable -r<N> ARTIFACT while the active
#is typically its materialized WORKING name - the beside-toml's
#'name' field records which artifact the working copy came from,
#so match on either identity
$active_artifact = ""
$activetoml = Join-Path -Path $archfolder -ChildPath ((Get-PunkRuntimeRootName $activename) + ".toml")
if (Test-Path -Path $activetoml -PathType Leaf) {
foreach ($tline in (Get-Content -Path $activetoml)) {
$m = [regex]::Match($tline, '^\s*name\s*=\s*"(.*)"\s*$')
if ($m.Success) { $active_artifact = $m.Groups[1].Value; break }
}
}
$matchnote = ""
if ($platform_default -ne "" -and $activename -eq $platform_default) {
if ($platform_default -ne "" -and ($activename -eq $platform_default -or $active_artifact -eq $platform_default)) {
$matchnote = " (= server default)"
}
Write-host "active (local): $activename$matchnote"
@ -3113,6 +3142,11 @@ function psmain {
[array]::Sort($remotekeys, [System.StringComparer]::Ordinal)
foreach ($key in $remotekeys) {
if (-not ($localdict.ContainsKey($key))) {
#skip support files riding in the server's sha1sums beside
#the runtimes (artifact metadata tomls etc) - same extension
#set the local candidate filter excludes
$rext = [System.IO.Path]::GetExtension($key)
if ($(".txt",".toml",".tm",".tmp",".log") -contains $rext) { continue }
$annot = ""
if ($platform_default -ne "" -and $key -eq $platform_default) { $annot = " (server default)" }
write-host -nonewline " $lhs_missing"

Loading…
Cancel
Save