pkg-manager.sh: Add -y support to command refresh

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2017-06-28 09:27:11 +00:00
commit 91fca8e791

View file

@ -68,9 +68,26 @@ cmd_install()
cmd_refresh() cmd_refresh()
{ {
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 case $ID in
opensuse|suse) opensuse|suse)
eval run sudo $env zypper $global_opts refresh "$@" [ "$non_interactive" = 1 ] && {
global_opts="$global_opts --non-interactive --gpg-auto-import-keys --no-gpg-checks"
}
eval run sudo $env zypper $global_opts refresh $opts "$@"
;; ;;
debian) debian)
eval run sudo $env apt-get $global_opts update "$@" eval run sudo $env apt-get $global_opts update "$@"