Skip to content

Commit 5277b6e

Browse files
Fix stage_for_s3.bash file processing issues
- Remove fibers-5.0.4.tar.gz after extraction to avoid double-processing - Use find pattern 'linux-*.gz' instead of '*.gz' for fibers binaries - Fix regex to match any suffix after arch (not just -pc) - Add conditional check for usr/local before flattening directory Co-Authored-By: Claude (global.anthropic.claude-opus-4-5-20251101-v1:0) <noreply@anthropic.com>
1 parent 2507d56 commit 5277b6e

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

stage_for_s3.bash

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ fi
6060
echo "✓ Downloaded fibers-5.0.4.tar.gz"
6161

6262
tar -xzf fibers-5.0.4.tar.gz
63+
rm fibers-5.0.4.tar.gz
6364

6465
if [[ ! -d package ]]; then
6566
echo "ERROR: fibers tarball did not contain expected 'package' directory" >&2
@@ -68,7 +69,8 @@ fi
6869

6970
echo ""
7071
echo "=== Extracting fibers binaries into package ==="
71-
find . -name "*.gz" | while read -r a
72+
# Only extract linux fibers binaries (not all .gz files)
73+
find . -name "linux-*.gz" | while read -r a
7274
do
7375
echo " Extracting: $a"
7476
tar -xzf "$a" -C package/bin
@@ -94,7 +96,7 @@ for file in *.tar.xz; do
9496
echo "Renaming: $file -> $new_name"
9597
mv "$file" "$new_name"
9698

97-
if [[ "$new_name" =~ node-v([0-9.]+)-(darwin|linux)-(arm64|x64)-pc.*\.tar\.xz$ ]]; then
99+
if [[ "$new_name" =~ node-v([0-9.]+)-(darwin|linux)-(arm64|x64).*\.tar\.xz$ ]]; then
98100
version="${BASH_REMATCH[1]}"
99101
os="${BASH_REMATCH[2]}"
100102
arch="${BASH_REMATCH[3]}"
@@ -103,8 +105,12 @@ for file in *.tar.xz; do
103105
echo "Target Dir: $target_dir"
104106
mkdir "$target_dir"
105107
tar -xJf "$new_name" -C "$target_dir"
106-
mv "$target_dir/usr/local/"* "$target_dir/"
107-
rm -fr "$target_dir/usr"
108+
109+
# Flatten directory structure if needed (handle both usr/local and direct layouts)
110+
if [ -d "$target_dir/usr/local" ]; then
111+
mv "$target_dir/usr/local/"* "$target_dir/"
112+
rm -rf "$target_dir/usr"
113+
fi
108114

109115
tar -cJf "$new_name" "$target_dir"
110116

0 commit comments

Comments
 (0)