From ad3e09a291a56aa4d46efc3f950dfa81d9b41ecc Mon Sep 17 00:00:00 2001 From: WXbet <57314510+WXbet@users.noreply.github.com> Date: Mon, 24 Feb 2020 16:09:55 +0100 Subject: [PATCH] Convert s3.TUP back as a plugin for s3 (v0.10.5) let s3.TUP be what it is from s3's point of view, a plugin --- s3 | 3 +-- support/functions/_misc | 2 +- support/functions/_plugin_update_toolchain | 24 ++++++++++++---------- support/functions/_toolchain | 6 +++--- 4 files changed, 18 insertions(+), 17 deletions(-) diff --git a/s3 b/s3 index a92e3ed..24382aa 100755 --- a/s3 +++ b/s3 @@ -68,7 +68,7 @@ declare -a SHORT_READERS; declare -a SHORT_CARD_READERS; declare -A INTERNAL_ #filled arrays config_cases=( all addons protocols readers card_readers ); -s3opts=( help cedit clean enable_emu fix_me tccheck tcrepair tcupdate upload update_me update_emu lang_select loadonly checkout ssh_profiles syscheck sysinfo svnup menu get_patch tedit svnpatch profiles svnrestore update ); # extendable with plugins +s3opts=( help cedit clean enable_emu fix_me tccheck tcrepair upload update_me update_emu lang_select loadonly checkout ssh_profiles syscheck sysinfo svnup menu get_patch tedit svnpatch profiles svnrestore update ); # extendable with plugins CUSTOM_CONFDIR="not_set"; pf_name="not_set"; UPX="not_set"; @@ -198,7 +198,6 @@ else else _nl;clear;_toolchain_repair "$2";sleep 2;exit; fi;; - tcupdate) _nl;clear;tcupdate "$2" "$3" "$4" "1";sleep 2;exit;; upload) if [ ! -n "$2" ];then _nl; clear; diff --git a/support/functions/_misc b/support/functions/_misc index a22a04a..a64ff0a 100644 --- a/support/functions/_misc +++ b/support/functions/_misc @@ -192,7 +192,7 @@ _select_menu(){ s3cfg_menu; _select_menu;; TCUPDATE) - tcupdate; + tcupdate "" "" "" "1"; _select_menu;; LANG) lang_select; diff --git a/support/functions/_plugin_update_toolchain b/support/functions/_plugin_update_toolchain index 6c71d8d..1af71f5 100755 --- a/support/functions/_plugin_update_toolchain +++ b/support/functions/_plugin_update_toolchain @@ -1,7 +1,9 @@ #!/bin/bash +#simplebuild_plugin tcupdate + tcupdate(){ - pversion="0.10.4"; + pversion="0.10.5"; pname="s3.TUP"; pdesc="Plugin $pname v$pversion"; configname="$configdir/plugin_update_toolchain.config"; @@ -9,7 +11,7 @@ tcupdate(){ CMDTC="$1"; OPTION1="$2"; OPTION2="$3"; - FLAG="$4"; + [ "$4" == "" ] && FLAG="0" || FLAG="$4"; #1 - tcupdate call from s3 menu; clear && _check_bin; @@ -47,16 +49,16 @@ tcupdate(){ if [ "$CMDTC" == "-c" ] || [ "$CMDTC" == "--create" ];then #start toolchain builder menu _create_tc "$OPTION1" "" "$FLAG"; - [ "$FLAG" == "2" ] && return || bye; + [ "$FLAG" == "1" ] && return || bye; elif [ "$CMDTC" == "-s" ] || [ "$CMDTC" == "--setup" ];then #setup crosstool-NG _create_tc "" "$CMDTC" "$FLAG"; bye; elif [ "$CMDTC" == "-b" ] || [ "$CMDTC" == "--backup" ];then #backup toolchain if _check_toolchain "$OPTION1";then _backup "$OPTION1" "$OPTION1" >/dev/null; - [ "$FLAG" == "2" ] && return || bye; + [ "$FLAG" == "1" ] && return || bye; else - _nl && [ "$FLAG" == "2" ] && sleep 2 && return || exit; + _nl && [ "$FLAG" == "1" ] && sleep 2 && return || exit; fi; elif [ "$CMDTC" == "-d" ] || [ "$CMDTC" == "--duplicate" ];then #duplicate toolchain if _check_toolchain "$OPTION1";then @@ -86,7 +88,7 @@ tcupdate(){ [ $COUNT -eq 0 ] && MENU_OPTIONS+=("" "no toolchains found" "no toolchains found") && counter; fi; clear;clear; - out=$("$gui" "$st_" "$bt_" "$title_ - \Z0$pdesc\Zn" "--colors" "--item-help" "--help-tags" "--default-item" "$tc" "--ok-label" "Update" "--cancel-label" "Create" "--help-button" "--help-label" "$([ "$FLAG" == "1" ] && echo "Exit" || echo "Back")" "--extra-button" "--extra-label" "Backup" "--title" "-[ Toolchain Menu ]-" \ + out=$("$gui" "$st_" "$bt_" "$title_ - \Z0$pdesc\Zn" "--colors" "--item-help" "--help-tags" "--default-item" "$tc" "--ok-label" "Update" "--cancel-label" "Create" "--help-button" "--help-label" "$([ ! "$FLAG" == "1" ] && echo "Exit" || echo "Back")" "--extra-button" "--extra-label" "Backup" "--title" "-[ Toolchain Menu ]-" \ --menu "\nSelect one of the installed tool chains that you want to update:\n " \ "${COUNT+10}" 0 0 "${MENU_OPTIONS[@]}"); ret="$?"; @@ -98,7 +100,7 @@ tcupdate(){ 1) #Start crosstool-NG _create_tc;; 2) #Exit - [ "$FLAG" == "1" ] && bye || return;; + [ "$FLAG" == "1" ] && return || bye;; 3) #Duplicate toolchain _check_toolchain $tc && _backup "$tc" "$tc" >/dev/null || [ "$CMDTC" == "" ] && sleep 2 && tcupdate "$CMDTC" "$OPTION1" "$OPTION2" "$FLAG" || _nl && exit; sleep 2;; @@ -110,7 +112,7 @@ tcupdate(){ #toolchain native not supported and exists check if ! _check_toolchain $tc;then - [ "$CMDTC" == "" ] && sleep 2 && tcupdate "$CMDTC" "$OPTION1" "$OPTION2" "$FLAG" || _nl && [ "$FLAG" == "2" ] && sleep 2 && return || exit; + [ "$CMDTC" == "" ] && sleep 2 && tcupdate "$CMDTC" "$OPTION1" "$OPTION2" "$FLAG" || _nl && [ "$FLAG" == "1" ] && sleep 2 && return || exit; fi; #load toolchain config @@ -133,7 +135,7 @@ tcupdate(){ prefixdir="$PWD" pkg=$(find * | grep -m1 "/pkgconfig") && pkgdir="$prefixdir/$pkg" || pkgdir="$prefixdir"; - [ "$FLAG" == "2" ] && backxit=1 || backxit=$menu_close; + [ "$FLAG" == "1" ] && backxit=1 || backxit=$menu_close; unset menu_close; while [ ! $menu_close ] do @@ -226,7 +228,7 @@ tcupdate(){ #Reopen previous menu [ ${#OPTION1} -gt 0 ] && exit; - [ "$FLAG" == "2" ] && return; + [ "$FLAG" == "1" ] && return; if [ ${#opts} -gt 0 ];then tcupdate "$tc" "$OPTION1" "$OPTION2" "$backxit"; else @@ -275,7 +277,7 @@ _create_tc(){ [ $COUNT -eq 0 ] && MENU_OPTIONS+=("" "no templates found" "no templates found") && counter; clear;clear; - opts=$("$gui" "$st_" "$bt_" "$title_ - \Z0$pdesc\Zn" "--colors" "--item-help" "--help-tags" "--default-item" "$tpl" "--ok-label" "Start" "--cancel-label" "Setup" "--help-button" "--help-label" "$([ "$3" == "1" ] && echo "Exit" || echo "Back")" "--title" "-[ Cross Toolchain Template Menu ]-" "$cl_"\ + opts=$("$gui" "$st_" "$bt_" "$title_ - \Z0$pdesc\Zn" "--colors" "--item-help" "--help-tags" "--default-item" "$tpl" "--ok-label" "Start" "--cancel-label" "Setup" "--help-button" "--help-label" "$([ ! "$3" == "1" ] && echo "Exit" || echo "Back")" "--title" "-[ Cross Toolchain Template Menu ]-" "$cl_"\ "\nSelect on of the templates to create the cross toolchain you want:\n\n\Z1NOTE: If you create a cross toolchain from a template with a red colored description, an existing one with the same name will be replaced without asking!\Zn" \ "${COUNT+11}" 0 0 "${MENU_OPTIONS[@]}"); ret="$?"; diff --git a/support/functions/_toolchain b/support/functions/_toolchain index c12db84..a3ce96a 100644 --- a/support/functions/_toolchain +++ b/support/functions/_toolchain @@ -11,10 +11,10 @@ _toolchain_build_menu(){ CONFIGURE) _toolchain_config_menu;; UPDATE) - tcupdate "$_toolchainname" "" "" "2"; + tcupdate "$_toolchainname" "" "" "1"; _toolchain_build_menu;; BACKUP) - tcupdate "-b" "$_toolchainname" "" "2"; + tcupdate "-b" "$_toolchainname" "" "" "1"; _toolchain_build_menu;; EDIT_CONF_DIR) _gtedit; @@ -103,7 +103,7 @@ _toolchain_main_menu(){ ADD) _toolchain_add_menu;; CREATE) - tcupdate "-c" "" "" "2"; + tcupdate "-c" "" "" "1"; _toolchain_main_menu;; REMOVE) _toolchain_remove_menu;;