manifest/build: don't expose extra build packages

The build packages should always be computed from its
dependents and there should be no need to override it. Drop the
ability, and all the unused code in fedora/*.

NOTE: due to a bug in a previous patch in this PR the extra
package set was never set on the build pipelines.
This commit is contained in:
Tom Gundersen 2022-06-30 20:07:47 +01:00
parent 83e2060976
commit 168aa40b2d
3 changed files with 9 additions and 50 deletions

View file

@ -19,9 +19,6 @@ const (
GigaByte = 1024 * 1024 * 1024
// package set names
// build package set name
buildPkgsKey = "build"
// main/common os image package set name
osPkgsKey = "packages"
@ -75,8 +72,7 @@ var (
filename: "commit.tar",
mimeType: "application/x-tar",
packageSets: map[string]packageSetFunc{
buildPkgsKey: iotBuildPackageSet,
osPkgsKey: iotCommitPackageSet,
osPkgsKey: iotCommitPackageSet,
},
packageSetChains: map[string][]string{
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
@ -97,8 +93,7 @@ var (
filename: "container.tar",
mimeType: "application/x-tar",
packageSets: map[string]packageSetFunc{
buildPkgsKey: iotBuildPackageSet,
osPkgsKey: iotCommitPackageSet,
osPkgsKey: iotCommitPackageSet,
containerPkgsKey: func(t *imageType) rpmmd.PackageSet {
return rpmmd.PackageSet{
Include: []string{"nginx"},
@ -125,7 +120,6 @@ var (
filename: "installer.iso",
mimeType: "application/x-iso9660-image",
packageSets: map[string]packageSetFunc{
buildPkgsKey: iotInstallerBuildPackageSet,
installerPkgsKey: iotInstallerPackageSet,
},
defaultImageConfig: &distro.ImageConfig{
@ -145,8 +139,7 @@ var (
filename: "disk.qcow2",
mimeType: "application/x-qemu-disk",
packageSets: map[string]packageSetFunc{
buildPkgsKey: distroBuildPackageSet,
osPkgsKey: qcow2CommonPackageSet,
osPkgsKey: qcow2CommonPackageSet,
},
packageSetChains: map[string][]string{
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
@ -175,8 +168,7 @@ var (
filename: "disk.vhd",
mimeType: "application/x-vhd",
packageSets: map[string]packageSetFunc{
buildPkgsKey: distroBuildPackageSet,
osPkgsKey: vhdCommonPackageSet,
osPkgsKey: vhdCommonPackageSet,
},
packageSetChains: map[string][]string{
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
@ -208,8 +200,7 @@ var (
filename: "disk.vmdk",
mimeType: "application/x-vmdk",
packageSets: map[string]packageSetFunc{
buildPkgsKey: distroBuildPackageSet,
osPkgsKey: vmdkCommonPackageSet,
osPkgsKey: vmdkCommonPackageSet,
},
packageSetChains: map[string][]string{
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
@ -238,8 +229,7 @@ var (
filename: "disk.qcow2",
mimeType: "application/x-qemu-disk",
packageSets: map[string]packageSetFunc{
buildPkgsKey: distroBuildPackageSet,
osPkgsKey: openstackCommonPackageSet,
osPkgsKey: openstackCommonPackageSet,
},
packageSetChains: map[string][]string{
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
@ -276,8 +266,7 @@ var (
filename: "image.raw",
mimeType: "application/octet-stream",
packageSets: map[string]packageSetFunc{
buildPkgsKey: ec2BuildPackageSet,
osPkgsKey: ec2CommonPackageSet,
osPkgsKey: ec2CommonPackageSet,
},
packageSetChains: map[string][]string{
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
@ -299,8 +288,7 @@ var (
filename: "container.tar",
mimeType: "application/x-tar",
packageSets: map[string]packageSetFunc{
buildPkgsKey: distroBuildPackageSet,
osPkgsKey: containerPackageSet,
osPkgsKey: containerPackageSet,
},
packageSetChains: map[string][]string{
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
@ -583,11 +571,6 @@ func (t *imageType) PackageSets(bp blueprint.Blueprint, options distro.ImageOpti
mergedSets[osPkgsKey] = rpmmd.PackageSet{}
}
// every image type must define a 'build' package set
if _, hasBuild := imageSets[buildPkgsKey]; !hasBuild {
panic(fmt.Sprintf("'%s' image type has no '%s' package set defined", t.name, buildPkgsKey))
}
// blueprint packages
bpPackages := bp.GetPackagesEx(t.rpmOstree || t.bootable)
timezone, _ := bp.Customizations.GetTimezoneSettings()

View file

@ -11,18 +11,6 @@ import (
"github.com/osbuild/osbuild-composer/internal/rpmmd"
)
// BUILD PACKAGE SETS
// distro-wide build package set
func distroBuildPackageSet(t *imageType) rpmmd.PackageSet {
return rpmmd.PackageSet{}
}
// common ec2 image build package set
func ec2BuildPackageSet(t *imageType) rpmmd.PackageSet {
return rpmmd.PackageSet{}
}
func ec2CommonPackageSet(t *imageType) rpmmd.PackageSet {
return rpmmd.PackageSet{
Include: []string{
@ -45,15 +33,6 @@ func ec2CommonPackageSet(t *imageType) rpmmd.PackageSet {
}.Append(bootPackageSet(t))
}
// common iot image build package set
func iotBuildPackageSet(t *imageType) rpmmd.PackageSet {
return rpmmd.PackageSet{}
}
func iotInstallerBuildPackageSet(t *imageType) rpmmd.PackageSet {
return rpmmd.PackageSet{}
}
// BOOT PACKAGE SETS
func bootPackageSet(t *imageType) rpmmd.PackageSet {

View file

@ -14,9 +14,6 @@ import (
// make minimal assumptions about what's available there.
type BuildPipeline struct {
BasePipeline
// Packages to install in addition to the ones required by the
// pipeline.
ExtraPackages []string
dependents []Pipeline
repos []rpmmd.RepoConfig
@ -59,7 +56,7 @@ func (p *BuildPipeline) getPackageSetChain() []rpmmd.PackageSet {
return []rpmmd.PackageSet{
{
Include: append(packages, p.ExtraPackages...),
Include: packages,
Repositories: p.repos,
},
}