From a02bca092308074927a30aca25615f0ba8a3f84c Mon Sep 17 00:00:00 2001 From: Scott Little Date: Mon, 7 Jan 2019 15:45:48 -0500 Subject: [PATCH] Mirror failed to download 7.6 installer The starlingx mirror failed to capture the centos 7.6 installer. Although the installer files are stored under mirror.centos.org//os/x86_64/, it is not captured by reposync. No options that I have tried will make it do so. We can either demand that folks create .lst file entries for any installer files they want to use, or modify the mirror scripts with a special case to capture the installer of all future centos versions via other means. This update takes the later approach. It does make some assumptions about the names of subdirectories we need to capture, e.g. EFI, images, isolinux, LiveOS, but they hold true for Centos releases to date. Change-Id: Id90b22fbb93c8143ed112be33ac168f1ee84f2f3 Signed-off-by: Scott Little --- .../stx_mirror_scripts/daily_repo_sync.sh | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/centos-mirror-tools/stx_mirror_scripts/daily_repo_sync.sh b/centos-mirror-tools/stx_mirror_scripts/daily_repo_sync.sh index e115335e..666f56e4 100755 --- a/centos-mirror-tools/stx_mirror_scripts/daily_repo_sync.sh +++ b/centos-mirror-tools/stx_mirror_scripts/daily_repo_sync.sh @@ -24,6 +24,13 @@ YUM_REPOS_DIR="$YUM_CONF_DIR/yum.repos.d" DOWNLOAD_PATH_ROOT="/export/mirror/centos" URL_UTILS="url_utils.sh" +# These variables drive the download of the centos installer +# and other non-repo files found under the os/x86_64 subdirectory. +OS_PATH_PREFIX=/export/mirror/centos/centos +OS_PATH_SUFFIX=os/x86_64 +OS_FILES="EULA GPL" +OS_DIRS="EFI LiveOS images isolinux" + DAILY_REPO_SYNC_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}" )" )" if [ -f "$DAILY_REPO_SYNC_DIR/$URL_UTILS" ]; then @@ -118,6 +125,32 @@ for REPO in $(find $YUM_REPOS_DIR -name '*.repo'); do continue fi + # The following will download the centos installer and other non-repo + # files and directories found under the os/x86_64 subdirectory. + if [[ "$DOWNLOAD_PATH" == "$OS_PATH_PREFIX"/*/"$OS_PATH_SUFFIX" ]]; then + for f in $OS_FILES; do + CMD="wget '$REPO_URL/$f' --output-document='$DOWNLOAD_PATH/$f'" + echo "$CMD" + eval $CMD + if [ $? -ne 0 ]; then + echo "Error: $CMD" + ERR_COUNT=$((ERR_COUNT+1)) + continue + fi + done + + for d in $OS_DIRS; do + CMD="wget -r -N -l 3 -nv -np -e robots=off --reject-regex '.*[?].*' --reject index.html '$REPO_URL/$d/' -P '$OS_PATH_PREFIX/'" + echo "$CMD" + eval $CMD + if [ $? -ne 0 ]; then + echo "Error: $CMD" + ERR_COUNT=$((ERR_COUNT+1)) + continue + fi + done + fi + popd done done | tee $LOGFILE