Matching (possibly subsets) of types should be folded into 1 #344

Open
opened 2022-08-21 10:09:23 +00:00 by thijso · 1 comment

I'm running into an issue with the __git type and my own __pkg type.

I'm running a mix of devuan and funtoo (gentoo derivative) and I want to abstract the packages I install. So I have an intermediate __pkg that extracts the correct package name for the OS type from a top-level dictionary file.

So I can do __pkg docker everywhere, which gets 'translated' to __package docker on devuan, but __package app-emulation/docker on gentoo (and not x11-plugins/docker, for example).

However, __git starts with the line __package git --state present and so I get an error:

ERROR: cdist: Object __package_emerge/git already exists with conflicting parameters:
/tmp/tmptz3u5bau/f41e3758b20e49a017b28bb069458282/data/conf/type/__package/manifest: {'state': 'present', 'version': ''}
/tmp/tmptz3u5bau/f41e3758b20e49a017b28bb069458282/data/conf/type/__pkg/manifest: {'name': 'dev-vcs/git', 'state': 'present', 'version': ''}

The parameters that are defined for both are the same (version and state), so I think this 'conflict' should be avoided by merging these types into 1 (the one with the most specific definition).

Not sure if that's possible in the system, but this really is not a 'real' conflict, obviously.

And having some types mandate that they have a package installed is obviously correct, but that should not interfere with manually defined packages if they don't actually conflict.

I'm running into an issue with the `__git` type and my own `__pkg` type. I'm running a mix of devuan and funtoo (gentoo derivative) and I want to abstract the packages I install. So I have an intermediate `__pkg` that extracts the correct package name for the OS type from a top-level dictionary file. So I can do `__pkg docker` everywhere, which gets 'translated' to `__package docker` on devuan, but `__package app-emulation/docker` on gentoo (and not `x11-plugins/docker`, for example). However, `__git` starts with the line `__package git --state present` and so I get an error: ``` ERROR: cdist: Object __package_emerge/git already exists with conflicting parameters: /tmp/tmptz3u5bau/f41e3758b20e49a017b28bb069458282/data/conf/type/__package/manifest: {'state': 'present', 'version': ''} /tmp/tmptz3u5bau/f41e3758b20e49a017b28bb069458282/data/conf/type/__pkg/manifest: {'name': 'dev-vcs/git', 'state': 'present', 'version': ''} ``` The parameters that are defined for both are the same (`version` and `state`), so I think this 'conflict' should be avoided by merging these types into 1 (the one with the most specific definition). Not sure if that's possible in the system, but this really is not a 'real' conflict, obviously. And having some types mandate that they have a package installed is obviously correct, but that should not interfere with manually defined packages if they don't actually conflict.
Owner

So there is a conflict: the parameters for "__package_emerge/git" are different. In fact the __git type just uses git as name, the __pkg one uses "dev-cvs/git".

So the easiest way to solve this would be to use the same name under funtoo, just git. Then the conflict should vanish.

Other more sophisticated solutions are probably possible, but this one would be straight forward.

So there *is* a conflict: the parameters for "\_\_package_emerge/git" *are* different. In fact the `__git` type just uses git as name, the `__pkg` one uses "dev-cvs/git". So the easiest way to solve this would be to use the same name under funtoo, just git. Then the conflict should vanish. Other more sophisticated solutions are probably possible, but this one would be straight forward.
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: ungleich-public/cdist#344
No description provided.