@ -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="$?";