Browse Source

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
pull/15/head
WXbet 5 years ago
parent
commit
ad3e09a291
  1. 3
      s3
  2. 2
      support/functions/_misc
  3. 24
      support/functions/_plugin_update_toolchain
  4. 6
      support/functions/_toolchain

3
s3

@ -68,7 +68,7 @@ declare -a SHORT_READERS; declare -a SHORT_CARD_READERS; declare -A INTERNAL_
#filled arrays #filled arrays
config_cases=( all addons protocols readers card_readers ); 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"; CUSTOM_CONFDIR="not_set";
pf_name="not_set"; pf_name="not_set";
UPX="not_set"; UPX="not_set";
@ -198,7 +198,6 @@ else
else else
_nl;clear;_toolchain_repair "$2";sleep 2;exit; _nl;clear;_toolchain_repair "$2";sleep 2;exit;
fi;; fi;;
tcupdate) _nl;clear;tcupdate "$2" "$3" "$4" "1";sleep 2;exit;;
upload) if [ ! -n "$2" ];then upload) if [ ! -n "$2" ];then
_nl; _nl;
clear; clear;

2
support/functions/_misc

@ -192,7 +192,7 @@ _select_menu(){
s3cfg_menu; s3cfg_menu;
_select_menu;; _select_menu;;
TCUPDATE) TCUPDATE)
tcupdate; tcupdate "" "" "" "1";
_select_menu;; _select_menu;;
LANG) LANG)
lang_select; lang_select;

24
support/functions/_plugin_update_toolchain

@ -1,7 +1,9 @@
#!/bin/bash #!/bin/bash
#simplebuild_plugin tcupdate
tcupdate(){ tcupdate(){
pversion="0.10.4"; pversion="0.10.5";
pname="s3.TUP"; pname="s3.TUP";
pdesc="Plugin $pname v$pversion"; pdesc="Plugin $pname v$pversion";
configname="$configdir/plugin_update_toolchain.config"; configname="$configdir/plugin_update_toolchain.config";
@ -9,7 +11,7 @@ tcupdate(){
CMDTC="$1"; CMDTC="$1";
OPTION1="$2"; OPTION1="$2";
OPTION2="$3"; OPTION2="$3";
FLAG="$4"; [ "$4" == "" ] && FLAG="0" || FLAG="$4"; #1 - tcupdate call from s3 menu;
clear && _check_bin; clear && _check_bin;
@ -47,16 +49,16 @@ tcupdate(){
if [ "$CMDTC" == "-c" ] || [ "$CMDTC" == "--create" ];then #start toolchain builder menu if [ "$CMDTC" == "-c" ] || [ "$CMDTC" == "--create" ];then #start toolchain builder menu
_create_tc "$OPTION1" "" "$FLAG"; _create_tc "$OPTION1" "" "$FLAG";
[ "$FLAG" == "2" ] && return || bye; [ "$FLAG" == "1" ] && return || bye;
elif [ "$CMDTC" == "-s" ] || [ "$CMDTC" == "--setup" ];then #setup crosstool-NG elif [ "$CMDTC" == "-s" ] || [ "$CMDTC" == "--setup" ];then #setup crosstool-NG
_create_tc "" "$CMDTC" "$FLAG"; _create_tc "" "$CMDTC" "$FLAG";
bye; bye;
elif [ "$CMDTC" == "-b" ] || [ "$CMDTC" == "--backup" ];then #backup toolchain elif [ "$CMDTC" == "-b" ] || [ "$CMDTC" == "--backup" ];then #backup toolchain
if _check_toolchain "$OPTION1";then if _check_toolchain "$OPTION1";then
_backup "$OPTION1" "$OPTION1" >/dev/null; _backup "$OPTION1" "$OPTION1" >/dev/null;
[ "$FLAG" == "2" ] && return || bye; [ "$FLAG" == "1" ] && return || bye;
else else
_nl && [ "$FLAG" == "2" ] && sleep 2 && return || exit; _nl && [ "$FLAG" == "1" ] && sleep 2 && return || exit;
fi; fi;
elif [ "$CMDTC" == "-d" ] || [ "$CMDTC" == "--duplicate" ];then #duplicate toolchain elif [ "$CMDTC" == "-d" ] || [ "$CMDTC" == "--duplicate" ];then #duplicate toolchain
if _check_toolchain "$OPTION1";then if _check_toolchain "$OPTION1";then
@ -86,7 +88,7 @@ tcupdate(){
[ $COUNT -eq 0 ] && MENU_OPTIONS+=("" "no toolchains found" "no toolchains found") && counter; [ $COUNT -eq 0 ] && MENU_OPTIONS+=("" "no toolchains found" "no toolchains found") && counter;
fi; fi;
clear;clear; 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 " \ --menu "\nSelect one of the installed tool chains that you want to update:\n " \
"${COUNT+10}" 0 0 "${MENU_OPTIONS[@]}"); "${COUNT+10}" 0 0 "${MENU_OPTIONS[@]}");
ret="$?"; ret="$?";
@ -98,7 +100,7 @@ tcupdate(){
1) #Start crosstool-NG 1) #Start crosstool-NG
_create_tc;; _create_tc;;
2) #Exit 2) #Exit
[ "$FLAG" == "1" ] && bye || return;; [ "$FLAG" == "1" ] && return || bye;;
3) #Duplicate toolchain 3) #Duplicate toolchain
_check_toolchain $tc && _backup "$tc" "$tc" >/dev/null || [ "$CMDTC" == "" ] && sleep 2 && tcupdate "$CMDTC" "$OPTION1" "$OPTION2" "$FLAG" || _nl && exit; _check_toolchain $tc && _backup "$tc" "$tc" >/dev/null || [ "$CMDTC" == "" ] && sleep 2 && tcupdate "$CMDTC" "$OPTION1" "$OPTION2" "$FLAG" || _nl && exit;
sleep 2;; sleep 2;;
@ -110,7 +112,7 @@ tcupdate(){
#toolchain native not supported and exists check #toolchain native not supported and exists check
if ! _check_toolchain $tc;then 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; fi;
#load toolchain config #load toolchain config
@ -133,7 +135,7 @@ tcupdate(){
prefixdir="$PWD" prefixdir="$PWD"
pkg=$(find * | grep -m1 "/pkgconfig") && pkgdir="$prefixdir/$pkg" || pkgdir="$prefixdir"; 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; unset menu_close;
while [ ! $menu_close ] while [ ! $menu_close ]
do do
@ -226,7 +228,7 @@ tcupdate(){
#Reopen previous menu #Reopen previous menu
[ ${#OPTION1} -gt 0 ] && exit; [ ${#OPTION1} -gt 0 ] && exit;
[ "$FLAG" == "2" ] && return; [ "$FLAG" == "1" ] && return;
if [ ${#opts} -gt 0 ];then if [ ${#opts} -gt 0 ];then
tcupdate "$tc" "$OPTION1" "$OPTION2" "$backxit"; tcupdate "$tc" "$OPTION1" "$OPTION2" "$backxit";
else else
@ -275,7 +277,7 @@ _create_tc(){
[ $COUNT -eq 0 ] && MENU_OPTIONS+=("" "no templates found" "no templates found") && counter; [ $COUNT -eq 0 ] && MENU_OPTIONS+=("" "no templates found" "no templates found") && counter;
clear;clear; 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" \ "\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[@]}"); "${COUNT+11}" 0 0 "${MENU_OPTIONS[@]}");
ret="$?"; ret="$?";

6
support/functions/_toolchain

@ -11,10 +11,10 @@ _toolchain_build_menu(){
CONFIGURE) CONFIGURE)
_toolchain_config_menu;; _toolchain_config_menu;;
UPDATE) UPDATE)
tcupdate "$_toolchainname" "" "" "2"; tcupdate "$_toolchainname" "" "" "1";
_toolchain_build_menu;; _toolchain_build_menu;;
BACKUP) BACKUP)
tcupdate "-b" "$_toolchainname" "" "2"; tcupdate "-b" "$_toolchainname" "" "" "1";
_toolchain_build_menu;; _toolchain_build_menu;;
EDIT_CONF_DIR) EDIT_CONF_DIR)
_gtedit; _gtedit;
@ -103,7 +103,7 @@ _toolchain_main_menu(){
ADD) ADD)
_toolchain_add_menu;; _toolchain_add_menu;;
CREATE) CREATE)
tcupdate "-c" "" "" "2"; tcupdate "-c" "" "" "1";
_toolchain_main_menu;; _toolchain_main_menu;;
REMOVE) REMOVE)
_toolchain_remove_menu;; _toolchain_remove_menu;;

Loading…
Cancel
Save