Fix removing old versions

This commit is contained in:
2024-07-11 15:28:21 +02:00
parent b4197b7239
commit 1b1280df1c
2 changed files with 2 additions and 55 deletions

4
run.sh
View File

@@ -11,7 +11,7 @@ ARCHES="${ARCHES:1}"
for i in $FILES; do
for a in "${ARCH[@]}"; do
ls $i-[0-9]*$a.rpm -rv 2> /dev/null | awk 'NR>1' | xargs -d '\n' -r rm -v --
ls $i[-_][0-9]*$a.rpm -rv 2> /dev/null | awk 'NR>1' | xargs -d '\n' -r rm -v --
done
done
@@ -23,4 +23,4 @@ set +f
createrepo -q /data --update
echo 'Finished'
echo 'Finished'

View File

@@ -1,53 +0,0 @@
#!/bin/bash
VERSION=30
ARCH="x86_64"
REPO_DIR=/rpmfusion
MIRROR=(
"rsync://download1.rpmfusion.org/rpmfusion/"
)
for ((i=0; i<${#MIRROR[@]}; i++)); do
rsync --progress -amH --numeric-ids --delete --delete-delay --delay-updates \
--exclude='*/drpms' \
--exclude='*/images' \
--exclude='*/Docker' \
--exclude='*/CloudImages' \
--exclude='*/debug' \
--exclude='*/iso' \
--exclude='*/development'\
--exclude='*/testing'\
--exclude='*/tainted'\
--exclude='*/rpi'\
--exclude='*/steam'\
--exclude='*/nvidia-driver'\
--include="**/${VERSION}/**${ARCH}/***" \
--include='*/' --exclude='*' \
"${MIRROR[i]}" "${REPO_DIR}"
done
find "${REPO_DIR}" -name "*comps-*.xml" -exec sh -c 'cp -av {} "$(dirname {})/../comps.xml"' \;
for i in $(find "${REPO_DIR}" -type d -name 'repodata' -exec dirname '{}' \;); do
createrepo --update --database --deltas -c /cache/rpmfusion -g comps.xml "$i"
done
echo 'Cleaning up Claque...'
cd /data/Packages
FILES="$(rpm -qp --queryformat '%{NAME}\n' *.rpm 2> /dev/null | uniq)"
ARCH=('x86_64' 'i686' 'noarch' 'i386')
for i in $FILES; do
for a in "${ARCH[@]}"; do
ls $i*$a.rpm -rv 2> /dev/null | awk 'NR>1' | xargs -d '\n' -r rm -v --
done
done
dnf download --refresh --best --destdir /data/Packages/ $PACKAGES
createrepo /data --update --verbose --database --deltas -c /cache/claque