工程(ci远端化·修复): 第三轮两根因——SRC_ZIP路径漏v前缀致复用探测落空(下载URL修了路径没跟)+macOS BSD mktemp禁X后带后缀(GNU允许可缀尾,首轮404的字面残留文件致File exists); 三处mktemp模板改尾X形态+脚本头部加字面残留清理+gate_platform同型地雷同修; 全部分支条件已在Mac本机实测(复用命中/mktemp形态/包完整性/目标目录)
This commit is contained in:
1 parent
17352f85b0
commit
c35b0ecf4f
2 files changed
+8
-6
No files matched your search
@@ -42,6 +42,7 @@ while [ $# -gt 0 ]; do
|
||||
*) die "未知参数: $1" ;;
|
||||
esac
|
||||
done
|
||||
rm -f /tmp/godot_mac_XXXXXX.zip /tmp/gdstyle_XXXXXX.tar.gz 2>/dev/null || true # 早期 BSD-mktemp 缺陷的字面残留清理
|
||||
|
||||
# ── 1. 专用账户+密码落盘(自动登录需要密码编码进 /etc/kcpassword,root 600)──
|
||||
if dscl . -read "${CI_HOME}" NFSHomeDirectory >/dev/null 2>&1; then
|
||||
@@ -84,13 +85,13 @@ if /usr/local/bin/godot --version >/dev/null 2>&1 && /usr/local/bin/godot --vers
|
||||
log "Godot ${GODOT_VER} 已在位,跳过"
|
||||
else
|
||||
ZIP=""
|
||||
SRC_ZIP="/Users/${INVOKER}/godot-linux/Godot_${GODOT_VER}-stable_macos.universal.zip"
|
||||
SRC_ZIP="/Users/${INVOKER}/godot-linux/Godot_v${GODOT_VER}-stable_macos.universal.zip"
|
||||
if [ -n "$GODOT_ZIP" ] && [ -s "$GODOT_ZIP" ]; then
|
||||
ZIP="$GODOT_ZIP"; log "使用本地 zip: $ZIP"
|
||||
elif [ -s "$SRC_ZIP" ]; then
|
||||
ZIP="$SRC_ZIP"; log "复用已下载 zip: $ZIP"
|
||||
else
|
||||
ZIP="$(mktemp "${TMPDIR:-/tmp}/godot_mac_XXXXXX.zip")"
|
||||
ZIP="$(mktemp "${TMPDIR:-/tmp}/godot_mac_XXXXXX")" # macOS BSD mktemp 禁 X 后带后缀
|
||||
_ok=0
|
||||
for m in "${MIRRORS[@]}"; do
|
||||
log "下载 Godot(${m:+经 $m})"
|
||||
@@ -115,7 +116,7 @@ fi
|
||||
if /usr/local/bin/gdstyle --version >/dev/null 2>&1; then
|
||||
log "gdstyle 已在位,跳过"
|
||||
else
|
||||
TGZ="$(mktemp "${TMPDIR:-/tmp}/gdstyle_XXXXXX.tar.gz")"
|
||||
TGZ="$(mktemp "${TMPDIR:-/tmp}/gdstyle_XXXXXX")" # macOS BSD mktemp 禁 X 后带后缀
|
||||
SRC_TGZ="/Users/${INVOKER}/godot-linux/gdstyle-x86_64-apple-darwin.tar.gz"
|
||||
if [ -s "$SRC_TGZ" ] && tar -tzf "$SRC_TGZ" >/dev/null 2>&1; then
|
||||
TGZ="$SRC_TGZ"; log "复用已下载 gdstyle 包: $TGZ"
|
||||
|
||||
@@ -58,13 +58,14 @@ gate_run_timeout() {
|
||||
gate_orphans() {
|
||||
local gp="$1"
|
||||
if gate_is_win; then
|
||||
local tmpf
|
||||
tmpf="$(mktemp "${TMPDIR:-/tmp}/gateorph_XXXXXX.ps1")"
|
||||
local tmpd tmpf
|
||||
tmpd="$(mktemp -d "${TMPDIR:-/tmp}/gateorph_XXXXXX")" # macOS BSD mktemp 禁 X 后带后缀(本分支 Windows 专用,模板统一防复用)
|
||||
tmpf="$tmpd/k.ps1"
|
||||
local gp_win
|
||||
gp_win="$(cygpath -m "$gp")"
|
||||
printf "Get-CimInstance Win32_Process -Filter \"Name like 'Godot%%'\" | Where-Object { \$_.CommandLine -like '*%s*' } | ForEach-Object { \$_.ProcessId }\n" "$gp_win" > "$tmpf"
|
||||
powershell -NoProfile -ExecutionPolicy Bypass -File "$(cygpath -w "$tmpf")" 2>/dev/null | tr -d '\r'
|
||||
rm -f "$tmpf"
|
||||
rm -rf "$tmpd"
|
||||
else
|
||||
ps -axo pid=,command= 2>/dev/null | awk -v g="$gp" 'tolower($0) ~ /godot/ && index($0, g) {print $1}'
|
||||
fi
|
||||
|
||||
Reference in new issue
Block a user