From 0979292b543086e4a2d2fbfba2ed986551b2c446 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Mon, 13 May 2024 18:23:03 +0200 Subject: [PATCH] autodist-cleanold: replace cron script with executable run by autoport-launcher --- Makefile | 2 +- autodist | 2 +- .../40-autodist-cleanold => autodist-cleanold | 12 +++++------- autoport | 4 ++-- autoport-launcher | 4 +++- etc/autodist/config | 10 ++++++++++ 6 files changed, 22 insertions(+), 12 deletions(-) rename etc/cron.daily/40-autodist-cleanold => autodist-cleanold (92%) diff --git a/Makefile b/Makefile index c8f3144..7d7db16 100644 --- a/Makefile +++ b/Makefile @@ -69,6 +69,7 @@ install-dirs: install-programs: @$(INSTALL_SCRIPT) autodist $(DESTDIR)$(bindir)/autodist + @$(INSTALL_SCRIPT) autodist-cleanold $(DESTDIR)$(bindir)/autodist-cleanold @$(INSTALL_SCRIPT) autodist-git $(DESTDIR)$(bindir)/autodist-git @$(INSTALL_SCRIPT) autodist-inspect $(DESTDIR)$(bindir)/autodist-inspect @$(INSTALL_SCRIPT) autodist-launcher $(DESTDIR)$(bindir)/autodist-launcher @@ -103,7 +104,6 @@ install-data: @$(INSTALL_SCRIPT) etc/sysconfig/autoport $(DESTDIR)$(sysconfdir)/sysconfig/autoport @$(INSTALL_SCRIPT) etc/cron.hourly/60-autodist-update $(DESTDIR)$(sysconfdir)/cron.hourly/ @$(INSTALL_SCRIPT) etc/cron.hourly/65-autoport $(DESTDIR)$(sysconfdir)/cron.hourly/ - @$(INSTALL_SCRIPT) etc/cron.daily/40-autodist-cleanold $(DESTDIR)$(sysconfdir)/cron.daily/ @$(INSTALL_SCRIPT) etc/cron.daily/45-autodist-git-sync $(DESTDIR)$(sysconfdir)/cron.daily/ @$(INSTALL_SCRIPT) etc/logrotate.d/webbuild $(DESTDIR)$(sysconfdir)/logrotate.d/webbuild @$(INSTALL_DATA) autospec-conf $(DESTDIR)$(pck_statedir)/.autospec diff --git a/autodist b/autodist index 1d0cff6..15adb7d 100755 --- a/autodist +++ b/autodist @@ -5,7 +5,7 @@ # # Released under the terms of the GNU GPL release 3 license # -VERSION=1.5.2 +VERSION=1.5.3 me=(${0##*/} $VERSION "Tue Jan 26 2016") exec 3>`readlink /proc/self/fd/0` diff --git a/etc/cron.daily/40-autodist-cleanold b/autodist-cleanold similarity index 92% rename from etc/cron.daily/40-autodist-cleanold rename to autodist-cleanold index 4738008..20e08ca 100755 --- a/etc/cron.daily/40-autodist-cleanold +++ b/autodist-cleanold @@ -2,13 +2,11 @@ [ -e /etc/autodist/config ] && . /etc/autodist/config [ -e /etc/sysconfig/autoport ] && . /etc/sysconfig/autoport -RPMS_CTIME_OLD="+3" -BUILD_CTIME_OLD="+3" -SOURCES_CTIME_OLD="+7" -SOURCES_ARCHIVES_CTIME_OLD="+7" -SOURCES_PATCH_CTIME_OLD="+365" -SRPMS_CTIME_OLD="+3" -TMP_CTIME_OLD="+2" +[ "${RPMS_CTIME_OLD}" -a "${SRPMS_CTIME_OLD}" -a "${SOURCES_CTIME_OLD}" \ + -a "${BUILD_CTIME_OLD}" -a "${TMP_CTIME_OLD}" ] || { + echo "autodist-cleanold: ERROR: *_CTIME_OLD variables need to be set in config; cleaning skipped." + exit 0 +} function clean() { dir=$1 diff --git a/autoport b/autoport index 9f240a0..9acf055 100755 --- a/autoport +++ b/autoport @@ -1,10 +1,10 @@ #!/bin/bash # autoport -- batch cross-build tool based on autodist -# Copyright (C) 2011-2023 by Silvan Calarco +# Copyright (C) 2011-2024 by Silvan Calarco # # Released under the terms of the GNU GPL release 3 license # -VERSION=1.5.2 +VERSION=1.5.3 BASE_REPOSITORY=base PORT_REPOSITORY=base diff --git a/autoport-launcher b/autoport-launcher index 1c62621..9e4503d 100755 --- a/autoport-launcher +++ b/autoport-launcher @@ -1,7 +1,7 @@ #!/bin/bash # # autoport launcher -# (c) 2021 by Silvan Calarco +# (c) 2021-2024 by Silvan Calarco # #. /etc/sysconfig/openmamba-central . /etc/sysconfig/autoport @@ -17,6 +17,8 @@ i=$1 [ "`uname -m`" = "x86_64" ] && HOST_IS_X86_64=1 +autodist-cleanold + [ "${AUTOPORT_DISABLE[$i]}" -a "${AUTOPORT_DISABLE[$i]}" != "0" ] && exit 0 PIDFILE=/run/autodist/autoport-launcher-${i}.pid diff --git a/etc/autodist/config b/etc/autodist/config index dd8e8f5..376eb71 100644 --- a/etc/autodist/config +++ b/etc/autodist/config @@ -26,6 +26,16 @@ AUTOPORT_IGNORE_LIST="" AUTODIST_REBUILDOLD_MAX=20 AUTODIST_REBUILDOLD_FROMDATE=20090101 #AUTODIST_GIT_SYNC=1 + +# Variables used by autodist-cleanold +RPMS_CTIME_OLD="+3" +BUILD_CTIME_OLD="+3" +SOURCES_CTIME_OLD="+7" +SOURCES_ARCHIVES_CTIME_OLD="+7" +SOURCES_PATCH_CTIME_OLD="+365" +SRPMS_CTIME_OLD="+3" +TMP_CTIME_OLD="+2" + # # Set to disable autodist-repository and use local list #