Skip to content
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

RFE: support greater than/less than versions for packages in treefile #2138

Closed
miabbott opened this issue Jun 19, 2020 · 6 comments
Closed
Labels
jira for syncing to jira

Comments

@miabbott
Copy link
Member

RHCOS would like to be able to use syntax like podman > 1.4 in the treefile to enforce that higher NVRs always win out. (This is not always the case when dealing with modules)

Speaking with @cgwalters on Slack, he noted that rpm-ostree install 'cowsay >= 3.00' works just fine. But we split the entries in the package: section on whitespace, so that wouldn't work as is.

The suggestion was a new section in the treefile such as packages-literal that would allow the use of the greater/less than syntax

@miabbott
Copy link
Member Author

Granted, if RHCOS used lockfiles like FCOS does this wouldn't be a problem. Still might be a nice feature for the broader community.

@jlebon
Copy link
Member

jlebon commented Jun 19, 2020

We can also just skip splitting whitespace if the entry starts with a quote (and unquote it). I.e., require that such entries be their own array element, quoted.

@dustymabe dustymabe added the jira for syncing to jira label Jun 19, 2020
@cgwalters
Copy link
Member

In a quick look at the code, I think we have some potential drift between the rpm-ostree install paths and the compose path. It looks like the former uses

GPtrArray*
rpmostree_get_matching_packages (DnfSack *sack,
                                 const char *pattern)
{
  /* mimic dnf_context_install() */

But the compose path is using dnf_context_install()...they may differ now.

@kelvinfan001
Copy link
Member

does this mean we need to update compose path to look like the one in rpm-ostree install, i.e. /* mimic dnf_context_install() */ instead of simply dnf_context_install()?

@cgwalters
Copy link
Member

Honestly I'm not sure what's going wrong; I'd probably add debugging prints (or use gdb) and verify that e.g. rpm-ostree install 'cowsay > 1' on the client side is passing the same thing to dnf_context_install() that you are with the server side.

I'd also triple check the quoting is the same in both cases, i.e. you're correctly stripping quotes before it ends up being passed to dnf_context_install().

@miabbott
Copy link
Member Author

Closed via #2151

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
jira for syncing to jira
Projects
None yet
Development

No branches or pull requests

5 participants