diff --git a/scripts/pkg-manager.sh b/scripts/pkg-manager.sh index ad990e78..ee91b3bb 100644 --- a/scripts/pkg-manager.sh +++ b/scripts/pkg-manager.sh @@ -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