1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-05-02 10:32:07 -04:00

Revert "system updater: make all distros use terminal"

This reverts commit 1467f5dba9.
This commit is contained in:
bbedward
2026-04-29 14:56:54 -04:00
parent 1467f5dba9
commit 3b96c6ab22
15 changed files with 222 additions and 98 deletions

View File

@@ -17,6 +17,7 @@ func (zypperBackend) ID() string { return "zypper" }
func (zypperBackend) DisplayName() string { return "Zypper" }
func (zypperBackend) Repo() RepoKind { return RepoSystem }
func (zypperBackend) NeedsAuth() bool { return true }
func (zypperBackend) RunsInTerminal() bool { return false }
func (zypperBackend) IsAvailable(_ context.Context) bool { return commandExists("zypper") }
type zypperUpdateList struct {
@@ -69,9 +70,9 @@ func parseZypperXML(out []byte) ([]Package, error) {
return pkgs, nil
}
func (zypperBackend) UpgradeCommand(opts UpgradeOptions) (string, error) {
func (zypperBackend) Upgrade(ctx context.Context, opts UpgradeOptions, onLine func(string)) error {
if opts.DryRun {
return "zypper --non-interactive --dry-run update", nil
return Run(ctx, []string{"zypper", "--non-interactive", "--dry-run", "update"}, RunOptions{OnLine: onLine})
}
return "sudo zypper --non-interactive update", nil
return Run(ctx, []string{"pkexec", "zypper", "--non-interactive", "update"}, RunOptions{OnLine: onLine})
}