parallelized installs

This commit is contained in:
2026-05-27 15:26:34 -05:00
parent 58bf0d4bbe
commit 165f9dbe4f
15 changed files with 1641 additions and 1265 deletions
+13
View File
@@ -23,6 +23,19 @@ func installFlatpakPackages(toInstall []string) {
"https://dl.flathub.org/repo/flathub.flatpakrepo",
}, CmdOpts{AsSudo: true})
if len(toInstall) == 0 {
return
}
// Single batched install — flatpak supports multiple refs per invocation
// and resolves them concurrently internally. Fall back to per-package
// installs on failure so callers see exactly which IDs broke.
argv := append([]string{"flatpak", "install", "--noninteractive", "flathub"}, toInstall...)
fmt.Printf("\n Installing %d Flatpak(s) in one batch ...\n", len(toInstall))
if runCmd(argv, CmdOpts{}).OK() {
return
}
warn("Batched flatpak install failed; retrying per-package to isolate failures ...")
for _, pkgID := range toInstall {
fmt.Printf("\n Installing %s ...\n", pkgID)
res := runCmd([]string{"flatpak", "install", "--noninteractive", "flathub", pkgID}, CmdOpts{})