Commit graph

12 commits

Author SHA1 Message Date
Christian Kellner
a4127cce66 mpp/depsolve: support for format version 2
Support for dep-solving in format version 2. Instead of adding
the checksums to a key in the options, it will be added to the
references inside an input. The urls for the items are added
in the sources dict via the new format, i.e. in the `items`
dict instead of the `urls` dict.
2021-02-12 15:55:43 +01:00
Christian Kellner
7d72b2250c mpp/depsolve: prepare for multi format support
Rename the parsing and process functions to have a format version
specific suffix. This should make it easy to add support for the
format version 2. Logic should be unchanged.
2021-02-12 15:55:43 +01:00
Christian Kellner
49e1800503 mpp/import: support for format version 2
Add support for foramt version 2. This is slightly easier than
version 1, since there is no recursion. In addition to the
path of the manifest to import the pipeline from, the pipeline
identifier needs to be specified.
Source merging is also different since in format version two,
there is a generic "items" key, which means we can merge
other sources than "org.osbuild.files".
2021-02-12 15:55:43 +01:00
Christian Kellner
a38a3fa502 mpp/import: prepare for multi format support
Rename the parsing and process functions to have a format version
specific suffix. This should make it easy to add support for the
format version 2.
2021-02-12 15:55:43 +01:00
Christian Kellner
33283853e9 tree-diff: properly detect missing selinux labels
Detect the case that one file has a SELinux label but the other
file does not have any label at all. This was currently not
possible to detect because both calls to get the labels were
wrapped in one try-except block and any failure in one of the
two calls, like a missing label, would lead to an early return
of the function, with a success value.
2021-01-26 12:09:23 +01:00
Lars Karlitski
651c5b5461 tools/mpp-depsolve: make use of dnf's per-user cache
Use dnf's per-user cache when `--dnf-cache` is not given. This speeds up
repeated invocations of `mpp-depsolve` considerably, without having to
specify a cache location.
2020-10-19 17:37:46 +01:00
Lars Karlitski
792b2ac5fc tools/mpp-depsolve: ensure canonical urls
Technically, a few extra "/"s don't matter, but in practice, it
sometimes does. In particular, rpmrepo returns `500 Internal Server
Error` when a path contains additional "/"s.
2020-10-19 17:37:46 +01:00
Lars Karlitski
423e38cf5d tools/mpp-depsolve: also support baseurl and mirrorlist repositories 2020-10-19 17:37:46 +01:00
Christian Kellner
953583d636 tools/mpp-depsolve: support excluding packages
Support excluding packages when dep-solving; needed for e.g. the
ostree commits to not create a rescue kernel by excluding the
'dracut-config-rescue' package.
2020-06-15 13:44:01 +02:00
David Rheinsberg
06119f7d88 tools: move tree-diff into ./tools
Move the `tree-diff` tool into ./tools, which is our new place for tools
used by the test-suite or during development.

The only hard-coded user is the TestBase, so fix its path to the tool
so the test-suite will continue to find it.
2020-06-05 09:27:40 +02:00
David Rheinsberg
ae8910e02c tools: add pipeline-import mpp
This adds a new MPP which supports importing pipelines from another
file. It simply looks for "mpp-import-pipeline" tags at the same
position where we would expect a "pipeline" tag. It then uses the "path"
attribute in it to find a manifest. From this manifest, the "sources"
are merged back into the original sources, and the "pipeline" is taken
verbatim to replace the "mpp-import-pipeline".

The idea is to allow importing build-pipelines from other files into our
test manifests, without duplicating the build-pipeline everywhere.
2020-06-05 09:27:40 +02:00
David Rheinsberg
7dcc946fe2 test: add F32 manifests and a manifest-preprocessor
This adds F32 manifests in ./test/data/. To avoid magically deducing the
package list out of the void, this adds a ManifestPreProcessor (MPP)
called `./tools/mpp-depsolve.py`. What this does is it takes a manifest
on stdin, modifies it, and produces a manifest on stdout.

The `mpp-depsolve.py` preprocessor takes a manifest and modifies all the
`org.osbuild.rpm` stages. It parses a new option to that stage called
`mpp-depsolve`, which contains a package-list, a repo-list, and dnf
metadata. It then drops this `mpp-depsolve` option (since it would be an
invalid manifest otherwise), depsolves the packages, inserts a proper
"packages" option as well as appends the correct paths to the sources
entry.

With this in place, this adds `mpp-f32-base.json` and
`mpp-f32-build.json` in ./test/data/manifests/. These will then be used
as base F32 manifests for our test-suite.

Lastly, this adds `./test/data/README.md` as a place to document the
files we place in `./test/data/`, since most of the files do not allow
for comments.
2020-05-20 18:54:38 +02:00