forked from rosa/hakurei
internal/rosa: annotate blocked updates
These situations, while unfortunate, are inevitable at a larger scale. This change enables annotation and optional hiding of blocked updates. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -360,7 +360,10 @@ func main() {
|
||||
)
|
||||
|
||||
{
|
||||
var flagJobs int
|
||||
var (
|
||||
flagJobs int
|
||||
flagNoBlock bool
|
||||
)
|
||||
c.NewCommand("updates", command.UsageInternal, func([]string) error {
|
||||
var (
|
||||
errsMu sync.Mutex
|
||||
@@ -379,6 +382,11 @@ func main() {
|
||||
continue
|
||||
}
|
||||
|
||||
if !flagNoBlock && meta.Blocked != "" {
|
||||
msg.Verbosef("%s is blocked: %s", meta.Name, meta.Blocked)
|
||||
continue
|
||||
}
|
||||
|
||||
v, err := meta.GetVersions(ctx)
|
||||
if err != nil {
|
||||
errsMu.Lock()
|
||||
@@ -419,9 +427,23 @@ func main() {
|
||||
&flagJobs,
|
||||
"j", command.IntFlag(32),
|
||||
"Maximum number of simultaneous connections",
|
||||
).Flag(
|
||||
&flagNoBlock,
|
||||
"ignore-block", command.BoolFlag(false),
|
||||
"Inhibit update blocking",
|
||||
)
|
||||
}
|
||||
|
||||
c.NewCommand("blocked", command.UsageInternal, func([]string) error {
|
||||
for _, p := range rosa.Native().CollectAll() {
|
||||
meta, _ := rosa.Native().Std().Load(p)
|
||||
if meta.Blocked != "" {
|
||||
fmt.Printf("%s: %s\n", meta.Name, meta.Blocked)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
})
|
||||
|
||||
c.NewCommand(
|
||||
"daemon",
|
||||
"Service artifact IR with Rosa OS extensions",
|
||||
|
||||
Reference in New Issue
Block a user