aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Terjan <pterjan@mageia.org>2018-01-11 23:11:52 +0000
committerPascal Terjan <pterjan@mageia.org>2018-01-11 23:11:52 +0000
commited5d52a600507ff3e3e32b7595466685bbda52eb (patch)
treef010631cef6f7fb17976b9ce8ed6052e002ab76b
parentd4d159dc5add522fdf1869562198319e94383724 (diff)
downloadiurt-ed5d52a600507ff3e3e32b7595466685bbda52eb.tar
iurt-ed5d52a600507ff3e3e32b7595466685bbda52eb.tar.gz
iurt-ed5d52a600507ff3e3e32b7595466685bbda52eb.tar.bz2
iurt-ed5d52a600507ff3e3e32b7595466685bbda52eb.tar.xz
iurt-ed5d52a600507ff3e3e32b7595466685bbda52eb.zip
Kill iurt_cache_cleaner.sh
Cache support was removed
-rwxr-xr-xiurt_cache_cleaner.sh130
1 files changed, 0 insertions, 130 deletions
diff --git a/iurt_cache_cleaner.sh b/iurt_cache_cleaner.sh
deleted file mode 100755
index d31e950..0000000
--- a/iurt_cache_cleaner.sh
+++ /dev/null
@@ -1,130 +0,0 @@
-#!/bin/bash
-#
-# Marcelo Ricardo Leitner - Properly clean Iurt cache pool - 20070615
-#
-
-# Cache topdir
-TOPDIR=/export/home/iurt_cache/
-
-# Official distros topdir
-OFFICIAL_DIR=/mnt/BIG/dis/
-
-# Maximum number of days a package is allowed to be in the cache
-AGE=4
-
-# Email to be notified about wrong uploads
-MAILTO=distrib-admin@mandrivalinux.org
-
-
-#
-# Remove all packages generated by a given .src.rpm
-#
-function clean_package() {
- distro="$1"
- section="$2"
- srpm="$3"
-
- echo -e "Cleaning all packages generated by\n $srpm."
- find "$TOPDIR/$distro/$section" -name '*.rpm' ! -name '*.src.rpm' |\
- xargs rpm -qp --qf '%{SOURCERPM} %{name}-%{version}-%{release}.%{arch}.rpm\n' |\
- sed -n "s@^$srpm @$TOPDIR/$distro/$section/@p;" |\
- xargs rm -fv "$TOPDIR/$distro/$section/$srpm"
-
- find "$TOPDIR/$distro/debug_$section" -name '*.rpm' ! -name '*.src.rpm' |\
- xargs rpm -qp --qf '%{SOURCERPM} %{name}-%{version}-%{release}.%{arch}.rpm\n' |\
- sed -n "s@^$srpm @$TOPDIR/$distro/debug_$section/@p;" |\
- xargs rm -fv
-}
-
-#
-# Cleans a released package
-#
-function clean() {
- distro="$1"
- section="$2"
- srpm="$3"
-
- echo "Package released. We can remove it now."
- clean_package "$distro" "$section" "$srpm"
-}
-
-#
-# Cleans an aged package
-#
-function age_timeout() {
- distro="$1"
- section="$2"
- srpm="$3"
-
- echo "Package expired. We can remove it now."
- clean_package "$distro" "$section" "$srpm"
-}
-
-#
-# Send a warn about packages that goes to wrong sections.
-#
-function wrong_section() {
- distro="$1"
- section="$2"
- srpm="$3"
- hits="$4"
-
- wrong_section=$(echo "$hits" | sed "s@$OFFICIAL_DIR/$distro/SRPMS/@@;s@/$srpm@@")
-
- echo "Package uploaded to a wrong section!"
- echo "It went to $wrong_section while should have hit $section!"
- mail -s "Package $srpm uploaded to section for $distro" $MAILTO <<_EOF_
-Distro: $distro
-Package: $srpm
-Wanted section: $section
-Final section: $wrong_section
-
-It happened again!
-
-I'm holding it on the cache probably for more $AGE days.
-_EOF_
-}
-
-#
-# Search for the .src.rpm's
-#
-ls "$TOPDIR" |\
-while read distro; do
- find -L "$TOPDIR/$distro" -type f -name '*.src.rpm' |\
- sed "s@$TOPDIR/$distro/@@;s@/\([^/]\+\)\$@ \1@" |\
- while read section srpm; do
- echo
- echo "Checking $distro/$section/$srpm"
-
- # Check if the package was released
- if [ -e "$OFFICIAL_DIR/$distro/SRPMS/$section/$srpm" ]; then
- clean "$distro" "$section" "$srpm"
- continue
- fi
-
- # Check for age timeout
- z=$(find "$OFFICIAL_DIR/$distro/SRPMS/$section/$srpm" -ctime +$AGE -name "$srpm" 2> /dev/null)
- if [ -n "$z" ]; then
- age_timeout "$distro" "$section" "$srpm"
- continue
- fi
-
- # Check for wrong section
- z=$(find "$OFFICIAL_DIR/$distro/SRPMS" -type f -name "$srpm")
- if [ -n "$z" ]; then
- wrong_section "$distro" "$section" "$srpm" "$z"
- continue
- fi
-
- # Package should remain on cache
- echo "Package should remain on cache."
- done
-done
-
-# Check for unsupported archs, which are uploaded without .src.rpms
-echo
-echo "Cleaning unsupported archs.."
-find "$TOPDIR" -type f -name '*.rpm' \
- ! -name '*.i586.rpm' ! -name '*.x86_64.rpm' \
- ! -name '*.noarch.rpm' ! -name '*.src.rpm' |\
- xargs rm -fv