From b3fd3627954be91b36bff762c19a7e9553347188 Mon Sep 17 00:00:00 2001 From: Matthew Westphall Date: Wed, 26 Jul 2023 17:09:23 -0500 Subject: [PATCH] update 'update_mirror' and 'new_mashfile' to handle osg-23 name patterns --- bin/new_mashfile.sh | 4 ++-- bin/update_mirror.py | 7 ++++--- bin/update_repo.sh | 2 -- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/bin/new_mashfile.sh b/bin/new_mashfile.sh index fc79c2d..0350c3d 100755 --- a/bin/new_mashfile.sh +++ b/bin/new_mashfile.sh @@ -26,8 +26,8 @@ title () { python -c 'import sys; print sys.argv[1].title()' "$*" ; } TAG=$1 case $TAG in - osg-3.*-upcoming-*-* ) IFS='-' read osg SERIES upcoming DVER REPO <<< "$TAG" - SERIES+=-$upcoming ;; + osg-*-*-*-* ) IFS='-' read osg SERIES branch DVER REPO <<< "$TAG" + SERIES+=-$branch ;; osg-*-*-* ) IFS='-' read osg SERIES DVER REPO <<< "$TAG" ;; devops-*-*) IFS='-' read SERIES DVER REPO <<< "$TAG" ;; * ) usage ;; diff --git a/bin/update_mirror.py b/bin/update_mirror.py index 0770b0f..a83a11a 100755 --- a/bin/update_mirror.py +++ b/bin/update_mirror.py @@ -9,6 +9,7 @@ import socket import fcntl import errno +import re def log(log): print("[%s]"%sys.argv[0], time.strftime("%a %m/%d/%y %H:%M:%S %Z: ", time.localtime()), log) @@ -58,9 +59,9 @@ def lock(path): hostname="repo-itb.opensciencegrid.org" def tagsplit(tag): - if 'upcoming' in tag and tag.startswith("osg-3."): - series,_,dver,repo = tag.split('-')[-4:] - series += "-upcoming" + if re.match(r'osg-[0-9.]*-[a-z]*-el[0-9]+-[a-z]*', tag): + series,branch,dver,repo = tag.split('-')[-4:] + series += "-" + branch else: series,dver,repo = tag.split('-')[-3:] return series,dver,repo diff --git a/bin/update_repo.sh b/bin/update_repo.sh index bc2dcd0..23b2ab8 100755 --- a/bin/update_repo.sh +++ b/bin/update_repo.sh @@ -17,8 +17,6 @@ usage () { TAG=$1 case $TAG in - osg-3.*-upcoming-*-* ) IFS='-' read osg SERIES upcoming DVER REPO <<< "$TAG" - SERIES+=-$upcoming ;; osg-*-*-*-* ) IFS='-' read osg SERIES branch DVER REPO <<< "$TAG" SERIES+=-$branch ;; osg-*-*-* ) IFS='-' read osg SERIES DVER REPO <<< "$TAG" ;;