Documentation
¶
Overview ¶
Package specs provides abstractions and utilities for accessing and parsing RPM spec files associated with components in Azure Linux projects.
Responsibilities ¶
This package is responsible for:
- Defining the ComponentSpec interface, which abstracts access to a component's build specification (spec file), including methods for parsing and retrieving the spec.
- Providing the ComponentSpecDetails type, which encapsulates parsed information about a component's spec, leveraging the underlying RPM spec parsing utilities.
- Implementing logic to ensure spec files are accessible in a local or isolated environment, and to parse them in a way that honors the component's build configuration (macros, with/without flags, etc.).
- Integrating with the broader azldev environment (azldev.Env) and project configuration (projectconfig.ComponentConfig) to provide context-sensitive spec handling.
Usage Context ¶
This package is used by higher-level command implementations and tooling that need to inspect, validate, or operate on component spec files as part of build, analysis, or maintenance workflows. It ensures that spec parsing is performed in an environment that matches the target distro and component configuration, using mock and isolated environments as needed.
Design Notes ¶
- Spec parsing is performed using a mock isolated environment to avoid side effects and to ensure correctness.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ComponentSpec ¶
type ComponentSpec interface {
// Parse parses the spec and returns the component's information. The spec is parsed in an
// isolated environment set up to match the component's configuration. Note that this function
// may be computationally intensive and/or time-consuming.
Parse() (specInfo *ComponentSpecDetails, err error)
// GetPath ensures that the spec is locally available, and then provides a path to it. Invoking this
// function may fail if an error occurs while preparing the spec for local access.
GetPath() (path string, err error)
}
ComponentSpec provides abstract access to the build specification of a software component.
func NewSpec ¶
func NewSpec(env *azldev.Env, componentConfig projectconfig.ComponentConfig) ComponentSpec
type ComponentSpecDetails ¶
ComponentSpecDetails encapsulates detailed information extracted from a component's specification.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package specs_testutils is a generated GoMock package.
|
Package specs_testutils is a generated GoMock package. |