builds

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 15, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Find

func Find(fsys fs.FS, architectures []string) (map[string]BuildGroup, error)

Find walks the given filesystem and returns a map of build groups, where each group is keyed by the origin package name, and contains the origin package and its subpackages. Find expects the filesystem to be laid out just like Melange outputs built APKs, starting with a "packages" directory containing subdirectories for each architecture, and APK files within those subdirectories.

Types

type BuildGroup

type BuildGroup struct {
	// Fsys is the filesystem where the build group was found.
	Fsys fs.FS

	Origin      Package
	Subpackages []Package
}

BuildGroup describes a set of Packages that were produced as a result of a Melange build of a package definition, which includes the origin package and 0-n subpackages as well.

func (BuildGroup) Scan

func (bg BuildGroup) Scan(ctx context.Context, scanner *scan.Scanner, distroID string) ([]scan.Result, error)

Scan uses the provided scan.Scanner to scan the APKs in the build group for vulnerabilities. It returns a slice of scan results, one for each APK in the build group. The first slice member is the result for the origin APK, and the rest are for the subpackages.

type Package

type Package struct {
	// FsysPath is the path to the package file on the filesystem.
	FsysPath string

	// FileInfo is the file info of the package file.
	FileInfo fs.FileInfo

	// PkgInfo is the parsed package information (found in an APK's PKGINFO file).
	PkgInfo *goapk.Package
}

Package describes a built (e.g. by Melange) APK package file that resides on a filesystem.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL