Browse Source

update s3

update _gui_build
pull/16/head
gorgone 5 years ago
parent
commit
566560a6d7
  1. 475
      s3
  2. 2
      support/functions/_gui_build

475
s3

@ -1,42 +1,43 @@
#!/bin/bash #!/bin/bash
VERSIONCOUNTER=310 VERSIONCOUNTER=310
SIMPLEVERSION="3.0 RC7";OIFS=$IFS; SIMPLEVERSION="3.0 RC7"
export NCURSES_NO_UTF8_ACS=1; OIFS=$IFS
export NCURSES_NO_UTF8_ACS=1
#set dir_vars #set dir_vars
workdir="$(pwd)"; workdir="$(pwd)"
bindir="$sdir/upx"; bindir="$sdir/upx"
PATH="$bindir:$PATH"; PATH="$bindir:$PATH"
sdir="$workdir/support"; sdir="$workdir/support"
osdir="$sdir/os"; osdir="$sdir/os"
ldir="$sdir/logs"; ldir="$sdir/logs"
adir="$sdir/archive"; adir="$sdir/archive"
configdir="$sdir/configs"; configdir="$sdir/configs"
pdir="$sdir/patches"; pdir="$sdir/patches"
profdir="$sdir/profiles"; profdir="$sdir/profiles"
bdir="$sdir/binaries"; bdir="$sdir/binaries"
dldir="$sdir/downloads"; dldir="$sdir/downloads"
fdir="$sdir/functions"; fdir="$sdir/functions"
menudir="$sdir/menu_save"; menudir="$sdir/menu_save"
bsvn="$sdir/backup_svn"; bsvn="$sdir/backup_svn"
tcdir="$sdir/toolchains"; tcdir="$sdir/toolchains"
tdir="$sdir/translation"; tdir="$sdir/translation"
svndir="$workdir/oscam-svn"; svndir="$workdir/oscam-svn"
tccfgdir="$sdir/toolchains.cfg"; tccfgdir="$sdir/toolchains.cfg"
# create folders # create folders
mkdir -p "$tcdir/native/bin" 2>/dev/null; mkdir -p "$tcdir/native/bin" 2>/dev/null
mkdir -p support/{archive,binaries,downloads,logs,patches,backup_svn,menu_save,upx} 2>/dev/null; mkdir -p support/{archive,binaries,downloads,logs,patches,backup_svn,menu_save,upx} 2>/dev/null
# create links # create links
[ ! -d "$ldir" ] && clear && echo -e "\n folder creation error\n\n" && exit; [ ! -d "$ldir" ] && clear && echo -e "\n folder creation error\n\n" && exit
[ -L "$workdir/logs" ] || ln -sf "$ldir" "$workdir/logs" 2>/dev/null; [ -L "$workdir/logs" ] || ln -sf "$ldir" "$workdir/logs" 2>/dev/null
[ -L "$workdir/archive" ] || ln -sf "$adir" "$workdir/archive" 2>/dev/null; [ -L "$workdir/archive" ] || ln -sf "$adir" "$workdir/archive" 2>/dev/null
[ -L "$workdir/patches" ] || ln -sf "$pdir" "$workdir/patches" 2>/dev/null; [ -L "$workdir/patches" ] || ln -sf "$pdir" "$workdir/patches" 2>/dev/null
[ -L "$workdir/binaries" ] || ln -sf "$bdir" "$workdir/binaries" 2>/dev/null; [ -L "$workdir/binaries" ] || ln -sf "$bdir" "$workdir/binaries" 2>/dev/null
[ -L "$workdir/profiles" ] || ln -sf "$profdir" "$workdir/profiles" 2>/dev/null; [ -L "$workdir/profiles" ] || ln -sf "$profdir" "$workdir/profiles" 2>/dev/null
#set arrays #set arrays
array_names_a=( SHORT_PROTOCOLS SHORT_READERS SHORT_CARD_READERS AVAI_TCLIST array_names_a=( SHORT_PROTOCOLS SHORT_READERS SHORT_CARD_READERS AVAI_TCLIST
@ -44,14 +45,16 @@ array_names_a=( SHORT_PROTOCOLS SHORT_READERS SHORT_CARD_READERS AVAI_TCLIST
ALL_MODULES_LONG ENABLED_MODULES INST_TCLIST SSH_CONF_CONTENT ) ALL_MODULES_LONG ENABLED_MODULES INST_TCLIST SSH_CONF_CONTENT )
array_names_A=( INTERNAL_MODULES USE_vars USE_vars_disable s3cfg_vars ) array_names_A=( INTERNAL_MODULES USE_vars USE_vars_disable s3cfg_vars )
for a_n in "${array_names_a[@]}"; do for a_n in "${array_names_a[@]}"
unset $a_n; do
declare -a $a_n; unset $a_n
declare -a $a_n
done done
for a_n in "${array_names_A[@]}"; do for a_n in "${array_names_A[@]}"
unset $a_n; do
declare -A $a_n; unset $a_n
declare -A $a_n
done done
USE_vars[USE_TARGZ]=; USE_vars[USE_TARGZ]=;
@ -61,15 +64,15 @@ USE_vars[USE_STAPI5]=;
USE_vars[USE_CONFDIR]=; USE_vars[USE_CONFDIR]=;
USE_vars[USE_COMPRESS]=; USE_vars[USE_COMPRESS]=;
s3cfg_vars[USE_TARGZ]=0; s3cfg_vars[USE_TARGZ]=0
s3cfg_vars[DIRECTMENU]=0; s3cfg_vars[DIRECTMENU]=0
s3cfg_vars[USE_VERBOSE]=0; s3cfg_vars[USE_VERBOSE]=0
s3cfg_vars[USE_COMPRESS]=0; s3cfg_vars[USE_COMPRESS]=0
s3cfg_vars[S3_UPDATE_CHECK]=1; s3cfg_vars[S3_UPDATE_CHECK]=1
s3cfg_vars[SAVE_LISTSMARGO]=1; s3cfg_vars[SAVE_LISTSMARGO]=1
s3cfg_vars[ADD_PROFILE_NAME]=0; s3cfg_vars[ADD_PROFILE_NAME]=0
s3cfg_vars[NO_SVN_AUTOUPDATE]=0; s3cfg_vars[NO_SVN_AUTOUPDATE]=0
s3cfg_vars[delete_oscamdebugbinary]=1; s3cfg_vars[delete_oscamdebugbinary]=1
#filled arrays #filled arrays
config_cases=( all addons protocols readers card_readers ); config_cases=( all addons protocols readers card_readers );
@ -77,16 +80,27 @@ s3opts=( cedit checkout clean enable_emu fix_me get_patch help lang_select loado
menu profiles ssh_profiles svnpatch svnrestore svnup syscheck sysinfo tccheck\ menu profiles ssh_profiles svnpatch svnrestore svnup syscheck sysinfo tccheck\
tcrepair tedit update update_emu update_me upload ) # extendable with plugins tcrepair tedit update update_emu update_me upload ) # 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"
#internal vars #internal vars
OPENBOX=0;UFS916003=0;_verbose=""; OPENBOX=0
_t1e="VG9vbGNoYWluLQ=="; UFS916003=0
_u1e="aHR0cDovL3N0cmVhbWJvYXJkLnR2L3diYjIvdHV0LXBpY3MvdG9vbGNoYWlucw=="; _t1e="VG9vbGNoYWluLQ=="
cposx=0; cposy=0; off="_off"; on="_on"; pf="empty"; file_exist="0"; run="0"; _u1e="aHR0cDovL3N0cmVhbWJvYXJkLnR2L3diYjIvdHV0LXBpY3MvdG9vbGNoYWlucw=="
s3cfg="$configdir/simplebuild.config";loadprofile="no";menucall="no";
run="0"
cposx=0
cposy=0
on="_on"
off="_off"
pf="empty"
_verbose=""
menucall="no"
file_exist="0"
loadprofile="no"
s3cfg="$configdir/simplebuild.config"
# Compiler settings # Compiler settings
cc_warn="-W -Wall -Wshadow -Wredundant-decls -Wstrict-prototypes -Wold-style-definition"; cc_warn="-W -Wall -Wshadow -Wredundant-decls -Wstrict-prototypes -Wold-style-definition";
@ -99,175 +113,272 @@ trunkurl="http://www.streamboard.tv/svn/oscam/trunk";
[ -f "$workdir/oscamsource.url" ] && source "$workdir/oscamsource.url"; [ -f "$workdir/oscamsource.url" ] && source "$workdir/oscamsource.url";
#load translationlist #load translationlist
cd "$tdir";langsupport=(*); cd "$tdir"
langsupport=(*)
#load functions and plugins #load functions and plugins
if [ -d "$fdir" ];then if [ -d "$fdir" ]
cd "$fdir"; then
x=(*); cd "$fdir"
for i in "${x[@]}";do x=(*)
source "$i"; for i in "${x[@]}"
plugin=$(awk '/^#simplebuild_plugin/ {printf $2}' $i); do
[ -z "$plugin" ] || s3opts+=($plugin); source "$i"
done; plugin=$(awk '/^#simplebuild_plugin/ {printf $2}' $i)
[ -z "$plugin" ] || s3opts+=($plugin)
done
else else
echo "fail functions"; echo "fail functions"
fi; fi
#initialize simplebuild #initialize simplebuild
initializeANSI; # load colors initializeANSI # load colors
auto_langset; # echo "info $txt_load_ok"; auto_langset # echo "info $txt_load_ok";
# check system ######################################################### # check system #########################################################
syscheck;[ ! "$sanity" == "1" ] && echo "sanity fail" && sleep 5 && bye; syscheck
[ ! "$sanity" == "1" ] && echo "sanity fail" && sleep 5 && bye
######################################################################## ########################################################################
_create_native_profile; # put native datas to toolchains and configs _create_native_profile # put native datas to toolchains and configs
_get_config_con "$1"; # echo $addons;exit; _get_config_con "$1" # echo $addons;exit;
_create_module_arrays; # fill module arrays _create_module_arrays # fill module arrays
_fill_tc_array; # get # AVAI_TCLIST # INST_TCLIST # MISS_TCLIST _fill_tc_array # get # AVAI_TCLIST # INST_TCLIST # MISS_TCLIST
read_s3cfg; # read simplebuild config read_s3cfg # read simplebuild config
_set_dialog_types; # fill $gui vars _set_dialog_types # fill $gui vars
_systype; # check used uname _systype # check used uname
if [ ! -n "$1" ];then if [ -z "$1" ]
[ "${s3cfg_vars[DIRECTMENU]}" == "1" ] && _dialog_checkout && exit; then
_help; exit; [ "${s3cfg_vars[DIRECTMENU]}" == "1" ] && _dialog_checkout && exit
_help
exit
else else
for e in "${s3opts[@]}";do for e in "${s3opts[@]}"
if [ "$e" == "$1" ];then do
if [ "$e" == "$1" ]
then
case $e in case $e in
fix_me|checkout|update_me|update_emu|svnrestore|enable_emu|upload_cam) fix_me|checkout|update_me|update_emu|svnrestore|enable_emu|upload_cam)
if [ ! -n "$2" ];then if [ ! -n "$2" ]
eval "$e"; then
eval "$e"
else else
eval "$e" "$2"; eval "$e" "$2"
fi; exit;; fi
exit;;
menu) menu)
if [ ! -n "$2" ];then if [ ! -n "$2" ]
_dialog_checkout; then
_dialog_checkout
else else
_dialog_checkout "$2"; _dialog_checkout "$2"
fi;; fi;;
loadonly) loadonly)
if [ ! -n "$2" ];then if [ ! -n "$2" ]
_nl; clear; s3logo; then
echo -e "$r_l\n $txt_error: toolchain $txt_parameter $txt_missing\n""$w_l"; _nl
_help_toolchain; sleep 2; exit; clear
s3logo
echo -e "$r_l\n $txt_error: toolchain $txt_parameter $txt_missing\n""$w_l"
_help_toolchain
sleep 2
exit
else else
for t in "${AVAI_TCLIST[@]}";do for t in "${AVAI_TCLIST[@]}"
_tmp="$2"; do
[ "$t" == "$2" ] && _load_toolchain "$2" && break; _tmp="$2"
done; [ "$t" == "$2" ] && _load_toolchain "$2" && break
if [ -f "$tc_dl" ];then done
echo -e "$p_l\n\n toolchain for $_tmp loaded\n"; if [ -f "$tc_dl" ]
then
echo -e "$p_l\n\n toolchain for $_tmp loaded\n"
else else
_nl; clear; s3logo; _nl
echo -e "$r_l toolchain missing/error\n"; clear
fi; exit; s3logo
printf "$r_l toolchain missing/error\n"
fi
exit
fi;; fi;;
tccheck) tccheck)
if [ ! -n "$2" ];then if [ ! -n "$2" ]
_nl; clear; s3logo; then
echo -e "$r_l\n $txt_error: toolchain $txt_parameter $txt_missing\n""$w_l"; _nl
_help_toolchain;echo -e "$W"; sleep 2; exit; clear
s3logo
printf "$r_l\n $txt_error: toolchain $txt_parameter $txt_missing\n""$w_l"
_help_toolchain
printf "$W"
sleep 2
exit
else else
for t in "${AVAI_TCLIST[@]}";do for t in "${AVAI_TCLIST[@]}"
[ "$t" == "$2" ] && _toolchain_check "$2" && break; do
done; [ "$t" == "$2" ] && _toolchain_check "$2" && break
_nl; clear; s3logo; done
echo -e "$r_l\n toolchain missing/error\n$w_l"; _nl
_help_toolchain;echo -e "$W"; sleep 2; exit; clear
s3logo
printf "$r_l\n toolchain missing/error\n$w_l"
_help_toolchain
echo -e "$W"
sleep 2
exit
fi;; fi;;
tcrepair) tcrepair)
if [ ! -n "$2" ];then if [ ! -n "$2" ];then
_nl; clear; s3logo; _nl
echo -e "$r_l\n $txt_error: toolchain $txt_parameter $txt_missing\n""$w_l"; clear
_help_toolchain;echo -e "$W"; sleep 2; exit; s3logo
printf "$r_l\n $txt_error: toolchain $txt_parameter $txt_missing\n""$w_l"
_help_toolchain
printf "$W"
sleep 2
exit
else else
_nl;clear;_toolchain_repair "$2";sleep 2;exit; _nl
clear
_toolchain_repair "$2"
sleep 2
exit
fi;; fi;;
upload) upload)
if [ ! -n "$2" ];then if [ ! -n "$2" ]
_nl; clear; s3logo; then
echo -e "$r_l\n $txt_error: $txt_parameter $txt_missing""$w_l"; _nl
menucall="yes"; ssh_profiles; clear
s3logo
echo -e "$r_l\n $txt_error: $txt_parameter $txt_missing""$w_l"
menucall="yes"
ssh_profiles
else else
upload_cam "$2"; upload_cam "$2"
fi; exit;; fi
exit;;
syscheck) syscheck)
syscheck silent $2; exit;; syscheck silent $2
exit;;
tedit) tedit)
if [ -n "$2" ];then if [ -n "$2" ]
for telement in ${INST_TCLIST[@]};do then
if [ "$telement" == "$2" ];then for telement in ${INST_TCLIST[@]}
tedit $2; exit; do
fi; if [ "$telement" == "$2" ]
done; then
clear; s3logo; echo -e $w_l"\n $2 toolchain not installed\n"$W; tedit $2
fi; exit;; exit
fi
done
clear
s3logo
printf "$w_l\n $2 toolchain not installed\n"$W
fi
exit;;
help) help)
_help; exit;; _help
exit;;
*) *)
shift && eval "$e" "$@"; #Remove the first command line argument and pass the remaining ones to the plugin shift && eval "$e" "$@"; #Remove the first command line argument and pass the remaining ones to the plugin
exit;; exit;;
esac; esac
fi;
done; fi
done
for t in "${AVAI_TCLIST[@]}";do
if [ "$t" == "$1" ];then for t in "${AVAI_TCLIST[@]}"
if [ "${2:0:3}" == "-p=" ] || [ "${2:0:3}" == "-P=" ];then do
if [ -f "$profdir/${2#*=}" ];then
pf=$(cat "$profdir/${2#*=}"); if [ "$t" == "$1" ]
pf_name="${2#*=}"; then
fi;
fi; if [ "${2:0:3}" == "-p=" ] || [ "${2:0:3}" == "-P=" ]
if [ "${3:0:3}" == "-p=" ] || [ "${3:0:3}" == "-P=" ];then then
if [ -f "$profdir/${2#*=}" ];then if [ -f "$profdir/${2#*=}" ]
pf=$(cat "$profdir/${2#*=}"); then
pf_name="${2#*=}"; pf=$(cat "$profdir/${2#*=}")
fi; pf_name="${2#*=}"
fi; fi
if [ "${2:0:5}" == "-upx=" ] || [ "${2:0:5}" == "-UPX=" ];then fi
UPX=${2#*=};USE_vars[USE_COMPRESS]="USE_COMPRESS=1";
fi; if [ "${3:0:3}" == "-p=" ] || [ "${3:0:3}" == "-P=" ]
if [ "${3:0:5}" == "-upx=" ] || [ "${3:0:5}" == "-UPX=" ];then then
UPX=${2#*=};USE_vars[USE_COMPRESS]="USE_COMPRESS=1"; if [ -f "$profdir/${2#*=}" ]
fi; then
pf=$(cat "$profdir/${2#*=}")
pf_name="${2#*=}"
fi
fi
if [ "${2:0:5}" == "-upx=" ] || [ "${2:0:5}" == "-UPX=" ]
then
UPX=${2#*=};USE_vars[USE_COMPRESS]="USE_COMPRESS=1"
fi
if [ "${3:0:5}" == "-upx=" ] || [ "${3:0:5}" == "-UPX=" ]
then
UPX=${2#*=}
USE_vars[USE_COMPRESS]="USE_COMPRESS=1"
fi
[ "$pf" == "empty" ] && c_m_d="$*" || c_m_d="all_off $pf $*"; # set only active module with profiles [ "$pf" == "empty" ] && c_m_d="$*" || c_m_d="all_off $pf $*"; # set only active module with profiles
for cmd in $c_m_d;do for cmd in $c_m_d
if [ "${cmd:0:3}" == "-c=" ] || [ "${cmd:0:3}" == "-C=" ];then do
CUSTOM_CONFDIR="${cmd#*=}";
fi; if [ "${cmd:0:3}" == "-c=" ] || [ "${cmd:0:3}" == "-C=" ]
if [ "${cmd:0:5}" == "-upx=" ] || [ "${cmd:0:5}" == "-UPX=" ];then then
UPX="${cmd#*=}";USE_vars[USE_COMPRESS]="USE_COMPRESS=1"; CUSTOM_CONFDIR="${cmd#*=}"
fi; fi
for cc in "${config_cases[@]}";
if [ "${cmd:0:5}" == "-upx=" ] || [ "${cmd:0:5}" == "-UPX=" ]
then
UPX="${cmd#*=}"
USE_vars[USE_COMPRESS]="USE_COMPRESS=1"
fi
for cc in "${config_cases[@]}"
do do
[ "$cmd" == "$cc$on" ] && all_cc+=($cc$on) && break; [ "$cmd" == "$cc$on" ] && all_cc+=($cc$on) && break
[ "$cmd" == "$cc$off" ] && all_cc+=($cc$off) && break; [ "$cmd" == "$cc$off" ] && all_cc+=($cc$off) && break
done; done
for sm in "${SHORT_MODULENAMES[@]}";
for sm in "${SHORT_MODULENAMES[@]}"
do do
[ "$cmd" == "$sm" ] && all_cc+=($(get_module_name "$sm")$on) && break; [ "$cmd" == "$sm" ] && all_cc+=($(get_module_name "$sm")$on) && break
[ "$cmd" == "$sm$off" ] && all_cc+=($(get_module_name "$sm")$off) && break; [ "$cmd" == "$sm$off" ] && all_cc+=($(get_module_name "$sm")$off) && break
done; done
for uvar in "${!USE_vars[@]}";
for uvar in "${!USE_vars[@]}"
do do
[ "$cmd" == "$uvar" ] && USE_vars[$uvar]="$uvar=1" && break; [ "$cmd" == "$uvar" ] && USE_vars[$uvar]="$uvar=1" && break
[ "$cmd" == "$uvar$off" ] && USE_vars_disable[$uvar]="$uvar=1" && break; [ "$cmd" == "$uvar$off" ] && USE_vars_disable[$uvar]="$uvar=1" && break
done; done
case $cmd in case $cmd in
OPENBOX) OPENBOX=1;; OPENBOX) OPENBOX=1;;
UFS916003) UFS916003=1;; UFS916003) UFS916003=1;;
USE_VERBOSE) s3cfg_vars[USE_VERBOSE]=1;; USE_VERBOSE) s3cfg_vars[USE_VERBOSE]=1;;
esac; esac
done;
_pre_build "$t"; done
exit; _pre_build "$t"
fi; exit
done; fi
_help;
fi; done
exit; _help
fi
exit

2
support/functions/_gui_build

@ -90,7 +90,7 @@ _gui_build(){
|tee "$ldir/$log_name" \ |tee "$ldir/$log_name" \
|grep --line-buffered -v 'BFD\|^/' \ |grep --line-buffered -v 'BFD\|^/' \
|grep --line-buffered '^CC\|^GEN\|UseFlags\| CONF_DIR =\|Binary\|LINK\|STRIP\|BUILD\|Addons\|Protocols\|Readers\|CardRdrs\|^/' \ |grep --line-buffered '^CC\|^GEN\|UseFlags\| CONF_DIR =\|Binary\|LINK\|STRIP\|BUILD\|Addons\|Protocols\|Readers\|CardRdrs\|^/' \
|sed -u "s/^|/ |/g;s/^LINK/ | LINK >/g;s/^STRIP/ | STRIP >/g;s/^CC\|^BUILD/ | BUILD >/g;s/^GEN/ | GEN >/g;s/WEBIF_//g;s/WITH_//g;s/MODULE_//g;s/CS_//g;s/HAVE_//g;s/_CHARSETS//g;s/CW_CYCLE_CHECK/CWCC/g;s/SUPPORT//g;" |sed -u "s/^|/ |/g;s/^LINK/ | LINK >/g;s/^STRIP/ | STRIP >/g;s/^CC\|^BUILD/ | BUILD >/g;s/^GEN/ | GEN >/g;s/WEBIF_//g;s/WITH_//g;s/MODULE_//g;s/CS_//g;s/HAVE_//g;s/_CHARSETS//g;s/CW_CYCLE_CHECK/CWCC/g;s/SUPPORT//g;s/=/:/g;"
timer_stop timer_stop
timer_calc timer_calc

Loading…
Cancel
Save