#!/usr/bin/env bash # Created by John A. Hoeven with the ethical assistance of Claude AI # --------------------------------------------------------------------------- # 10_zypper-packages.sh # /home/john/projects/suse-professional-package-installer/lib/10_zypper-packages.sh # Version: v0.1.0 | Status: DEVELOPMENT # --------------------------------------------------------------------------- # Purpose: Install every package listed in a zypper package-list file. # Target: SUSE family (zypper). # Entry: ./10_zypper-packages.sh [package-list-file] # Depends: ce-common.sh (same directory) # --------------------------------------------------------------------------- _SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)" # shellcheck source=./ce-common.sh source "${_SCRIPT_DIR}/ce-common.sh" _LIST_FILE="${1:-${_SCRIPT_DIR}/../local/zypper.list}" # ── Read list, confirm, detect environment ────────────────────────────── declare -a PACKAGES read_package_list "${_LIST_FILE}" PACKAGES log_info "Package list: ${_LIST_FILE} (${#PACKAGES[@]} entries)" detect_package_manager detect_priv_cmd confirm_proceed "Install ${#PACKAGES[@]} package(s) via zypper: ${PACKAGES[*]}?" # ── Install ─────────────────────────────────────────────────────────────── if install_packages PACKAGES; then log_info "zypper package install complete — no failures" exit 0 else log_error "zypper package install finished with failures — see log above" exit 1 fi