Incorrect repo versions returned due to GetPKGVersion.ps1 not using exact flag
Posted: Wed Aug 30, 2023 8:05 am
Hi Cubert.
Appreciate the speedy response and update to the choc shim issue. I have been delving into the script a little further and believe i have identified further issues with the subscript file GetPKGVersion.ps1
When running this against the default active package list it was returning some confusing version information for chocolatey packages when using search -r $package
For example if you run in isolation
$package = "firefox"
choco search -r $Package
the resulting list ranks alphabetically with the top result being
adblockplusfirefox|0.0.0.2
This corresponds with the version being reported back into the application manager for firefox which in turn correlates with the final part of GetPKGVersion.ps1 where it splits the results into an array and selects item [1]
using choco search -r --exact $package returns the correct package version information for the two that I have tested (Dropbox, which returned package name ARQ and version 7.21.2. And Firefox)
However when i have modified the running of this script in the :MASTERVERSIONSTART block on line 318 to include the --exact flag on both Choco SEARCH and choco LIST, it has seemingly stopped returning the package info back to the log messages and subsequently the application manager itself see below screenshots However the correct versions, without names are then returned into the command results field, where the below highlighted field was displaying 0.0.0.2 previously now shows 116.0.3 which is the correct latest stable version for firefox
This all seems to indicate that the way chocolatey returns information from choco search -r $package has changed in a way the script is not prepared for and that the --exact field would need to be integrated into the repo version scan segments as well as the 3 other uses of GetPKGVersion.ps1 throughout. I am however not able to figure out why the command outputs the expected value but this is not passed to the log messages or seemingly the table which stores repo versions. As testing the GetPKGVersion.ps1 script in isolation, with the exact flags, does produce the expected results. getpkgtest.png
Appreciate the speedy response and update to the choc shim issue. I have been delving into the script a little further and believe i have identified further issues with the subscript file GetPKGVersion.ps1
When running this against the default active package list it was returning some confusing version information for chocolatey packages when using search -r $package
For example if you run in isolation
$package = "firefox"
choco search -r $Package
the resulting list ranks alphabetically with the top result being
adblockplusfirefox|0.0.0.2
This corresponds with the version being reported back into the application manager for firefox which in turn correlates with the final part of GetPKGVersion.ps1 where it splits the results into an array and selects item [1]
using choco search -r --exact $package returns the correct package version information for the two that I have tested (Dropbox, which returned package name ARQ and version 7.21.2. And Firefox)
However when i have modified the running of this script in the :MASTERVERSIONSTART block on line 318 to include the --exact flag on both Choco SEARCH and choco LIST, it has seemingly stopped returning the package info back to the log messages and subsequently the application manager itself see below screenshots However the correct versions, without names are then returned into the command results field, where the below highlighted field was displaying 0.0.0.2 previously now shows 116.0.3 which is the correct latest stable version for firefox
This all seems to indicate that the way chocolatey returns information from choco search -r $package has changed in a way the script is not prepared for and that the --exact field would need to be integrated into the repo version scan segments as well as the 3 other uses of GetPKGVersion.ps1 throughout. I am however not able to figure out why the command outputs the expected value but this is not passed to the log messages or seemingly the table which stores repo versions. As testing the GetPKGVersion.ps1 script in isolation, with the exact flags, does produce the expected results. getpkgtest.png