diff --git a/CHANGELOG.md b/CHANGELOG.md index 8842688..9eb571d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## v3.0.7 + +* `lib/{apk,macports,pkgng}`: Fixed fetch option #214 +* `lib/portage`: Fixed syntax error #218 (Thanks @owl4ce) + ## v3.0.6 * New support `Void Linux` (Thanks Tabulate @TabulateJarl8) diff --git a/lib/apk.sh b/lib/apk.sh index c279012..2977746 100644 --- a/lib/apk.sh +++ b/lib/apk.sh @@ -115,7 +115,7 @@ apk_S() { # shellcheck disable=2086 case ${_EOPT} in # Download only - ("fetch") shift + (fetch*) shift apk fetch $_TOPT "$@" ;; (*) apk add $_TOPT "$@" ;; esac diff --git a/lib/macports.sh b/lib/macports.sh index 1f6c5d7..d9f742b 100644 --- a/lib/macports.sh +++ b/lib/macports.sh @@ -81,10 +81,14 @@ macports_Scc() { } macports_S() { - if [ "$_TOPT" = "fetch" ]; then + # shellcheck disable=SC2153 + case "$_EOPT" in + fetch*) shift port patch "$@" - else + ;; + *) port install "$@" - fi + ;; + esac } diff --git a/lib/pkgng.sh b/lib/pkgng.sh index 90752ae..c58f871 100644 --- a/lib/pkgng.sh +++ b/lib/pkgng.sh @@ -99,10 +99,13 @@ pkgng_Scc() { pkgng_S() { # shellcheck disable=SC2153 - if [ "$_EOPT" = "fetch" ]; then + case "$_EOPT" in + fetch*) shift pkg fetch "$@" - else + ;; + *) pkg install "$@" - fi + ;; + esac } diff --git a/pacapt b/pacapt index cb95570..4e8f0ab 100755 --- a/pacapt +++ b/pacapt @@ -3,7 +3,7 @@ # Purpose: A wrapper for all Unix package managers # License: Fair license (http://www.opensource.org/licenses/fair) # Source : http://github.com/icy/pacapt/ -# Version: 3.0.6 +# Version: 3.0.7 # Authors: Anh K. Huynh et al. # Copyright (C) 2010 - 2022 \ @@ -47,7 +47,7 @@ _print_pacapt_version() { cat <<_EOF_ -pacapt version '3.0.6' +pacapt version '3.0.7' Copyright (C) 2010 - 2022 \\ | 10sr (@10sr) @@ -89,7 +89,7 @@ DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY. _EOF_ } -export PACAPT_VERSION='3.0.6' +export PACAPT_VERSION='3.0.7' _help() { cat <<'EOF' @@ -416,8 +416,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}" @@ -595,9 +597,9 @@ apk_S() { # shellcheck disable=2086 case ${_EOPT} in # Download only - ("fetch") shift - apk fetch $_TOPT -- "$@" ;; - (*) apk add $_TOPT -- "$@" ;; + (fetch*) shift + apk fetch $_TOPT "$@" ;; + (*) apk add $_TOPT "$@" ;; esac } @@ -1375,11 +1377,16 @@ macports_Scc() { } macports_S() { - if [ "$_TOPT" = "fetch" ]; then + # shellcheck disable=SC2153 + case "$_EOPT" in + fetch*) + shift port patch "$@" - else + ;; + *) port install "$@" - fi + ;; + esac } @@ -1580,11 +1587,15 @@ pkgng_Scc() { pkgng_S() { # shellcheck disable=SC2153 - if [ "$_EOPT" = "fetch" ]; then + case "$_EOPT" in + fetch*) + shift pkg fetch "$@" - else + ;; + *) pkg install "$@" - fi + ;; + esac } @@ -1779,7 +1790,7 @@ portage_Rs() { } portage_R() { - emerge --depclean "@" + emerge --depclean "$@" } portage_Si() { diff --git a/tests/apk.txt b/tests/apk.txt index 1f933f1..df2235e 100644 --- a/tests/apk.txt +++ b/tests/apk.txt @@ -57,6 +57,9 @@ in -Sy ou ^(fetch|OK) # Download package +in -Swv nano +ou Downloading nano + in -Sw screen ou ^Downloading screen