PVE-mods/build/test/fetch-proxmox-files.sh
Meliox 4f5892071f refactor: move CI test scripts from src/scripts/test/ to build/test/
Test scripts are not installed — they are CI/dev tooling and belong
alongside build/gen-rules.sh. Update workflow references and fix the
SRC_DIR path depth in build/test/test-syntax.sh (../ -> ../..).
2026-08-08 23:37:09 +02:00

28 lines
1.5 KiB
Bash

#!/usr/bin/env bash
# Downloads upstream Proxmox VE packages and extracts all their files to real
# system paths, so the patch engine can be exercised on a plain CI runner.
set -euo pipefail
SUITE="${PVE_SUITE:-trixie}"
WORKDIR="$(mktemp -d)"
trap 'rm -rf "$WORKDIR"' EXIT
echo "[fetch] Configuring Proxmox no-subscription repo ($SUITE)..."
sudo wget -q "https://enterprise.proxmox.com/debian/proxmox-archive-keyring-${SUITE}.gpg" \
-O /usr/share/keyrings/proxmox-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/proxmox-archive-keyring.gpg] http://download.proxmox.com/debian/pve $SUITE pve-no-subscription" \
| sudo tee /etc/apt/sources.list.d/pve-test.list >/dev/null
sudo apt-get update -qq
echo "[fetch] Downloading pve-manager, proxmox-widget-toolkit, pve-yew-mobile-gui, libjson-perl, libpve-common-perl, libclone-perl, liblinux-inotify2-perl, libcommon-sense-perl, libhttp-message-perl, libstring-shellquote-perl, libencode-locale-perl, libdevel-cycle-perl, liburi-perl, libnet-ip-perl, libtimedate-perl and libfilesys-df-perl..."
cd "$WORKDIR"
apt-get download pve-manager proxmox-widget-toolkit pve-yew-mobile-gui libjson-perl libpve-common-perl libclone-perl liblinux-inotify2-perl libcommon-sense-perl libhttp-message-perl libstring-shellquote-perl libencode-locale-perl libdevel-cycle-perl liburi-perl libnet-ip-perl libtimedate-perl libfilesys-df-perl
echo "[fetch] Extracting to system paths..."
for deb in *.deb; do
echo "[fetch] $deb"
sudo dpkg-deb -x "$deb" /
done
echo "[fetch] Done."