internal/rosa: bind anitya functions
All checks were successful
Test / Create distribution (push) Successful in 1m5s
Test / Sandbox (push) Successful in 2m46s
Test / ShareFS (push) Successful in 3m47s
Test / Hakurei (push) Successful in 3m54s
Test / Sandbox (race detector) (push) Successful in 5m26s
Test / Hakurei (race detector) (push) Successful in 6m27s
Test / Flake checks (push) Successful in 1m20s
All checks were successful
Test / Create distribution (push) Successful in 1m5s
Test / Sandbox (push) Successful in 2m46s
Test / ShareFS (push) Successful in 3m47s
Test / Hakurei (push) Successful in 3m54s
Test / Sandbox (race detector) (push) Successful in 5m26s
Test / Hakurei (race detector) (push) Successful in 6m27s
Test / Flake checks (push) Successful in 1m20s
This is far more scalable than individual fields. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -3,7 +3,7 @@ package perl {
|
|||||||
website = "https://www.perl.org";
|
website = "https://www.perl.org";
|
||||||
anitya = 13599;
|
anitya = 13599;
|
||||||
// odd-even versioning
|
// odd-even versioning
|
||||||
anityaFallback = true;
|
latest = anityaFallback;
|
||||||
|
|
||||||
version* = "5.42.2";
|
version* = "5.42.2";
|
||||||
source = remoteTar {
|
source = remoteTar {
|
||||||
@@ -86,7 +86,7 @@ package perl-SGMLS {
|
|||||||
description = "class for postprocessing the output from the sgmls and nsgmls parsers";
|
description = "class for postprocessing the output from the sgmls and nsgmls parsers";
|
||||||
website = "https://metacpan.org/release/RAAB/SGMLSpm-1.1";
|
website = "https://metacpan.org/release/RAAB/SGMLSpm-1.1";
|
||||||
anitya = 389576;
|
anitya = 389576;
|
||||||
anityaLegacyCPAN = true;
|
latest = anityaLegacyCPAN;
|
||||||
|
|
||||||
version* = "1.1";
|
version* = "1.1";
|
||||||
source = remoteCPAN {
|
source = remoteCPAN {
|
||||||
|
|||||||
@@ -439,6 +439,21 @@ func (s *S) getFrame() azalea.Frame {
|
|||||||
k("jobsFlagE"): jobsFlagE,
|
k("jobsFlagE"): jobsFlagE,
|
||||||
k("jobsLE"): jobsLE,
|
k("jobsLE"): jobsLE,
|
||||||
k("jobsLFlagE"): jobsLFlagE,
|
k("jobsLFlagE"): jobsLFlagE,
|
||||||
|
|
||||||
|
k("anityaFallback"): (*Versions).getStable,
|
||||||
|
k("anityaLegacyCPAN"): func(v *Versions) string {
|
||||||
|
for _, e := range v.Stable {
|
||||||
|
_, m, ok := strings.Cut(e, ".")
|
||||||
|
if !ok {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if len(m) > 1 && m[0] == '0' {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
return e
|
||||||
|
}
|
||||||
|
return v.Latest
|
||||||
|
},
|
||||||
}
|
}
|
||||||
s.frame.Func = map[unique.Handle[azalea.Ident]]azalea.F{
|
s.frame.Func = map[unique.Handle[azalea.Ident]]azalea.F{
|
||||||
|
|
||||||
@@ -795,15 +810,13 @@ func (ctx *evalContext) pf(
|
|||||||
helper Helper
|
helper Helper
|
||||||
|
|
||||||
inputs, runtimes azalea.Array
|
inputs, runtimes azalea.Array
|
||||||
|
|
||||||
anityaFallback bool
|
|
||||||
anityaLegacyCPAN bool
|
|
||||||
)
|
)
|
||||||
if err = args.Apply(map[unique.Handle[azalea.Ident]]any{
|
if err = args.Apply(map[unique.Handle[azalea.Ident]]any{
|
||||||
k("description"): &meta.Description,
|
k("description"): &meta.Description,
|
||||||
k("website"): &meta.Website,
|
k("website"): &meta.Website,
|
||||||
k("version"): &meta.Version,
|
k("version"): &meta.Version,
|
||||||
k("anitya"): &anitya,
|
k("anitya"): &anitya,
|
||||||
|
k("latest"): &meta.latest,
|
||||||
|
|
||||||
k("writable"): &attr.Writable,
|
k("writable"): &attr.Writable,
|
||||||
k("chmod"): &attr.Chmod,
|
k("chmod"): &attr.Chmod,
|
||||||
@@ -821,9 +834,6 @@ func (ctx *evalContext) pf(
|
|||||||
k("exec"): &helper,
|
k("exec"): &helper,
|
||||||
k("inputs"): &inputs,
|
k("inputs"): &inputs,
|
||||||
k("runtime"): &runtimes,
|
k("runtime"): &runtimes,
|
||||||
|
|
||||||
k("anityaFallback"): &anityaFallback,
|
|
||||||
k("anityaLegacyCPAN"): &anityaLegacyCPAN,
|
|
||||||
}); err != nil {
|
}); err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -835,24 +845,6 @@ func (ctx *evalContext) pf(
|
|||||||
}
|
}
|
||||||
|
|
||||||
meta.ID = int(anitya)
|
meta.ID = int(anitya)
|
||||||
if anityaFallback {
|
|
||||||
meta.latest = (*Versions).getStable
|
|
||||||
} else if anityaLegacyCPAN {
|
|
||||||
meta.latest = func(v *Versions) string {
|
|
||||||
for _, s := range v.Stable {
|
|
||||||
_, m, ok := strings.Cut(s, ".")
|
|
||||||
if !ok {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
if len(m) > 1 && m[0] == '0' {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
return s
|
|
||||||
}
|
|
||||||
return v.Latest
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if output != nil {
|
if output != nil {
|
||||||
v = cachedArtifact{&meta, output}
|
v = cachedArtifact{&meta, output}
|
||||||
set = true
|
set = true
|
||||||
|
|||||||
Reference in New Issue
Block a user