-
Notifications
You must be signed in to change notification settings - Fork 248
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
Error in detection of highest installed package version #34
Comments
there is a cver all -localonly but it seems slow. But does that do a better job? I have an IComparer at work that could serve this purpose. Then it would become versionQuery.ToList().Sort(New VersionComparer).Last(); I'll if I can adapt the comparer to do what we need. And write the needed unittests. |
|
added failing tests for this. |
@chrissie1: Did you purposefully remove the file system service from the PackageManager during this commit? It looks like it was still there in your prior commit, but then it went away in this one and the dialog boxes during tests came back. I'd add it back in, but it looked like you might have done it on purpose and didn't want to get in a commit fight :) |
Nope thats was accidental, git messed up the merge, i guess, yeah it was git's fault |
FIGHT, FIGHT, FIGHT!!! :-) |
@cemrich Here is the gist to the comparer. Needs some more tests but I think it should work. Based on the full packagename. https://gist.github.com/chrissie1/4959638 |
FileStorageService fell out during an earlier commit, added it back in per comments in #34
All fixed. @chrissie1 are those 4 package name parsing tests added for this issue or a different one? I can fix them to properly parse out name, version, and pre but wouldn't want to step on any work being done to manage the sorting. Also, should there have a been a link to the gist you just mentioned somewhere? |
The link is there. You need to look better. I think they are unrelated. This one is about the fact that The .Last() call did not give the correct version because it does stringsorting. So I made the sorter to sort them correctly so that you can find the last version more easily. My sorter is based on the directoryname but it easily adapted to work on a Package |
Installed packages are read from the chocolatey lib dir. It looks like directories of old package versions are not removed (not sure if that's a bug or a feature). So
ChocolateyLibDirHelper
tries to guess which version is the highest one by string comparison of the version string. This works fine in following case:And it fails for example in following case:
cver freefilesync
reports the correct version. But using this command for detecting installed versions would worsen performance a lot.The text was updated successfully, but these errors were encountered: