#!/bin/sh
set -e

SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
PKG_FILE="$SCRIPT_DIR/extra-packages-napic.txt"

if [ ! -f "$PKG_FILE" ]; then
    echo "ERROR: package list not found: $PKG_FILE" >&2
    exit 1
fi

# Read packages: ignore empty lines and comments, join with spaces
EXTRA_PACKAGES="$(sed -e 's/#.*//' -e '/^[[:space:]]*$/d' "$PKG_FILE" | tr '\n' ' ')"

echo "EXTRA_PACKAGES=$EXTRA_PACKAGES"
