Skip to content

Commit

Permalink
Fix MacOS grep -E pattern to allow for no '.x' versions
Browse files Browse the repository at this point in the history
  • Loading branch information
dmurphy18 committed Nov 12, 2024
1 parent 7b84e12 commit 5e210ca
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 15 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/test-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ jobs:
# It is used to install via bootstrap and in the test
# The version is in the instance name
# sed 1st - becomes space, 2nd - becomes dot
## DGM needs cleanup
echo "matrix instance ,${{ matrix.instance }},"
vt_parms=$(echo "${{ matrix.instance }}" | sed 's/-/ /')
vt_parms2=$(echo "$vt_parms" | sed 's/-/./')
Expand All @@ -77,13 +78,13 @@ jobs:
- name: Bootstrap Salt
run: |
# sed 1st - becomes space, 2nd - becomes dot
## DGM needs cleanup
echo "matrix instance ,${{ matrix.instance }},"
bt_parms=$(echo "${{ matrix.instance }}" | sed 's/-/ /')
bt_parms2=$(echo "$bt_parms" | sed 's/-/./')
bt_arg1=$(echo "$bt_parms2" | awk -F ' ' '{print $1}')
bt_arg2=$(echo "$bt_parms2" | awk -F ' ' '{print $2}')
echo "bt parms ,$bt_parms, bt_parms2 ,$bt_parms2, bt_arg1 ,$bt_arg1, bt_arg2 ,$bt_arg2,"
## sudo sh -x ./bootstrap-salt.sh "$bt_parms2"
sudo sh -x ./bootstrap-salt.sh "$bt_arg1" "$bt_arg2"
- name: Test Bootstrap
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/test-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ jobs:
# It is used to install via bootstrap and in the test
# The version is in the instance name
# sed 1st - becomes space, 2nd - becomes dot
## DGM needs cleanup
echo "matrix instance ,${{ matrix.instance }},"
vt_parms=$(echo "${{ matrix.instance }}" | sed 's/-/ /')
vt_parms2=$(echo "$vt_parms" | sed 's/-/./')
Expand All @@ -67,13 +68,13 @@ jobs:
- name: Bootstrap Salt
run: |
# sed 1st - becomes space, 2nd - becomes dot
## DGM needs cleanup
echo "matrix instance ,${{ matrix.instance }},"
bt_parms=$(echo "${{ matrix.instance }}" | sed 's/-/ /')
bt_parms2=$(echo "$bt_parms" | sed 's/-/./')
bt_arg1=$(echo "$bt_parms2" | awk -F ' ' '{print $1}')
bt_arg2=$(echo "$bt_parms2" | awk -F ' ' '{print $2}')
echo "bt parms ,$bt_parms, bt_parms2 ,$bt_parms2, bt_arg1 ,$bt_arg1, bt_arg2 ,$bt_arg2,"
## sudo sh -x ./bootstrap-salt.sh "$bt_parms2"
sudo sh -x ./bootstrap-salt.sh "$bt_arg1" "$bt_arg2"
- name: Test Bootstrap
Expand Down
4 changes: 2 additions & 2 deletions bootstrap-salt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,7 @@ elif [ "$ITYPE" = "stable" ]; then
_ONEDIR_REV="$1"
ITYPE="onedir"
shift
elif [ "$(echo "$1" | grep -E '^([3-9][0-5]{2}[5-9](\.[0-9]*)?)')" != "" ]; then
elif [ "$(echo "$1" | grep -E '^([3-9][0-5]{2}[6-9](\.[0-9]*)?)')" != "" ]; then
STABLE_REV="$1"
ONEDIR_REV="$1"
_ONEDIR_REV="$1"
Expand Down Expand Up @@ -7453,7 +7453,7 @@ __macosx_get_packagesite_onedir() {
SALT_MACOS_PKGDIR_URL="https://${_REPO_URL}/${_ONEDIR_TYPE}/macos"
if [ "$(echo "$_ONEDIR_REV" | grep -E '^(latest)$')" != "" ]; then
__macosx_get_packagesite_onedir_latest
elif [ "$(echo "$_ONEDIR_REV" | grep -E '^([3-9][0-9]{3}(\.[0-9]*))')" != "" ]; then
elif [ "$(echo "$_ONEDIR_REV" | grep -E '^([3-9][0-9]{3}(\.[0-9]*)?)')" != "" ]; then
_PKG_VERSION=$_ONEDIR_REV
else
__macosx_get_packagesite_onedir_latest
Expand Down
11 changes: 0 additions & 11 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,6 @@ def target_python_version():
def target_salt_version():

target_salt = os.environ.get("SaltVersion", "")

print(
f"DGM conftest target_salt_version, target_salt '{target_salt}', os.environ '{os.environ}'",
flush=True,
)

html_response = requests.get(API_URL)
content = json.loads(html_response.text)
folders = content["children"]
Expand All @@ -37,11 +31,6 @@ def target_salt_version():
versions[maj_version] = version
versions["latest"] = version

print(
f"DGM conftest target_salt_version, target_salt '{target_salt}', versions '{versions}'",
flush=True,
)

if target_salt.startswith("v"):
target_salt = target_salt[1:]
if target_salt not in versions:
Expand Down

0 comments on commit 5e210ca

Please sign in to comment.