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

system updater: make all distros use terminal

This commit is contained in:
bbedward
2026-04-29 14:40:16 -04:00
parent baaa30c94e
commit 1467f5dba9
15 changed files with 98 additions and 222 deletions

View File

@@ -17,7 +17,6 @@ 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 {
@@ -70,9 +69,9 @@ func parseZypperXML(out []byte) ([]Package, error) {
return pkgs, nil
}
func (zypperBackend) Upgrade(ctx context.Context, opts UpgradeOptions, onLine func(string)) error {
func (zypperBackend) UpgradeCommand(opts UpgradeOptions) (string, error) {
if opts.DryRun {
return Run(ctx, []string{"zypper", "--non-interactive", "--dry-run", "update"}, RunOptions{OnLine: onLine})
return "zypper --non-interactive --dry-run update", nil
}
return Run(ctx, []string{"pkexec", "zypper", "--non-interactive", "update"}, RunOptions{OnLine: onLine})
return "sudo zypper --non-interactive update", nil
}