diff --git a/.github/scripts/generate-pr-plugin.sh b/.github/scripts/generate-pr-plugin.sh index 4ca8f27a6..cc9e6d5cf 100755 --- a/.github/scripts/generate-pr-plugin.sh +++ b/.github/scripts/generate-pr-plugin.sh @@ -94,14 +94,19 @@ TARBALL="/boot/config/plugins/&name;/&tarball;" MANIFEST="/boot/config/plugins/&name;/installed_files.txt" echo "Starting file deployment..." +echo "Tarball: $TARBALL" +echo "Backup directory: $BACKUP_DIR" # Clear manifest > "$MANIFEST" -# Extract and get file list - use a temp file to avoid subshell issues +# Get file list first tar -tzf "$TARBALL" > /tmp/plugin_files.txt -# Process each file +echo "Files in tarball:" +cat /tmp/plugin_files.txt + +# Backup original files BEFORE extraction while IFS= read -r file; do # Skip directories if [[ "$file" == */ ]]; then @@ -112,13 +117,15 @@ while IFS= read -r file; do # So the actual system path is /usr/local/emhttp/... SYSTEM_FILE="/${file}" - # Check if file exists and backup + # Check if file exists and backup the ORIGINAL (before our changes) + echo "Processing file: $file -> $SYSTEM_FILE" if [ -f "$SYSTEM_FILE" ]; then BACKUP_FILE="$BACKUP_DIR/$(echo "$file" | tr '/' '_')" - echo "Backing up: $SYSTEM_FILE" + echo "Backing up original: $SYSTEM_FILE -> $BACKUP_FILE" cp -p "$SYSTEM_FILE" "$BACKUP_FILE" echo "$SYSTEM_FILE|$BACKUP_FILE" >> "$MANIFEST" else + echo "New file: $SYSTEM_FILE" echo "$SYSTEM_FILE|NEW" >> "$MANIFEST" fi done < /tmp/plugin_files.txt diff --git a/.github/workflows/pr-plugin-build.yml b/.github/workflows/pr-plugin-build.yml index 440af4b90..19b382759 100644 --- a/.github/workflows/pr-plugin-build.yml +++ b/.github/workflows/pr-plugin-build.yml @@ -83,11 +83,19 @@ jobs: # Create tarball - consistent filename for updates cd build + echo "Creating tarball with contents:" + find usr/ -type f tar -czf ../webgui-pr-${{ github.event.pull_request.number }}.tar.gz usr/ cd .. # Generate file list for plugin find build/usr/local/emhttp -type f | sed 's|^build||' > file_list.txt + echo "File list for plugin:" + cat file_list.txt + + # Verify tarball contents + echo "Tarball contents:" + tar -tzf webgui-pr-${{ github.event.pull_request.number }}.tar.gz - name: Configure AWS CLI for R2 if: steps.changed-files.outputs.has_changes == 'true'