You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the current version of OpenHAB is a milestone build, the milestone is not added back to to the concatenation of the reconstructed $CurrentVersion. This causes the script to prompt for reinstallation vs updating if you're updating from the x.y.z.M1 build to the x.y.z build.
This example is taken from 3.2.0.M1 with the following version.properties
openHAB Distribution Version Information
----------------------------------------
build-no : Milestone Build
online-repo : https://openhab.jfrog.io/openhab/libs-milestone
Repository Version
----------------------------------------
openhab-distro : 3.2.0.M1
openhab-core : 3.2.0.M1
openhab-addons : 3.2.0.M1
karaf : 4.3.2
if ($parts[2].EndsWith("-SNAPSHOT","CurrentCultureIgnoreCase")) {
$CurrentVersion=$parts[0] +"."+$parts[1] +"."+$parts[2].Substring(0,$parts[2].Length -"-SNAPSHOT".Length);
}
else {
$CurrentVersion=$parts[0] +"."+$parts[1] +"."+$parts[2]
}
Write-Host-ForegroundColor Yellow "The current version is $CurrentVersion"
The text was updated successfully, but these errors were encountered:
I modified the concatenation of CurrentVersion to include the milestone:
if ($parts[2].EndsWith("-SNAPSHOT","CurrentCultureIgnoreCase")) {
$CurrentVersion=$parts[0] +"."+$parts[1] +"."+$parts[2].Substring(0,$parts[2].Length -"-SNAPSHOT".Length);
}
else {
$CurrentVersion=$parts[0] +"."+$parts[1] +"."+$parts[2]
if($parts.length-eq4) {
$CurrentVersion=$CurrentVersion+"."+$parts[3]
}
}
Write-Host-ForegroundColor Yellow "The current version is $CurrentVersion"
The addition of the milestone to the CurrentVersion variable results in NormalizeVersionNumber rejecting it for not being 3 parts
$parts=$VersionNumber.Split(".")
if ($parts.Length-eq2) {
$parts+="0"
}
if ($parts.Length-ne3) {
throw"$VersionNumber is not formatted correctly (d.d.d)"
}
Modifying this (probably impacts other parts of the script yet to be seen) to be if( -not ($parts.Length -eq 3 -or $parts.Length -eq 4) gets the script to progress and the script now prompts for a downgrade due to "3.2.0" -lt "3.2.0.M1" being $True. Proceeding with the "downgrade" is successful and upgraded 3.2.0.M1 to 3.2.0.
I went back and looked and it appears the reinstallation warning ("Current version is equal to specified version ($OHVersionName). If you continue, you will REINSTALL $OHVersionName rather than upgrade.") is just a warning and actually has no impact. This made me think the way forward would be to just proceed as a "reinstallation" without all of the other modifications above, but there are other implications (such as the temporary backup being stored as 3.2.0 instead of 3.2.0.M1 which seem less than ideal)
When the current version of OpenHAB is a milestone build, the milestone is not added back to to the concatenation of the reconstructed
$CurrentVersion
. This causes the script to prompt for reinstallation vs updating if you're updating from thex.y.z.M1
build to thex.y.z
build.This example is taken from 3.2.0.M1 with the following
version.properties
openhab-distro/distributions/openhab/src/main/resources/bin/update.ps1
Line 404 in 557b820
The text was updated successfully, but these errors were encountered: