rpm

package
v1.5.37 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2025 License: Apache-2.0 Imports: 27 Imported by: 2

Documentation

Overview

Package rpm provides an indexer.PackageScanner for the rpm package manager.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewEcosystem

func NewEcosystem(_ context.Context) *indexer.Ecosystem

NewEcosystem provides the set of scanners and coalescers for the rpm ecosystem

Types

type FileChecker added in v1.5.37

type FileChecker struct {
	// contains filtered or unexported fields
}

FileChecker is used to check if a path is an RPM file.

func NewFileChecker added in v1.5.37

func NewFileChecker(ctx context.Context, layer *claircore.Layer) (*FileChecker, error)

NewFileChecker creates a new FileChecker using the file cache to memoize lookups of the set of paths that are RPM files.

func (*FileChecker) IsRPM added in v1.5.37

func (fc *FileChecker) IsRPM(path string) bool

IsRPM returns true if the given path exists in the set of paths that are considered to be RPM files in the layer this FileChecker was created for.

type Info added in v1.4.9

type Info struct {
	Name       string
	Version    string
	Release    string
	SourceNEVR string
	Module     string
	Arch       string
	Digest     string
	Signature  []byte   // This is a PGP signature packet.
	Filenames  []string // Filtered by the [filePatterns] regexp.
	DigestAlgo int
	Epoch      int
}

Info is the package information extracted from the RPM header.

func (*Info) Load added in v1.4.9

func (i *Info) Load(ctx context.Context, h *rpm.Header) error

Load populates the receiver with information extracted from the provided rpm.Header.

type ObjectResponse added in v1.5.36

type ObjectResponse interface {
	[]*claircore.Package | []claircore.File
}

ObjectResponse is a generic object that we're expecting to extract from RPM database, currently either a slice of Packages or Files.

type Scanner

type Scanner struct{}

Scanner implements the scanner.PackageScanner interface.

This looks for directories that look like rpm databases and examines the files it finds there.

The zero value is ready to use.

func (*Scanner) Kind

func (*Scanner) Kind() string

Kind implements scanner.VersionedScanner.

func (*Scanner) Name

func (*Scanner) Name() string

Name implements scanner.VersionedScanner.

func (*Scanner) Scan

func (ps *Scanner) Scan(ctx context.Context, layer *claircore.Layer) ([]*claircore.Package, error)

Scan attempts to find rpm databases within the layer and enumerate the packages there.

A return of (nil, nil) is expected if there's no rpm database.

func (*Scanner) Version

func (*Scanner) Version() string

Version implements scanner.VersionedScanner.

Directories

Path Synopsis
Package bdb provides support for read-only access to an RPM database using the BerkeleyDB "hash" format.
Package bdb provides support for read-only access to an RPM database using the BerkeleyDB "hash" format.
internal
rpm
Package rpm contains some internal helpers for working with RPM databases.
Package rpm contains some internal helpers for working with RPM databases.
Package ndb provides support for read-only access to an RPM "ndb" database.
Package ndb provides support for read-only access to an RPM "ndb" database.
Package sqlite extracts RPM package information from SQLite databases.
Package sqlite extracts RPM package information from SQLite databases.

Jump to

Keyboard shortcuts

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