arch-repo-test/download-packages.sh
2026-03-01 19:39:56 +01:00

30 lines
No EOL
532 B
Bash
Executable file

#!/bin/bash
rm -f ./repo/*
rm -rf ./packages
mkdir -p ./packages
BASE_DIR=$(realpath .)
REPO_DIR="$(realpath repo)"
PKG_DIR="$(realpath packages)"
cd $PKG_DIR
while read -u 10 p; do
GIT_URL=$p
GIT_FILE=$(basename $GIT_URL)
REPO_NAME=${GIT_FILE%.*}
git clone $GIT_URL
cd $REPO_NAME
makepkg -r --sign
PKG_FILES=(*.pkg*)
mv *.tar.zst $REPO_DIR
mv *.tar.zst.sig $REPO_DIR
repo-add -n "$REPO_DIR/repo.db.tar.zst" "$REPO_DIR/${PKG_FILES[0]}"
cd ../
done 10<"$BASE_DIR/target-pkgs.list"