#!/usr/bin/env bash # Offline APT repository intake. # # Validate reviewed Debian packages and copy them into # provisioning/offline-repo/packages/ so that they can be committed to git. The # repository owner runs this on an Ubuntu machine; the device that later # installs from the bundle never downloads anything. # # Guarantees: # * nothing is downloaded and nothing is resolved from a remote source, # * a file that is not a readable Debian binary package is refused, # * a package for a foreign architecture is refused (the target is amd64, # packages marked "all" are accepted), # * a second version of a package that is already accepted is refused instead # of silently overwritten: manifests/*.txt pin exactly one version, # * manifests/*.txt is never edited here. For every pin that still reads the # UNPINNED sentinel the exact replacement line is printed for the owner. # # --check performs the same validation without copying anything. # # User-facing output is Turkish; code and comments are English. set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" PACKAGES_DIR="$SCRIPT_DIR/packages" TARGET_ARCH='amd64' ALLOWED_ARCH_RE='^(amd64|all)$' PACKAGE_NAME_RE='^[a-z0-9][a-z0-9+.-]*$' PIN_RE='^[a-z0-9][a-z0-9+.-]*=[^[:space:]]+$' UNPINNED='UNPINNED' usage() { cat <<'EOF' Kullanım: add-packages.sh [seçenekler] [ ...] add-packages.sh --from DIZIN [--manifest DOSYA] İncelenmiş .deb dosyalarını provisioning/offline-repo/packages/ altına ekler. Hiçbir indirme yapmaz: dosyaları siz verirsiniz, bu araç yalnızca doğrular. Seçenekler: --from DIZIN DIZIN içindeki tüm *.deb dosyalarını aday olarak alır --manifest DOSYA Yalnızca bu manifestteki pinlere uyan adayları ekler (birden fazla --manifest verilebilir) --include-all --manifest ile birlikte: pin dışı adayları da ekler (bağımlılık paketleri için gerekir) --packages DIZIN Hedef dizin (varsayılan: