From ba7e8bbc1f2e18a8262ec88324ef1c6831cef8be Mon Sep 17 00:00:00 2001 From: Markos Chandras Date: Fri, 7 Sep 2018 11:24:07 +0100 Subject: [PATCH] modules: mirror: opensuse: Ensure that old distros are wiped from mirrors Mirrors still contain repositories from distributions which we do not mirror anymore. As such, lets make sure that we wipe them if necessary. Change-Id: I35f7e1659ab4e22fb4ef6c1b5673085354df4050 --- .../files/mirror/opensuse-mirror-update.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/modules/openstack_project/files/mirror/opensuse-mirror-update.sh b/modules/openstack_project/files/mirror/opensuse-mirror-update.sh index 5d6756c149..050ddf43da 100644 --- a/modules/openstack_project/files/mirror/opensuse-mirror-update.sh +++ b/modules/openstack_project/files/mirror/opensuse-mirror-update.sh @@ -21,7 +21,16 @@ OBS_MIRROR="rsync://ftp.gwdg.de/pub/opensuse/repositories/" OBS_REPOS=('Virtualization:/containers' 'Cloud:/OpenStack:/Queens' 'Cloud:/OpenStack:/Master') K5START="k5start -t -f /etc/opensuse.keytab service/opensuse-mirror -- timeout -k 2m 30m" -# NOTE(hwoarang): 15.0 is newer than 42.3 +# NOTE(hwoarang): Ensure old distros are not mirrored aymore +for DISTVER in 42.2; do + for REPO in distribution/leap/$DISTVER update/leap/$DISTVER; do + if [ -d $BASE/$REPO ]; then + $K5START rm -rf $BASE/$REPO + fi + done +done + +# NOTE(hwoarang): 15.0 is newer than 42.3. for DISTVER in 42.3 15.0; do REPO=distribution/leap/$DISTVER if ! [ -f $BASE/$REPO ]; then