40-autodist-cleanold: sync with current build server

This commit is contained in:
Silvan Calarco 2022-10-02 12:57:49 +02:00
parent 78c85dcc7d
commit 8794727a6a

View File

@ -2,12 +2,12 @@
[ -e /etc/autodist/config ] && . /etc/autodist/config [ -e /etc/autodist/config ] && . /etc/autodist/config
[ -e /etc/sysconfig/autoport ] && . /etc/sysconfig/autoport [ -e /etc/sysconfig/autoport ] && . /etc/sysconfig/autoport
RPMS_CTIME_OLD="+14" RPMS_CTIME_OLD="+3"
BUILD_CTIME_OLD="+14" BUILD_CTIME_OLD="+3"
SOURCES_CTIME_OLD="+40" SOURCES_CTIME_OLD="+7"
SOURCES_ARCHIVES_CTIME_OLD="+14" SOURCES_ARCHIVES_CTIME_OLD="+7"
SOURCES_PATCH_CTIME_OLD="+730" SOURCES_PATCH_CTIME_OLD="+365"
SRPMS_CTIME_OLD="+14" SRPMS_CTIME_OLD="+3"
TMP_CTIME_OLD="+2" TMP_CTIME_OLD="+2"
function clean() { function clean() {
@ -47,16 +47,18 @@ for i in `seq 0 ${#AUTOPORT_ARCH[*]}`; do
[ -e /var/autoport/$a/var/autodist/RPM/RPMS/ ] && \ [ -e /var/autoport/$a/var/autodist/RPM/RPMS/ ] && \
clean /var/autoport/$a/var/autodist clean /var/autoport/$a/var/autodist
[ -e /var/autoport/$a/var/tmp/autodist ] && \ [ -e /var/autoport/$a/var/tmp/autodist ] && \
find /var/autoport/$a/var/tmp/autodist/ -mindepth 1 -maxdepth 1 -type f -mtime ${TMP_CTIME_OLD} -exec rm -rf {} \; find /var/autoport/$a/var/tmp/autodist/ -mindepth 1 -maxdepth 1 -type f -ctime ${TMP_CTIME_OLD} -exec rm -rf {} \;
find /var/autoport/$a/tmp/ -mindepth 1 -maxdepth 1 -type f -mtime ${TMP_CTIME_OLD} -exec rm -rf {} \; find /var/autoport/$a/tmp/ -mindepth 1 -maxdepth 1 -type f -ctime ${TMP_CTIME_OLD} -exec rm -rf {} \;
sudo -u ${AUTOPORT_CHROOT_USER[$i]} ccache -C
elif [ "${AUTOPORT_UPDATE[$i]}" ]; then elif [ "${AUTOPORT_UPDATE[$i]}" ]; then
clean /var/autodist clean /var/autodist
find /var/autodist-tmp/ -mindepth 1 -maxdepth 1 -type f -mtime ${TMP_CTIME_OLD} -exec rm -rf {} \; find /var/autodist-tmp/ -mindepth 1 -maxdepth 1 -ctime ${TMP_CTIME_OLD} -exec rm -rf {} \;
sudo -u autodist ccache -C
elif [ "${AUTOPORT_NATIVE[$i]}" -a "${AUTOPORT_CHROOT_USER[$i]}" ]; then elif [ "${AUTOPORT_NATIVE[$i]}" -a "${AUTOPORT_CHROOT_USER[$i]}" ]; then
WORKINGHOME=`getent passwd ${AUTOPORT_CHROOT_USER[$i]} | cut -d: -f6` WORKINGHOME=`getent passwd ${AUTOPORT_CHROOT_USER[$i]} | cut -d: -f6`
if [ -e $WORKINGHOME ]; then if [ -e $WORKINGHOME ]; then
clean $WORKINGHOME clean $WORKINGHOME
fi fi
find /var/autodist-tmp/ -mindepth 1 -maxdepth 1 -type f -mtime ${TMP_CTIME_OLD} -exec rm -rf {} \; find /var/autodist-tmp/ -mindepth 1 -maxdepth 1 -ctime ${TMP_CTIME_OLD} -exec rm -rf {} \;
fi fi
done done