update_repo: Support multiple distros

This commit is contained in:
Albert S. 2022-06-06 17:15:21 +02:00
parent fa38977813
commit eb3d11895e

View File

@ -3,12 +3,19 @@ set -u
source ./CONFIG
mkdir -p repo/dists
mkdir -p repo/pool
mkdir -p repo/dists/default/main/binary-amd64/
mkdir -p repo/dists/impish/main/binary-amd64/
mkdir -p repo/dists/jammy/main/binary-amd64/
cd repo
dpkg-scanpackages -a amd64 pool > ./dists/default/main/binary-amd64/Packages
cd dists/default/
apt-ftparchive -c ../../../repo.conf release . > Release
for distro in $(ls dists) ; do
dpkg-scanpackages -a amd64 pool/$distro > ./dists/$distro/main/binary-amd64/Packages
cd dists/$distro
apt-ftparchive -c ../../../repo.$distro.conf release . > Release
gpg -a --yes --clearsign --output InRelease --local-user "$SIGNING_KEY_EMAIL" --detach-sign Release
cd ../../../
cd ../../
done
cd ..
echo "Press key to upload"
read
rsync -aAXPv --delete repo/ "$TARGET_SERVER":"$TARGET_PATH"
ssh "$TARGET_SERVER" chown -R "$TARGET_OWNER" "$TARGET_PATH"