Open corbob opened 2 years ago
IMHO, it might be better to reset/update the chocolatey
source when it is read in as an object, that way, there is no need for regex that might match on an incorrect line (like someone setting another config setting to something including chocolatey.org).
This either could be done inside choco, like the licensed source is setup: https://github.com/chocolatey/choco/blob/develop/src/chocolatey/infrastructure.app/builders/ConfigurationBuilder.cs#L77
Or the powershell install script could read in the config file as an xml object, and edit it there.
Description
Currently when upgrading Chocolatey, the configuration file is left largely alone. Since the community repository has been moved to
https://community.chocolatey.org/api/v2/
, it would be beneficial to change this source on upgrade if it's in there as one of the old (or possibly manually updated and slightly incorrect) incarnationshttp[s]://chocolatey.org/api/v2[/]
orhttp[s]://community.chocolatey.org/api/v2[^/]
.Thinking about this, a naive check could simply be something like:
Reason for this change
If we ever opt to change the redirect behaviour in the future, this will ensure nothing breaks.