Re: Chocolatey - package version
Bob <[email protected]>
| Newsgroups | gmane.comp.sysutils.cfengine.general |
|---|---|
| Message-ID | <[email protected]> |
Nick -- thank you. I was reading this page and did not see that option: https://docs.cfengine.com/docs/3.20/reference-promise-types-packages.html Best, Bob On Wednesday, November 30, 2022 at 9:54:27 AM UTC-7 [email protected] wrote: > Hi Bob, > > I get the following error: Mixed old and new package promise attributes > inside one package promise > > As the error indicates you are trying to mix attributes that are mutually > exclusive. > > There are both the package_method based implementation > <https://docs.cfengine.com/docs/master/reference-promise-types-packages-deprecated.html> > and package_module based implementation > <https://docs.cfengine.com/docs/master/reference-promise-types-packages.html> > of packages promises. > > Mostly you are using the package_method implementation in your example. > But, version is a package_module attribute. > > What if you try using package_version and package_select? > > bundle agent __main__{ > > > > packages: > have_choco_exe:: > "python3" > package_policy => "add" > > , > package_method => choco, > package_select => "==", > package_version => "3.11.0"; > > > }body package_method choco{ > package_changes => "individual"; > package_list_command => "C:\ProgramData\Chocolatey\bin\choco.exe list --localonly"; > package_list_version_regex => ".*\s+ (.*)"; > package_list_name_regex => "^(.*)\s+.*"; > package_installed_regex => ".*"; > package_add_command => "C:\ProgramData\Chocolatey\bin\choco.exe install -y";} > > I don't see a way to tell choco.exe to use the "latest" version of a > package when I am installing other packages (notepad++, for example). Any > suggestions? > > The package_method implementation doesn't have a "latest" version notion, > instead it has "update" and "addupdate" options for package_policy and > package_select supports things like <, >, ==, !=, >=, and <= You might > also need some binary that can help you understand the versioning scheme. > You can use pacakge_version_less_command and package_version_equal_command > for that. > > – Nick Anderson | Doer of Things | (+1) 785-550-1767 <(785)%20550-1767> | > https://northern.tech > -- You received this message because you are subscribed to the Google Groups "help-cfengine" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/help-cfengine/08ce236f-9b84-4f05-b2d6-9ec2741c1a58n%40googlegroups.com.