Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib/apk: silently ignore --no-confirm option (fix #150) #151

Merged
merged 2 commits into from
Jun 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* `lib/yum`, `lib/dpkg`, `lib/apk`: Fix #96, #143
by adding `-q` (quiet) option for `Qs`.
* `lib/apk`: `Q` prints version information.
* `lib/apk`: Fix `--noconfirm` issue (#150)

## v2.4.4

Expand Down
15 changes: 8 additions & 7 deletions lib/00_core.sh
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ _translate_debug() {
# Translate the --noconfirm option.
# FIXME: does "yes | pacapt" just help?
_translate_noconfirm() {

echo "$_EOPT" | $GREP -q ":noconfirm:" || return 0

local _opt=
Expand All @@ -196,27 +195,29 @@ _translate_noconfirm() {
"zypper") _opt="--no-confirm";;
"pkgng") _opt="-y";;
"tazpkg") _opt="--auto";;
"apk") _opt="";;
*)
_opt=""
_ret=1
_error "$_PACMAN: Option '--noconfirm' is not supported/implemented."
;;
esac

echo $_opt
return $_ret
echo "$_opt"
return "$_ret"
}

_translate_all() {
local _args=""
local _debug=
local _noconfirm=

_debug="$(_translate_debug)"
_noconfirm="$(_translate_noconfirm)"
_debug="$(_translate_debug)" || return 1
_noconfirm="$(_translate_noconfirm)" || return 1
_args="$(_translate_w)" || return 1
_args="${_args}${_noconfirm:+ }${_noconfirm}" || return 1
_args="${_args}${_debug:+ }${_debug}" || return 1

_args="${_args}${_noconfirm:+ }${_noconfirm}"
_args="${_args}${_debug:+ }${_debug}"

export _EOPT="${_args# }"
}
Expand Down
14 changes: 7 additions & 7 deletions lib/apk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,26 +60,26 @@ apk_Qu() {
}

apk_R() {
apk del -- "$@"
apk del $_TOPT -- "$@"
}

apk_Rn() {
apk del --purge -- "$@"
apk del --purge $_TOPT -- "$@"
}

apk_Rns() {
apk del --purge -r -- "$@"
apk del --purge -r $_TOPT -- "$@"
}

apk_Rs() {
apk del -r -- "$@"
apk del -r $_TOPT -- "$@"
}

apk_S() {
case ${_EOPT} in
# Download only
("fetch") shift
apk fetch -- "$@" ;;
apk fetch $_TOPT -- "$@" ;;
(*) apk add $_TOPT -- "$@" ;;
esac
}
Expand Down Expand Up @@ -129,9 +129,9 @@ apk_Sy() {
}

apk_Sw() {
apk fetch -- "$@"
apk fetch $_TOPT -- "$@"
}

apk_U() {
apk add --allow-untrusted -- "$@"
apk add --allow-untrusted $_TOPT -- "$@"
}