Documentation
¶
Index ¶
Constants ¶
const ( // PackageTypeSRPM is the [PackageListResult.Type] value for source packages (SRPMs). PackageTypeSRPM = "srpm" // PackageTypeRPM is the [PackageListResult.Type] value for binary packages (RPMs). PackageTypeRPM = "rpm" )
Variables ¶
This section is empty.
Functions ¶
func NewPackageListCommand ¶
NewPackageListCommand constructs the cobra.Command for "package list".
Types ¶
type ListPackageOptions ¶
type ListPackageOptions struct {
// All selects all packages that appear in any package-group or component package override.
All bool
// RPMFile is the path to a JSON RPM source map file (array of {packageName, sourcePackageName}
// records). When set, all source packages (SRPMs) and their binary RPMs are resolved and listed.
RPMFile string
// PackageNames contains specific binary package names to look up.
// If a package is not in any explicit config it is still resolved using project defaults.
PackageNames []string
// SynthesizeDebugPackages, when true, augments the result list with synthetic
// '-debuginfo' packages (one per reported package, using a parallel publish
// channel derived from the original package's publish channel by appending
// '-debuginfo', except when the original channel is "" or "none") and synthetic
// '-debugsource' packages (one per component in the project configuration,
// using the component's resolved publish channel after applying the same
// debug-channel derivation logic).
SynthesizeDebugPackages bool
}
ListPackageOptions controls which packages are enumerated by ListPackages.
type PackageListResult ¶
type PackageListResult struct {
// PackageName is the RPM Name tag (binary or source package name).
PackageName string `json:"packageName" table:"Package"`
// Type is the package type: [PackageTypeSRPM] for source packages, [PackageTypeRPM] for binary
// packages. Always [PackageTypeRPM] for '-a' and '-p' lookups; either value for '--rpm-file'.
Type string `json:"type" table:"Type"`
// PackageGroups lists every package-group whose 'packages' list contains this package,
// sorted alphabetically for deterministic output. Always serialized as an empty JSON
// array (never null) when there are no memberships. SRPMs have no package-group
// membership in the config model and therefore always have an empty list here.
PackageGroups []string `json:"packageGroups" table:"Package Groups"`
// ComponentGroups lists every component-group the package's resolved component belongs
// to, sorted alphabetically for deterministic output. Always serialized as an empty
// JSON array (never null) when there are no memberships.
ComponentGroups []string `json:"componentGroups" table:"Component Groups"`
// Component is the resolved component name for this package.
// When using '-a' or '-p', it is the component with an explicit [projectconfig.ComponentConfig.Packages]
// override for this package, or the component whose name matches the package name, or empty if
// no component association can be determined.
Component string `json:"component" table:"Component"`
// Channel is the resolved publish channel after applying all config layers.
// Empty means no channel has been configured.
Channel string `json:"publishChannel" table:"Publish Channel"`
}
PackageListResult holds the resolved configuration for a single binary package or source package.
func ListPackages ¶
func ListPackages(env *azldev.Env, options *ListPackageOptions) ([]PackageListResult, error)
ListPackages returns the resolved PackageListResult for the packages selected by options.
If ListPackageOptions.All is true, all packages with explicit configuration (via package groups or component projectconfig.ComponentConfig.Packages maps) are included.
If ListPackageOptions.RPMFile is set, all source packages and their binary RPMs from the JSON file are resolved. Each SRPM uses projectconfig.ComponentPublishConfig.SRPMChannel from its matching component; each RPM uses the full package-level publish-channel stack with the JSON-derived component association.
Specific package names in ListPackageOptions.PackageNames are always resolved regardless of whether they have explicit configuration.