internal/rosa: enforce exclusions
All checks were successful
Test / Create distribution (push) Successful in 1m5s
Test / Sandbox (push) Successful in 2m57s
Test / Hakurei (push) Successful in 3m48s
Test / ShareFS (push) Successful in 3m48s
Test / Sandbox (race detector) (push) Successful in 5m24s
Test / Hakurei (race detector) (push) Successful in 6m28s
Test / Flake checks (push) Successful in 1m24s
All checks were successful
Test / Create distribution (push) Successful in 1m5s
Test / Sandbox (push) Successful in 2m57s
Test / Hakurei (push) Successful in 3m48s
Test / ShareFS (push) Successful in 3m48s
Test / Sandbox (race detector) (push) Successful in 5m24s
Test / Hakurei (race detector) (push) Successful in 6m28s
Test / Flake checks (push) Successful in 1m24s
This restores unexported artifact behaviour. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package kernel-source {
|
||||
description = "unpatched Linux kernel source tree";
|
||||
website = "https://kernel.org";
|
||||
exclude = true;
|
||||
|
||||
version* = "6.12.87";
|
||||
output = remoteTar {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package musl-source {
|
||||
description = "an implementation of the C standard library - source code";
|
||||
exclude = true;
|
||||
|
||||
version* = "1.2.6";
|
||||
output = remoteTar {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package stage0-dist {
|
||||
description = "Rosa OS stage0 bootstrap seed";
|
||||
exclude = true;
|
||||
|
||||
version* = "20260504";
|
||||
output = remoteTar {
|
||||
|
||||
@@ -384,14 +384,14 @@ func (s *S) mustRegister(
|
||||
})
|
||||
}
|
||||
|
||||
// Count returns the number of [Artifact] registered to s.
|
||||
func (s *S) Count() int {
|
||||
// count returns the number of [Artifact] registered to s.
|
||||
func (s *S) count() int {
|
||||
return int(s.artifactCount.Load())
|
||||
}
|
||||
|
||||
// Collect returns all [ArtifactH] registered to s.
|
||||
func (s *S) Collect() (handles P) {
|
||||
handles = make(P, 0, s.Count())
|
||||
// CollectAll returns all [ArtifactH] registered to s.
|
||||
func (s *S) CollectAll() (handles P) {
|
||||
handles = make(P, 0, s.count())
|
||||
s.artifacts.Range(func(key, _ any) bool {
|
||||
handles = append(handles, key.(ArtifactH))
|
||||
return true
|
||||
@@ -402,6 +402,23 @@ func (s *S) Collect() (handles P) {
|
||||
return
|
||||
}
|
||||
|
||||
// Collect returns all non-excluded [ArtifactH] registered to s.
|
||||
func (s *S) Collect() (handles P) {
|
||||
handles = make(P, 0, s.count())
|
||||
s.artifacts.Range(func(key, _ any) bool {
|
||||
h := key.(ArtifactH)
|
||||
meta, _ := s.Std().MustLoad(h)
|
||||
if !meta.Exclude {
|
||||
handles = append(handles, h)
|
||||
}
|
||||
return true
|
||||
})
|
||||
slices.SortFunc(handles, func(a, b ArtifactH) int {
|
||||
return strings.Compare(a.String(), b.String())
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
// deferredGit is a call to Toolchain.newTagRemote from azalea.
|
||||
type deferredGit struct {
|
||||
url string
|
||||
@@ -915,6 +932,7 @@ func (ctx *evalContext) pf(
|
||||
k("description"): &meta.Description,
|
||||
k("website"): &meta.Website,
|
||||
k("version"): &meta.Version,
|
||||
k("exclude"): &meta.Exclude,
|
||||
k("anitya"): &anitya,
|
||||
k("latest"): &meta.latest,
|
||||
|
||||
|
||||
Reference in New Issue
Block a user