Browse Source

Convert s3.TUP plugin to s3 module (v0.10.0) (#12)

* Convert s3.TUP plugin to s3 module (v0.10.0)
integrate toolchain updater in then Main Menu
replace copy functionality in Toolchain Menu with backup function
new commandline options:
	./s3 tcupdate -b/--backup TOOLCHAIN-NAME #create backup archive in download folder
	./s3 tcupdate -d/--duplicate TOOLCHAIN-NAME NEW-TOOLCHAIN-NAME #create a copy of toolchain

* extend command line parameters (v0.10.1)
better support for scripted cross toolchain creation
new commandline options:
./s3 tcupdate -c/--create TEMPLATE-NAME #create cross toolchain based on given template name
./s3 tcupdate -s/--setup #installs build environment of crosstool-NG

* extend command line parameters (v0.10.2)
better support for scripted cross toolchain creation
new commandline options:
./s3 tcupdate TOOLCHAIN-NAME LIBRARY-KEY-1,LIBRARY-KEY-2,LIBRARY-KEY-n #update the specified toolchain with the specified libraries

* code optimization (v0.10.3)
pull/14/head
WXbet 5 years ago
committed by GitHub
parent
commit
cf009dd0ad
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      s3
  2. 5
      support/functions/_misc
  3. 241
      support/functions/_plugin_update_toolchain
  4. 1
      support/translation/de
  5. 1
      support/translation/en

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 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 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
CUSTOM_CONFDIR="not_set"; CUSTOM_CONFDIR="not_set";
pf_name="not_set"; pf_name="not_set";
UPX="not_set"; UPX="not_set";
@ -198,6 +198,7 @@ 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;

5
support/functions/_misc

@ -172,7 +172,7 @@ _select_menu(){
revision_="$(REVISION)"; revision_="$(REVISION)";
_menutext="Simplebuild V$SIMPLEVERSION by Gorgone"; _menutext="Simplebuild V$SIMPLEVERSION by Gorgone";
smenu=$( smenu=$(
"$gui" "$st_" "$bt_" "$title_" "$nc_" --title "-[ $txt_start_menu ]-" --menu "\n $_menutext" 13 55 7 "Continue" "$txt_firstmenu_continue r$revision_" "CHANGE" "$txt_firstmenu_chose" "CEDIT" "$txt_firstmenu_cedit" "LANG" "$txt_firstmenu_lang" "EXIT" "$txt_firstmenu_exit"); "$gui" "$st_" "$bt_" "$title_" "$nc_" --title "-[ $txt_start_menu ]-" --menu "\n $_menutext" 13 55 7 "Continue" "$txt_firstmenu_continue r$revision_" "CHANGE" "$txt_firstmenu_chose" "CEDIT" "$txt_firstmenu_cedit" "TCUPDATE" "$txt_firstmenu_tcupdate" "LANG" "$txt_firstmenu_lang" "EXIT" "$txt_firstmenu_exit");
[ $? = 255 ] && _select_menu; [ $? = 255 ] && _select_menu;
case $smenu in case $smenu in
Continue) Continue)
@ -191,6 +191,9 @@ _select_menu(){
CEDIT) CEDIT)
s3cfg_menu; s3cfg_menu;
_select_menu;; _select_menu;;
TCUPDATE)
tcupdate;
_select_menu;;
LANG) LANG)
lang_select; lang_select;
cd "$workdir"; cd "$workdir";

241
support/functions/_plugin_update_toolchain

@ -1,17 +1,20 @@
#!/bin/bash #!/bin/bash
#simplebuild_plugin tcupdate (s3.TUP)
tcupdate(){ tcupdate(){
clear && _check_bin; pversion="0.10.2";
pversion="0.9.3";
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";
#remove config CMDTC="$1";
if [ "$1" == "-r" ] || [ "$1" == "--reset" ];then OPTION1="$2";
OPTION2="$3";
FLAG="$4";
clear && _check_bin;
#backup config
if [ "$CMDTC" == "-r" ] || [ "$CMDTC" == "--reset" ];then
if [ -f "$configname" ];then if [ -f "$configname" ];then
if ! _check_github_api_limits 12; then if ! _check_github_api_limits 12; then
echo -e "$y_l""RESET -> Moving existing config file...""$re_"; echo -e "$y_l""RESET -> Moving existing config file...""$re_";
@ -42,10 +45,31 @@ tcupdate(){
#check config #check config
_check_config; _check_config;
if [ "$1" == "-c" ] || [ "$1" == "--create" ];then if [ "$CMDTC" == "-c" ] || [ "$CMDTC" == "--create" ];then #start toolchain builder menu
_create_tc; _create_tc "$OPTION1" "" "$FLAG";
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;
bye; bye;
elif [ "$1" == "" ];then else
_nl && exit;
fi;
elif [ "$CMDTC" == "-d" ] || [ "$CMDTC" == "--duplicate" ];then #duplicate toolchain
if _check_toolchain "$OPTION1";then
! _check_toolchain "$OPTION2" && _toolchain_repair "$(_backup "$OPTION1" "$OPTION2")" || echo -e "\n\n$r_l $txt_error:$y_l $OPTION2$w_l Toolchain already exists!""$rs_" && _nl && exit;
bye;
else
_nl && exit;
fi;
elif [ "$CMDTC" == "" ];then
unset menu_close;
while [ ! $menu_close ]
do
#TOOLCHAIN MENU
_fill_tc_array; _fill_tc_array;
unset MENU_OPTIONS;COUNT=0 unset MENU_OPTIONS;COUNT=0
if [ "$systype" == "ok" ];then if [ "$systype" == "ok" ];then
@ -61,49 +85,37 @@ tcupdate(){
fi; fi;
[ $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;
out=$("$gui" "$st_" "$bt_" "$title_ - \Z0$pdesc\Zn" "--colors" "--item-help" "--help-tags" "--default-item" "$3" "--ok-label" "Update" "--cancel-label" "Create" "--help-button" "--help-label" "Exit" "--extra-button" "--extra-label" "Copy" "--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="$?";
tc=$(echo "$out" | awk '{printf $1}'); tc=$(echo "$out" | awk '{printf $1}');
case $ret in case $ret in
0) #Update toolchain 0) #Update toolchain
tc_menu="1";; menu_close="1";;
1) #Start crosstool 1) #Start crosstool-NG
tc_menu="2"; _create_tc;;
_create_tc;
tcupdate "" "0" "$tc";;
2) #Exit 2) #Exit
bye;; [ "$FLAG" == "1" ] && bye || return;;
3) #Copy toolchain 3) #Duplicate toolchain
[ ! "$tc" == "" ] && _toolchain_repair "$(_copy "$tc")" || echo -e "$r_l $txt_error:$y_l $tc$w_l Toolchain $txt_n_installed""$rs_"; _check_toolchain $tc && _backup "$tc" "$tc" >/dev/null || [ "$CMDTC" == "" ] && sleep 2 && tcupdate "$CMDTC" "$OPTION1" "$OPTION2" "$FLAG" || _nl && exit;
sleep 2; sleep 2;;
tcupdate "" "0" "$tc";;
esac; esac;
done;
else else
tc="$1" tc="$CMDTC";
[ "$2" == "" ] && tc_menu="0" || tc_menu="$2";
fi; fi;
#toolchain native not supported #toolchain native not supported and exists check
if [ "$tc" == "native" ];then if ! _check_toolchain $tc;then
echo -e "$r_l $txt_error:$y_l $tc$w_l Toolchain library update not supported!""$rs_"; [ "$CMDTC" == "" ] && sleep 2 && tcupdate "$CMDTC" "$OPTION1" "$OPTION2" "$FLAG" || _nl && exit;
_nl;
exit;
fi; fi;
#toolchain exists check #load toolchain config
[ -f "$tccfgdir/$tc" ] && source "$tccfgdir/$tc"; [ -f "$tccfgdir/$tc" ] && source "$tccfgdir/$tc";
if [ -d "$tcdir/$tc/bin" ];then
cd "$tcdir/$tc/bin"; cd "$tcdir/$tc/bin";
else
echo -e "$r_l $txt_error:$y_l $tc$w_l Toolchain $txt_n_installed""$rs_";
[ "$1" == "" ] && sleep 2 && tcupdate "" "0" "$tc";
_nl;
exit;
fi;
#autodetect toolchain's sysroot, prefix, include, pkgconfig folder #autodetect toolchain's sysroot, prefix, include, pkgconfig folder
compilername="$_compiler""gcc";compilername=$(realpath -s $compilername); compilername="$_compiler""gcc";compilername=$(realpath -s $compilername);
@ -121,7 +133,12 @@ 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";
#build menu items from config file backxit=$menu_close;
unset menu_close;
while [ ! $menu_close ]
do
cd "$prefixdir"
#LIBRARY UPDATE MENU
unset MENU_OPTIONS;COUNT=0;unset libs; unset MENU_OPTIONS;COUNT=0;unset libs;
for i in "${LIBS[@]}" for i in "${LIBS[@]}"
do do
@ -149,29 +166,22 @@ tcupdate(){
done; done;
[ $COUNT -eq 0 ] && MENU_OPTIONS+=("" "no libraries found" "no libraries found") && counter; [ $COUNT -eq 0 ] && MENU_OPTIONS+=("" "no libraries found" "no libraries found") && counter;
opts=$("$gui" "--item-help" "--help-tags" "$st_" "$bt_" "$title_ - \Z0$pdesc\Zn" "--colors" "--default-item" "$3" "--ok-label" "Start" "--help-button" "--help-label" "Info" "--cancel-label" "$([ "$tc_menu" == "1" ] && echo "Back" || echo "Exit")" "--title" "-[ Library Update Menu - \Z2$tc\Zn ]-" "$cl_"\ if [ ${#OPTION1} -gt 0 ];then #Force build library call
opts=$(echo "$OPTION1" | tr ',' "\n");
ret="0";
else
clear;clear;
opts=$("$gui" "--item-help" "--help-tags" "$st_" "$bt_" "$title_ - \Z0$pdesc\Zn" "--colors" "--default-item" "$lkey" "--ok-label" "Start" "--help-button" "--help-label" "Info" "--cancel-label" "$([ "$backxit" == "1" ] && echo "Back" || echo "Exit")" "--title" "-[ Library Update Menu - \Z2$tc\Zn ]-" "$cl_"\
"\nSelect all libraries to update in toolchain's SYSROOT folder:\n$prefixdir\n\n library version NEW CURRENT" \ "\nSelect all libraries to update in toolchain's SYSROOT folder:\n$prefixdir\n\n library version NEW CURRENT" \
"${COUNT+12}" 70 0 "${MENU_OPTIONS[@]}"); "${COUNT+12}" 70 0 "${MENU_OPTIONS[@]}");
ret="$?"
fi;
#SSL select check #SSL select check
[ $(echo $opts | tr ' ' '\n' | grep -c "SSL_") -gt 1 ] && echo -e $r_l"\n\nPlease select only one SSL version!"$re_ && sleep 3 && tcupdate $tc; [ $(echo $opts | tr ' ' '\n' | grep -c "SSL_") -gt 1 ] && echo -e $r_l"\n\nPlease select only one SSL version!"$re_ && sleep 3 && [ ${#OPTION1} -gt 0 ] && menu_close=1 && continue;
#HELP section case $ret in
first=$(echo "$opts" | awk '{printf $1}'); 0) #Start - Build library
libkey=$(echo "$opts" | awk '{printf $2}';);
if [ "$first" == "HELP" ];then
sp=$(printf '%*s' 90 | tr ' ' '=');
txt=$(cat "$configname" | grep ""$libkey"=\|"$libkey"_");
bcd=$(cat "$configname" | grep ""$libkey"_tasks");
txt=$(echo -e "Toolchain: $tcdir/$tc\nCompiler: $compilername\nSysroot: $sr\nPrefix: $prefixdir\nInclude: $incdir\n$sp\n\nLibrary configuration:\n$txt\n\nBuild command:\n$(_replace_tokens "$(_tidy_tasks "$bcd" "$libkey")")");
tempfile=$(mktemp) && echo -e "$txt" > "$tempfile";
"$gui" "$st_" "$nc_" "$bt_" "$title_ - \Z0$pdesc\Zn" "--colors" "--textbox" "$tempfile" 30 80;
rm "$tempfile" 2>/dev/null;
tcupdate $tc $tc_menu $libkey;
fi;
#BUILD section
ts=$(date +%F)_$(date +%T); ts=$(date +%F)_$(date +%T);
tmpdir="/tmp/lib_source/$ts"; tmpdir="/tmp/lib_source/$ts";
icount=$(echo $opts | wc -w);i=0; icount=$(echo $opts | wc -w);i=0;
@ -188,19 +198,39 @@ tcupdate(){
task=$(_replace_tokens "$task"); #replace tokens task=$(_replace_tokens "$task"); #replace tokens
buildtasks+=("$task"); buildtasks+=("$task");
done done
_build "($i/$icount) $tc: library ${lib[1]} ${lib[2]}" $(_extract $(_dl "${lib[6]}" "${lib[1]} ${lib[2]}") "$tmpdir") "$logfile" "${buildtasks[@]}"; _build "($i/$icount) $tc: library ${lib[1]} ${lib[2]}" $(_extract $(_dl "${lib[6]}" "${lib[1]} ${lib[2]}") "$tmpdir" 2>/dev/null) "$logfile" "${buildtasks[@]}";
done; done;
[ "${#buildtasks[@]}" == "0" ] && echo -e "$r_l $txt_error:$y_l $o$w_l Library not found in config file""$rs_";
done;
[ -d "$tmpdir" ] && rm -r "$tmpdir";;
1) #Exit/Back
menu_close="1";;
2) #Info
first=$(echo "$opts" | awk '{printf $1}');
lkey=$(echo "$opts" | awk '{printf $2}';);
if [ "$first" == "HELP" ];then
sp=$(printf '%*s' 90 | tr ' ' '=');
txt=$(cat "$configname" | grep ""$lkey"=\|"$lkey"_");
bcd=$(cat "$configname" | grep ""$lkey"_tasks");
txt=$(echo -e "Toolchain: $tcdir/$tc\nCompiler: $compilername\nSysroot: $sr\nPrefix: $prefixdir\nInclude: $incdir\n$sp\n\nLibrary configuration:\n$txt\n\nBuild command:\n$(_replace_tokens "$(_tidy_tasks "$bcd" "$lkey")")");
tempfile=$(mktemp) && echo -e "$txt" > "$tempfile";
"$gui" "$st_" "$nc_" "$bt_" "$title_ - \Z0$pdesc\Zn" "--colors" "--ok-label" "Back" "--textbox" "$tempfile" 30 80;
rm "$tempfile" 2>/dev/null;
fi;;
esac;
#Exit loop if build library is forced
[ ${#OPTION1} -gt 0 ] && menu_close=1;
done; done;
[ -d "$tmpdir" ] && rm -r "$tmpdir";
#Reopen update menu #Reopen previous menu
[ ${#OPTION1} -gt 0 ] && exit;
if [ ${#opts} -gt 0 ];then if [ ${#opts} -gt 0 ];then
tcupdate $tc $tc_menu $libkey; tcupdate "$tc" "$OPTION1" "$OPTION2" "$backxit";
else else
[ "$tc_menu" == "1" ] && tcupdate "" "0" "$tc"; [ "$backxit" == "1" ] && tcupdate "" "$OPTION1" "$OPTION2" "$FLAG" || bye;
fi; fi;
bye;
}; };
_create_tc(){ _create_tc(){
_sz; # Prepare DIALOG settings _sz; # Prepare DIALOG settings
@ -208,6 +238,18 @@ _create_tc(){
ctsrcdir="$ctdir/source"; ctsrcdir="$ctdir/source";
cttpldir="$ctdir/templates"; cttpldir="$ctdir/templates";
#ct-ng must not be run as root unless you forcing it by config
! _check_root && START_BUILD=1 || [ "$CTNG_BUILD_AS_ROOT" == "1" ] && START_BUILD=1 || START_BUILD=0;
local menu_close;
while [ ! $menu_close ]
do
if [ ${#2} -gt 0 ];then #Force setup call
ret="1";
elif [ ${#1} -gt 0 ];then #Force build toolchain call
opts="$1";
ret="0";
else #Show Template Menu
tplempty=0; tplempty=0;
[ ! -d "$cttpldir" ] && mkdir --parents "$cttpldir"; [ ! -d "$cttpldir" ] && mkdir --parents "$cttpldir";
cd "$cttpldir"; cd "$cttpldir";
@ -218,6 +260,7 @@ _create_tc(){
tplempty=1; tplempty=1;
fi; fi;
#CROSS TOOLCHAIN TEMPLATE MENU
unset MENU_OPTIONS;COUNT=0; unset MENU_OPTIONS;COUNT=0;
if [ "$tplempty" == "0" ];then if [ "$tplempty" == "0" ];then
for t in "${TPL_LIST[@]}";do for t in "${TPL_LIST[@]}";do
@ -228,12 +271,14 @@ _create_tc(){
counter; counter;
done; done;
fi; fi;
[ $COUNT -eq 0 ] && MENU_OPTIONS+=("" "no templates found" "no templates found") && counter;
opts=$("$gui" "$st_" "$bt_" "$title_ - \Z0$pdesc\Zn" "--colors" "--item-help" "--help-tags" "--default-item" "$3" "--ok-label" "Start" "--cancel-label" "Setup" "--help-button" "--help-label" "$([ $tc_menu ] && echo "Back" || echo "Exit")" "--title" "-[ Cross Toolchain Template Menu ]-" "$cl_"\ [ $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_"\
"\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="$?";
fi;
case $ret in case $ret in
0) #Start - Build cross toolchain 0) #Start - Build cross toolchain
@ -268,6 +313,7 @@ _create_tc(){
echo -e "cd \"$ctsrcdir\";\n$(_replace_tokens "$bcl")\n$sp" | tee -a "$logfile"; echo -e "cd \"$ctsrcdir\";\n$(_replace_tokens "$bcl")\n$sp" | tee -a "$logfile";
sleep 2; sleep 2;
if [ $START_BUILD -eq 1 ]; then
cd "$ctsrcdir"; cd "$ctsrcdir";
#generate build command list #generate build command list
unset buildtasks; unset buildtasks;
@ -295,15 +341,18 @@ _create_tc(){
_paktc_timer 10; _paktc_timer 10;
fi; fi;
else else
[ "$tpl" == "" ] && echo -e "$r_l $txt_error:$y_l $tc$w_l Template $txt_n_installed""$rs_"; echo -e "$r_l""\nERROR -> The execution of crosstool-NG was aborted\n because it must not run as root!\n""$re_" | tee -a "$logfile";
_paktc_timer 10;
fi;
else
echo -e "$r_l $txt_error:$y_l $tpl$w_l Template $txt_n_installed""$rs_";
sleep 2; sleep 2;
fi; fi;
done; done;
else else
echo -e "$r_l""\nCHECK -> crosstool-NG is not setup correctly. Please run 'Setup' from menu!\n""$re_"; echo -e "$r_l""\nCHECK -> crosstool-NG is not setup correctly. Please run 'Setup' from menu!\n""$re_";
_paktc_timer 10; _paktc_timer 10;
fi; fi;;
_create_tc;;
1) #Setup - Setup crosstool-NG 1) #Setup - Setup crosstool-NG
logfile="$ldir/$(date +%F)_$(date +%T)_update_toolchain_crosstool-NG_setup.log" logfile="$ldir/$(date +%F)_$(date +%T)_update_toolchain_crosstool-NG_setup.log"
( (
@ -312,10 +361,7 @@ _create_tc(){
echo -e "$sp\nbuild command list for crosstool-NG:\n$sp\ncd "$ctsrcdir"\n$(_replace_tokens "$bcl")\n$sp"; echo -e "$sp\nbuild command list for crosstool-NG:\n$sp\ncd "$ctsrcdir"\n$(_replace_tokens "$bcl")\n$sp";
sleep 2; sleep 2;
#ct-ng must not be run as root unless you know what you are doing by forcing it if [ $START_BUILD -eq 1 ]; then
! _check_root && RUN_SETUP=1 || RUN_SETUP=0;
[ "$CTNG_BUILD_AS_ROOT" == "1" ] && RUN_SETUP=1;
if [ $RUN_SETUP -eq 1 ]; then
# setup crosstool wc # setup crosstool wc
echo "Cleanup source directory "$ctsrcdir/"..." echo "Cleanup source directory "$ctsrcdir/"..."
rm -rf "$ctsrcdir" 2>/dev/null; rm -rf "$ctsrcdir" 2>/dev/null;
@ -331,32 +377,36 @@ _create_tc(){
echo -e "\nERROR -> The execution of crosstool-NG was aborted\n because it must not run as root!\n"; echo -e "\nERROR -> The execution of crosstool-NG was aborted\n because it must not run as root!\n";
fi; fi;
) | tee "$logfile" | "$gui" "$st_" "$bt_" "$title_ - \Z0$pdesc\Zn" "--colors" "--title" " -[ Setup crosstool-NG... ]- " "$pb_" "$_lines" "$_cols"; ) | tee "$logfile" | "$gui" "$st_" "$bt_" "$title_ - \Z0$pdesc\Zn" "--colors" "--title" " -[ Setup crosstool-NG... ]- " "$pb_" "$_lines" "$_cols";
_paktc_timer 10; _paktc_timer 10;;
_create_tc;;
2) #Exit 2) #Exit
menu_close="1";
return;; return;;
esac; esac;
#Exit loop if setup or build toolchain are forced
[ ${#2} -gt 0 ] || [ ${#1} -gt 0 ] && menu_close=1;
done;
}; };
_copy(){ _backup(){
_sz; # Prepare DIALOG settings _sz; # Prepare DIALOG settings
nr=$(( $RANDOM % 100 )); src=$1;
newtc="$1-$nr"; dest=$2;
newtccfgfile="$tccfgdir/$newtc"; newtccfgfile="$tccfgdir/$dest";
xzfile="$dldir/Toolchain-$newtc.tar.xz"; xzfile="$dldir/Toolchain-$dest.tar.xz";
( (
#compress toolchain #compress toolchain
_compress "$xzfile" "$tcdir/$1" _compress "$xzfile" "$tcdir/$src"
#create toolchain.cfg #create toolchain.cfg
source "$tccfgdir/$1" && target="${_compiler%?}" && sysroot="$_sysroot" && lsd="$_libsearchdir" && desc="$_description" && info="$_tc_info"; source "$tccfgdir/$src" && target="${_compiler%?}" && sysroot="$_sysroot" && lsd="$_libsearchdir" && desc="$_description" && info="$_tc_info";
_create_toolchaincfg "$tcdir/$1" "$newtc" "$target" "$sysroot" "$lsd" "$desc" "$info" "$xzfile"; _create_toolchaincfg "$tcdir/$src" "$dest" "$target" "$sysroot" "$lsd" "$desc" "$info" "$xzfile";
) | "$gui" "$st_" "$bt_" "$title_ - \Z0$pdesc\Zn" "--colors" "--title" " -[ Copy $1 to $newtc ... ]- " "$pb_" "$_lines" "$_cols"; ) | "$gui" "$st_" "$bt_" "$title_ - \Z0$pdesc\Zn" "--colors" "--title" " -[ Backup $src to $(basename "$xzfile")... ]- " "$pb_" "$_lines" "$_cols";
[ -f "$newtccfgfile" ] && echo "$newtc"; [ -f "$newtccfgfile" ] && echo "$dest";
}; };
_build(){ _build(){
_sz; # Prepare DIALOG settings _sz; # Prepare DIALOG settings
local desc="$1"; # Save 1. argument in a variable local desc="$1"; # Save 1. argument in a variable
local libsrcdir="$2"; # Save 2. argument in a variable local libsrcdir="$2"; # Save 2. argument in a variable
@ -506,6 +556,21 @@ else
fi; fi;
echo -e "\033[2K\r"; #remove characters from console echo -e "\033[2K\r"; #remove characters from console
}; };
_check_toolchain(){
if [ "$1" == "" ];then #toolchain parameter empty
echo -e "\n\n$r_l $txt_error:$y_l Parameter$w_l Toolchain not set!""$rs_";
return 1;
elif [ "$1" == "native" ];then #toolchain native not supported
echo -e "\n\n$r_l $txt_error:$y_l $1$w_l Toolchain library update not supported!""$rs_";
return 1;
elif [ ! -d "$tcdir/$1/bin" ];then #toolchain not installed
echo -e "\n\n$r_l $txt_error:$y_l $1$w_l Toolchain $txt_n_installed""$rs_";
return 1;
else
return 0;
fi;
};
_check_root(){ _check_root(){
! ((${EUID:-0} || "$(id -u)")); ! ((${EUID:-0} || "$(id -u)"));
}; };

1
support/translation/de

@ -57,6 +57,7 @@ txt_help3="Taste [ENTER] zum fortsetzen..."
txt_firstmenu_continue="weiter mit lokalem SVN"; txt_firstmenu_continue="weiter mit lokalem SVN";
txt_firstmenu_chose="anderen SVN Stand (7000+) laden"; txt_firstmenu_chose="anderen SVN Stand (7000+) laden";
txt_firstmenu_cedit="$txt_conf""s Editor starten"; txt_firstmenu_cedit="$txt_conf""s Editor starten";
txt_firstmenu_tcupdate="Toolchain Updater starten";
txt_firstmenu_lang="Systemsprache manuell $txt_sel"; txt_firstmenu_lang="Systemsprache manuell $txt_sel";
txt_firstmenu_exit="simplebuild sofort beenden"; txt_firstmenu_exit="simplebuild sofort beenden";

1
support/translation/en

@ -48,6 +48,7 @@ txt_help3="[ENTER] to continue..."
txt_firstmenu_continue="continue with local SVN"; txt_firstmenu_continue="continue with local SVN";
txt_firstmenu_chose="load a different SVN (7000+)"; txt_firstmenu_chose="load a different SVN (7000+)";
txt_firstmenu_cedit="start configuration editor"; txt_firstmenu_cedit="start configuration editor";
txt_firstmenu_tcupdate="start toolchain updater";
txt_firstmenu_lang="manual system language selection"; txt_firstmenu_lang="manual system language selection";
txt_firstmenu_exit="close simplebuild now"; txt_firstmenu_exit="close simplebuild now";

Loading…
Cancel
Save