distro: add a Sources method

This outputs the sources needed for the pipeline generated for the
distro. At the moment no pipelines require sources, and so this
always returns the empty list.

Signed-off-by: Tom Gundersen <teg@jklm.no>
This commit is contained in:
Tom Gundersen 2020-02-13 14:59:13 +01:00 committed by msehnout
parent 7f97401ef8
commit 2d675ea51b
5 changed files with 20 additions and 0 deletions

View file

@ -55,6 +55,10 @@ type Distro interface {
// given blueprint.
Pipeline(b *blueprint.Blueprint, additionalRepos []rpmmd.RepoConfig, packageSpecs, buildPackageSpecs []rpmmd.PackageSpec, checksums map[string]string, outputArchitecture, outputFormat string, size uint64) (*osbuild.Pipeline, error)
// Returns an osbuild sources object that is required for building the
// corresponding pipeline containing the given packages.
Sources(packages []rpmmd.PackageSpec) *osbuild.Sources
// Returns a osbuild runner that can be used on this distro.
Runner() string
}

View file

@ -469,6 +469,10 @@ func (r *Fedora30) Pipeline(b *blueprint.Blueprint, additionalRepos []rpmmd.Repo
return p, nil
}
func (r *Fedora30) Sources(packages []rpmmd.PackageSpec) *osbuild.Sources {
return &osbuild.Sources{}
}
func (r *Fedora30) Runner() string {
return "org.osbuild.fedora30"
}

View file

@ -71,6 +71,10 @@ func (d *FedoraTestDistro) Pipeline(b *blueprint.Blueprint, additionalRepos []rp
}
}
func (r *FedoraTestDistro) Sources(packages []rpmmd.PackageSpec) *osbuild.Sources {
return &osbuild.Sources{}
}
func (d *FedoraTestDistro) Runner() string {
return "org.osbuild.test"
}

View file

@ -612,6 +612,10 @@ func (r *RHEL82) Pipeline(b *blueprint.Blueprint, additionalRepos []rpmmd.RepoCo
return p, nil
}
func (r *RHEL82) Sources(packages []rpmmd.PackageSpec) *osbuild.Sources {
return &osbuild.Sources{}
}
func (r *RHEL82) Runner() string {
return "org.osbuild.rhel82"
}

View file

@ -63,6 +63,10 @@ func (d *TestDistro) Pipeline(b *blueprint.Blueprint, additionalRepos []rpmmd.Re
return nil, errors.New("invalid output format or arch: " + outputFormat + " @ " + outputArch)
}
func (d *TestDistro) Sources(packages []rpmmd.PackageSpec) *osbuild.Sources {
return &osbuild.Sources{}
}
func (d *TestDistro) Runner() string {
return "org.osbuild.test"
}