diff --git a/ipk-source/sdxpinn-patch/CONTROL/preinst b/ipk-source/sdxpinn-patch/CONTROL/preinst index e5e2529..bf4f19b 100755 --- a/ipk-source/sdxpinn-patch/CONTROL/preinst +++ b/ipk-source/sdxpinn-patch/CONTROL/preinst @@ -2,7 +2,7 @@ clean_distfeeds() { # Define the list of items to comment out - items_to_comment=" + items_to_comment=$(cat <> "$TEMP_FILE" continue 2 fi done - # Check if the line should be uncommented + # Check if the line matches items to keep for item in $items_to_keep; do - if [ "$trimmed_line" = "# $item" ] || [ "$trimmed_line" = "$item" ]; then + if [ "$line" = "$item" ] || [ "$line" = "# $item" ]; then echo "$item" >> "$TEMP_FILE" continue 2 fi done - # Preserve other lines as is - echo "$trimmed_line" >> "$TEMP_FILE" + # Preserve all other lines + echo "$line" >> "$TEMP_FILE" done < "$INPUT_FILE" - # Ensure all items_to_keep are present and uncommented + # Ensure all items_to_keep are present for item in $items_to_keep; do if ! grep -qx "$item" "$TEMP_FILE"; then echo "$item" >> "$TEMP_FILE"