Re: Chocolatey - package version
"'Nick Anderson' via help-cfengine" <[email protected]>
| Newsgroups | gmane.comp.sysutils.cfengine.general |
|---|---|
| Message-ID | <[email protected]> |
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] and
[`package_module' based implementation] 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 |
<https://northern.tech>
[`package_method' based implementation]
<https://docs.cfengine.com/docs/master/reference-promise-types-packages-deprecated.html>
[`package_module' based implementation]
<https://docs.cfengine.com/docs/master/reference-promise-types-packages.html>
--
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/87lenswfgg.fsf%40precision-5570.home.cmdln.org.