scripts/packagesystem: cleanup, make `set -e`-safe, fix logger usage (try-done imbalance).