debian-forge-composer/internal/rpmmd
Tomas Hozza 8713b8002a Move kernelVerStr() from distros to rpmmd
Move the `kernelVerStr()` function duplicated in many
distro definitions to the `rpmmd` package as
`GetVerStrFromPackageSpecListPanic()`.

I could not come up with a better name, sorry.

This will prevent creating another copy of the code in rhel-84 for
the `gce` image.

This change initially exposed a bug in the original implementation of
`kernelVerStr()`. Since on the first line, we allocate an empty structure
into `kernelPkg` variable, it can never be `nil` and the function never
panicked even if there was no `kernel` package in the PackageSpec list.

Fix all unit tests to provide valid arguments when calling `Manifest()`
method of image types.

Signed-off-by: Tomas Hozza <thozza@redhat.com>

kernelVerStr fixup

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2022-02-18 09:26:35 +01:00
..
test Add support for image type tags in rpmmd and add RepoRegistry API 2021-05-14 15:43:00 +02:00
metadata.go rpmmd: deduplicate RPM list based on NEVRA 2021-11-16 09:49:37 +01:00
metadata_test.go rpmmd: test rpm list deduplication 2021-11-16 09:49:37 +01:00
repository.go Move kernelVerStr() from distros to rpmmd 2022-02-18 09:26:35 +01:00