pkg-manager.sh: Add command dup

Add command dup (dist-upgrade), currently only supported on OpenSUSE.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2026-01-14 18:18:18 +01:00
commit cb2fa0c755

View file

@ -29,6 +29,45 @@ run()
"$@"
}
cmd_dup()
{
local env opts global_opts
local non_interactive
set -- `getopt 'y' $*`
while [ "$1" != -- ] ; do
case "$1" in
-y)
non_interactive=1
;;
esac
shift
done
shift
case $ID in
opensuse|suse)
[ "$non_interactive" = 1 ] && {
opts="--force-resolution --auto-agree-with-licenses"
global_opts="$global_opts --non-interactive --gpg-auto-import-keys --no-gpg-checks"
}
run sudo $env -S zypper $global_opts dup $opts "$@"
;;
debian|ubuntu|raspbian)
fatal "Tried to run distribution upgrade on unsupported platform \"$ID\""
;;
arch)
fatal "Tried to run distribution upgrade on unsupported platform \"$ID\""
;;
centos)
fatal "Tried to run distribution upgrade on unsupported platform \"$ID\""
;;
*)
fatal "Tried to install on unsupported platform \"$ID\""
;;
esac
}
cmd_install()
{
local env opts global_opts