forked from rosa/hakurei
internal/rosa/package: migrate remaining trivial packages
The rest are migrated individually. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -189,6 +189,8 @@ type S struct {
|
||||
|
||||
// Target architecture.
|
||||
arch string
|
||||
// For matching arch-specific values.
|
||||
identArch unique.Handle[azalea.Ident]
|
||||
// For initialising arch.
|
||||
archOnce sync.Once
|
||||
|
||||
@@ -227,6 +229,7 @@ func (s *S) wantsArch() {
|
||||
s.archOnce.Do(func() {
|
||||
if s.arch == "" {
|
||||
s.arch = runtime.GOARCH
|
||||
s.identArch = unique.Make(azalea.Ident(s.arch))
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -245,6 +248,7 @@ func (s *S) DropCaches(targetArch string, flags int) {
|
||||
}
|
||||
|
||||
s.arch = targetArch
|
||||
s.identArch = unique.Make(azalea.Ident(s.arch))
|
||||
s.opts = flags
|
||||
for i := range s.c {
|
||||
s.c[i].Clear()
|
||||
@@ -422,10 +426,7 @@ func (s *S) getFrame() azalea.Frame {
|
||||
return unique.Make(azalea.Ident(name))
|
||||
}
|
||||
|
||||
var (
|
||||
identDefault = k("default")
|
||||
identArch = k(s.arch)
|
||||
)
|
||||
var identDefault = k("default")
|
||||
|
||||
enumCompress := map[unique.Handle[azalea.Ident]]any{
|
||||
k("uncompressed"): uint32(pkg.TarUncompressed),
|
||||
@@ -434,6 +435,7 @@ func (s *S) getFrame() azalea.Frame {
|
||||
}
|
||||
|
||||
s.frame.Val = map[unique.Handle[azalea.Ident]]any{
|
||||
k("triple"): s.triple(),
|
||||
k("linuxArch"): s.linuxArch(),
|
||||
k("earlyLDFLAGS"): s.earlyLDFLAGS(false),
|
||||
|
||||
@@ -625,7 +627,7 @@ func (s *S) getFrame() azalea.Frame {
|
||||
fallback = arg.V
|
||||
continue
|
||||
|
||||
case identArch:
|
||||
case s.identArch:
|
||||
return arg.V, true, nil
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user