Skip to content

Commit

Permalink
Merge pull request #219 from icy/issue-214-wrong-fetch-option-on-bsd-…
Browse files Browse the repository at this point in the history
…and-macports

{pkgng,macports}: Missing shift when -w is used
  • Loading branch information
icy committed Jan 5, 2022
2 parents 0c3277b + 91491fc commit 09f5174
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion lib/00_core.sh
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,10 @@ _translate_all() {

local_debug="$(_translate_debug)" || return 1
local_noconfirm="$(_translate_noconfirm)" || return 1
local_args="$(_translate_w)" || return 1

# WARNING: Order does matter, see also
# https://github.com/icy/pacapt/pull/219#issuecomment-1006079629
local_args="$(_translate_w)" || return 1
local_args="${local_args}${local_noconfirm:+ }${local_noconfirm}"
local_args="${local_args}${local_debug:+ }${local_debug}"

Expand Down
4 changes: 2 additions & 2 deletions lib/apk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ apk_S() {
case ${_EOPT} in
# Download only
("fetch") shift
apk fetch $_TOPT -- "$@" ;;
(*) apk add $_TOPT -- "$@" ;;
apk fetch $_TOPT "$@" ;;
(*) apk add $_TOPT "$@" ;;
esac
}

Expand Down
1 change: 1 addition & 0 deletions lib/macports.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ macports_Scc() {

macports_S() {
if [ "$_TOPT" = "fetch" ]; then
shift
port patch "$@"
else
port install "$@"
Expand Down
1 change: 1 addition & 0 deletions lib/pkgng.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ pkgng_Scc() {
pkgng_S() {
# shellcheck disable=SC2153
if [ "$_EOPT" = "fetch" ]; then
shift
pkg fetch "$@"
else
pkg install "$@"
Expand Down

0 comments on commit 09f5174

Please sign in to comment.