mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-15 03:53:32 +01:00
pkg-manager.sh: Add -y support to command refresh
Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
37dbe0a32f
commit
91fca8e791
1 changed files with 18 additions and 1 deletions
|
|
@ -68,9 +68,26 @@ cmd_install()
|
|||
|
||||
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
|
||||
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)
|
||||
eval run sudo $env apt-get $global_opts update "$@"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue