-
Notifications
You must be signed in to change notification settings - Fork 552
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
onedir install - correct version regex #1868
Conversation
@jeff350 Thanks for the PR. The bootstrap needs to handle both scenarios, the one you've updated it to handle and the one it was previously handling. Our minor versions are now under minor directory, eg. https://repo.saltproject.io/salt/py3/redhat/9/x86_64/minor/3005-1/ and the major versions are here, eg. https://repo.saltproject.io/salt/py3/redhat/9/x86_64/3005/. To handle both situations we need something like this: if [ "$(echo "$1" | grep -E '^(latest)$')" != "" ]; then
ONEDIR_REV="$1"
shift
elif [ "$(echo "$1" | grep -E '^([3-9][0-9]{3}?-[0-9]$)')" != "" ]; then
ONEDIR_REV="minor/$1"
shift
elif [ "$(echo "$1" | grep -E '^([3-9][0-9]{3}(\.[0-9]*)?)')" != "" ]; then
# Handle the 3xxx.0 version as 3xxx archive (pin to minor) and strip the fake ".0" suffix
ONEDIR_REV=$(echo "$1" | sed -E 's/^([3-9][0-9]{3})\.0$/\1/')
shift |
@garethgreenaway Thank you for the explanation of what needs to be supported. I got the requested changes added in and all tests are passing. looking at this again does the 3rd section handling 3005.0 format need to be changed to
so we do not end up with ONEDIR_REV being set to 3005.1? |
@jeff350 Apologies for the delay, I chatted with a few other members of the Salt project core team about our plans for the repo layout and it should be pretty close to what we have for the classic non-onedir packages. The major different is the use of elif [ "$ITYPE" = "onedir" ]; then
if [ "$#" -eq 0 ];then
ONEDIR_REV="latest"
else
if [ "$(echo "$1" | grep -E '^(latest|3005)$')" != "" ]; then
ONEDIR_REV="$1"
shift
elif [ "$(echo "$1" | grep -E '^([3-9][0-9]{3}(\.[0-9]*)?)')" != "" ]; then
# Handle the 3xxx.0 version as 3xxx archive (pin to minor) and strip the fake ".0" suffix
ONEDIR_REV=$(echo "$1" | sed -E 's/^([3-9][0-9]{3})\.0$/\1/')
ONEDIR_REV="minor/$ONEDIR_REV"
shift
else
echo "Unknown stable version: $1 (valid: 3005, latest.)"
exit 1
fi
fi |
@garethgreenaway I appreciate you taking the time to talk this over with others on the team to get this figured out. unfortunately I am not following. Earlier you stated that this needed to handle both scenarios of MAJOR.MINOR and MAJOR-MINOR. The code you posted does not account for the MAJOR-MINOR format. Could you please clarify if both of these need to be handled? My understanding is that the following is what is required. If we are handling the following input and output formats
we would want this block.
The other questions that come to mind are:
|
@jeff350 When I mentioned needing to support the So the scenarios that need to be supported are:
No. We won't have a MAJOR-0 . When the 3006 release is released we'll be moving back to using
I think for now sticking to the having the version number in there as it's a check for a valid release. |
…into fix_onedir_regex
What does this PR do?
This PR fixes an issue with the regex where it was looking for versions in format
3005-1
when it should be looking for3005.1
This is adjusting the regex to the same as the stable install.
This also fixes the ability to call the function with 3005.0 and have it resolve to 3005 as is done in the stable install.