debian-forge-cli/cmd/image-builder/manifest.go
Michael Vogt f8ffa8a258 main: add experimental --use-librepo to support librepo downloads
This commit switches to the librepo enabled `images` library via:
```
go mod -replace github.com/osbuild/iamges=github.com/mvo5/images@librepo-sources-osbuild1974
```
which in turn needs osbuild PR#1974.

With that it then adds a new `--use-librepo` switch that will
enable librepo based downloading so that people can play with
the new backend.
2025-01-17 13:29:01 +00:00

40 lines
1 KiB
Go

package main
import (
"io"
"github.com/osbuild/images/pkg/distro"
"github.com/osbuild/images/pkg/imagefilter"
"github.com/osbuild/images/pkg/osbuild"
"github.com/osbuild/images/pkg/ostree"
"github.com/osbuild/image-builder-cli/internal/blueprintload"
"github.com/osbuild/image-builder-cli/internal/manifestgen"
)
func generateManifest(dataDir, blueprintPath string, res *imagefilter.Result, output io.Writer, ostreeOpts *ostree.ImageOptions, rpmDownloader osbuild.RpmDownloader) error {
repos, err := newRepoRegistry(dataDir)
if err != nil {
return err
}
// XXX: add --rpmmd/cachedir option like bib
mg, err := manifestgen.New(repos, &manifestgen.Options{
Output: output,
RpmDownloader: rpmDownloader,
})
if err != nil {
return err
}
bp, err := blueprintload.Load(blueprintPath)
if err != nil {
return err
}
var imgOpts *distro.ImageOptions
if ostreeOpts != nil {
imgOpts = &distro.ImageOptions{
OSTree: ostreeOpts,
}
}
return mg.Generate(bp, res.Distro, res.ImgType, res.Arch, imgOpts)
}