diff --git a/s3 b/s3 index c757d00..448e14a 100755 --- a/s3 +++ b/s3 @@ -1,7 +1,7 @@ #!/bin/bash -VERSIONCOUNTER=336 -SIMPLEVERSION="2024.04" +VERSIONCOUNTER=340 +SIMPLEVERSION="2024.05" OIFS=$IFS export NCURSES_NO_UTF8_ACS=1 @@ -102,9 +102,9 @@ s3cfg_vars[delete_oscamdebugbinary]=1 #filled arrays config_cases=( all addons protocols readers card_readers ); -s3opts=( cedit checkout clean enable_emu fix_me get_patch help lang_select loadonly\ +s3opts=( cedit checkout clean disable_emu enable_emu fix_me get_patch help lang_select loadonly\ menu profiles ssh_profiles repopatch reporestore repoup syscheck sysinfo tccheck\ - tcrepair tedit update update_emu update_me upload ) # extendable with plugins + tcrepair tedit update update_me upload ) # extendable with plugins CUSTOM_CONFDIR="not_set" pf_name="not_set" @@ -137,10 +137,12 @@ cc_opts="-ggdb -pipe -ffunction-sections -fdata-sections -fomit-frame-pointer -f #compiling options for optimizing #cc_opts="-ggdb -pipe -ffunction-sections -fdata-sections -o nodeadcode -ffast-math -fomit-frame-pointer -fthread-jumps -foptimize-strlen --no-inline" -#default url -trunkurl="https://git.streamboard.tv/common/oscam.git" +#load default urls +source "$configdir/urls" +#load custom urls [ -f "$workdir/oscamsource.url" ] && source "$workdir/oscamsource.url" +[ -f "$workdir/EMU_ON" ] && trunkurl="$emuurl" # switch trunkurl based on environment variable SOURCE # needs an existing oscamsource.url file containing trunkurl="some url" @@ -218,7 +220,7 @@ else case $e in - fix_me|checkout|update_me|update_emu|reporestore|enable_emu|upload_cam) + fix_me|checkout|update_me|reporestore|disable_emu|enable_emu|upload_cam) if [ ! -n "$2" ] then eval "$e" diff --git a/support/configs/urls b/support/configs/urls index 0738902..c13c9c3 100644 --- a/support/configs/urls +++ b/support/configs/urls @@ -1,2 +1,3 @@ -s3url="https://github.com/gorgone/s3_releases.git"; -emuurl="https://github.com/oscam-emu/oscam-emu.git"; + s3url="https://github.com/gorgone/s3_releases.git"; +trunkurl="https://git.streamboard.tv/common/oscam.git" + emuurl="https://github.com/oscam-emu/oscam-patched.git"; diff --git a/support/functions/_emu b/support/functions/_emu index 4e25a8b..ff3060b 100644 --- a/support/functions/_emu +++ b/support/functions/_emu @@ -2,55 +2,15 @@ enable_emu(){ clear - s3logo - if [ -d "${repodir}" ] - then - printf "$w_l quickreporestore $G$txt_wait\n" - quickreporestore - else - printf "$w_l checkout $G$txt_wait\n" - checkout - fi - - pname="oscam-emu.patch" - source "$configdir/urls" - emulocal="$dldir/emu_github" - - if [ -f "$emulocal/oscam-emu.patch" ] - then - printf "$w_l Emu Revision : $y_l" - grep '\+#define EMU_VERSION' "$emulocal/oscam-emu.patch" |cut -d " " -f 3 - if [ -f "$emulocal/$pname" ] - then - cp -rf "$emulocal/$pname" "${repodir}" - fi - fi - - _nl - printf $re_ - cd ${repodir} - printf $(date)>"$workdir/patch.log" - patch -p0 < $pname |tee -a "$workdir/patch.log" \ - |grep --line-buffered -v '^[0-9]\|^/' \ - |sed -e "s@^patching file@$Y patching file $WH----->$C@g;" \ - |sed -e "s@^Hunk@$P Hunk@g;" \ - |sed -e "s@FAILED@"$R"FAILED@g;" \ - |sed -e "s@succeeded@"$WH"succeeded@g;" - - fcount=0 - fcount=$(grep -o 'FAILED at' -i "$workdir/patch.log" | wc -l) - hcount=0; - hcount=$(grep -o 'Hunk #' -i "$workdir/patch.log" | wc -l) - if [ ! "$fcount" == "0" ] || [ ! "$hcount" == "0" ] - then - printf "\n$WH Patch Result\n ------------\n Hunk Count : $hcount\n" - printf " Fail Count : $fcount\n\n" - # todo ask for restore svn yes / no / show log -else - printf "\n$WH Patch Status :$G CLEAN \n" + trunkurl="$emuurl" touch "$workdir/EMU_ON" -fi + check_url "$trunkurl" && checkout 2>/dev/null +} - printf $re_ - _nl +disable_emu(){ + clear + source "$configdir/urls" + [ -f "$workdir/oscamsource.url" ] && source "$workdir/oscamsource.url" + [ -f "$workdir/EMU_ON" ] && rm -f "$workdir/EMU_ON" + check_url "$trunkurl" && checkout 2>/dev/null } diff --git a/support/functions/_git b/support/functions/_git index 4662765..acb3c7f 100644 --- a/support/functions/_git +++ b/support/functions/_git @@ -33,7 +33,6 @@ gitcheckout(){ rm -rf "$fc1" _nl [ -f "$workdir/${REPO^^}-IS-PATCHED" ] && rm -f "$workdir/${REPO^^}-IS-PATCHED" - [ -f "$workdir/EMU_ON" ] && rm -f "$workdir/EMU_ON" tar_repo } @@ -92,7 +91,6 @@ _dialog_checkout1_git(){ reset_="$("${repodir}/config.sh" -R)" printf "Revision: $(REVISION) done..." [ -f "$workdir/${REPO^^}-IS-PATCHED" ] && rm -f "$workdir/${REPO^^}-IS-PATCHED" - [ -f "$workdir/EMU_ON" ] && rm -f "$workdir/EMU_ON" _get_config_menu fi } diff --git a/support/functions/_gui_build b/support/functions/_gui_build index 69f2dce..10026f0 100644 --- a/support/functions/_gui_build +++ b/support/functions/_gui_build @@ -185,7 +185,7 @@ _gui_build(){ then rm "$bdir/$oscam_name.debug" printf "\n $txt_delete $oscam_name.debug\n"|tee -a "$ldir/$log_name" - fi;) | "$gui" "$st_" --colors --title " -[ Build ]- " "$pb_" "$_lines" "$_cols" + fi;) | "$gui" "$st_" --colors --title " -[ Build $(EMU) ]- " "$pb_" "$_lines" "$_cols" sleep 2 #COMPRESS diff --git a/support/functions/_misc b/support/functions/_misc index beaede0..2f2c27c 100644 --- a/support/functions/_misc +++ b/support/functions/_misc @@ -260,7 +260,7 @@ _select_menu(){ revision_="$($(USEGIT) && printf "$(COMMIT)" || printf "r$(REVISION)")" _menutext="Simplebuild3 ${SIMPLEVERSION}.${VERSIONCOUNTER} by Gorgone, WXbet" smenu=$( - "$gui" "$st_" "$bt_" "$title_" "$nc_" --title "-[ $txt_start_menu ]-" --menu "\n $_menutext" 14 55 7 "Continue" "$txt_firstmenu_continue $revision_" "CHANGE" "$txt_firstmenu_chose" "CEDIT" "$txt_firstmenu_cedit" "TCUPDATE" "$txt_firstmenu_tcupdate" "LANG" "$txt_firstmenu_lang" "EXIT" "$txt_firstmenu_exit") + "$gui" "$st_" "$bt_" "$title_" "$nc_" --title "-[ $txt_start_menu $(EMU) ]-" --menu "\n $_menutext" 14 55 7 "Continue" "$txt_firstmenu_continue $revision_" "CHANGE" "$txt_firstmenu_chose" "CEDIT" "$txt_firstmenu_cedit" "TCUPDATE" "$txt_firstmenu_tcupdate" "LANG" "$txt_firstmenu_lang" "EXIT" "$txt_firstmenu_exit") [ $? = 255 ] && _select_menu case $smenu in @@ -317,7 +317,7 @@ _oscam_extra_menu(){ fi done - oextra=$("$gui" "$st_" "$nc_" "$bt_" "$title_" --title "-[ Oscam EXTRA ]-" "$cl_" " OPTIONS " 19 40 12 ${MENU_OPTIONS[@]}); + oextra=$("$gui" "$st_" "$nc_" "$bt_" "$title_" --title "-[ Oscam EXTRA $(EMU) ]-" "$cl_" " OPTIONS " 19 40 12 ${MENU_OPTIONS[@]}); [ $? = 255 ] && _toolchain_config_menu for e in "${!USE_vars[@]}" @@ -353,7 +353,7 @@ _build_extra_menu(){ do [ "${#USE_vars[$e]}" -gt "4" ] && MENU_OPTIONS+=( "$e" "$e=1" on ) || MENU_OPTIONS+=( "$e" "$e=1" off ) done - bextra=$("$gui" "$st_" "$nc_" "$bt_" "$title_" --title "-[ Build EXTRA ]-" "$cl_" " OPTIONS " 17 45 3 ${MENU_OPTIONS[@]}) + bextra=$("$gui" "$st_" "$nc_" "$bt_" "$title_" --title "-[ Build EXTRA $(EMU) ]-" "$cl_" " OPTIONS " 17 45 3 ${MENU_OPTIONS[@]}) [ $? = 255 ] && _build_extra_menu USE_vars[USE_COMPRESS]= USE_vars[USE_PATCH]= @@ -404,7 +404,7 @@ _pre_main_menu(){ fi fi - out=$("$gui" --help-button --help-label INFO --title "-[ Toolchain Menu ${SIMPLEVERSION}.${VERSIONCOUNTER} ]-" --menu "$txt_t_menu1$REVISION" "${COUNT+8}" 75 0 "${MENU_OPTIONS}") + out=$("$gui" --help-button --help-label INFO --title "-[ Toolchain Menu ${SIMPLEVERSION}.${VERSIONCOUNTER} $(EMU) ]-" --menu "$txt_t_menu1$REVISION" "${COUNT+8}" 75 0 "${MENU_OPTIONS}") IFS=$OIFS first=$(echo "$out" | awk '{printf $1}') tc_info=$(echo "$out" | awk '{printf $2}') @@ -445,7 +445,7 @@ _gtedit(){ if [ -f "$tccfgdir/$_toolchainname" ] then source "$tccfgdir/$_toolchainname" - input=$("$gui" "$st_" "$bt_" "$title_" --title " -[ $1 Toolchain ]- " --inputbox "\n CONF_DIR=$_oscamconfdir_default 'default'\n [ESC] = default\n" 0 0 "$_oscamconfdir_custom") + input=$("$gui" "$st_" "$bt_" "$title_" --title " -[ $1 Toolchain $(EMU) ]- " --inputbox "\n CONF_DIR=$_oscamconfdir_default 'default'\n [ESC] = default\n" 0 0 "$_oscamconfdir_custom") retval=$? case $retval in diff --git a/support/functions/_repo b/support/functions/_repo index fd9d6e0..30ef7f2 100644 --- a/support/functions/_repo +++ b/support/functions/_repo @@ -43,7 +43,6 @@ reporestore(){ [ -L "$workdir/lastbuild.log" ]&& rm "$workdir/lastbuild.log"; [ -L "$workdir/lastpatch.log" ]&& rm "$workdir/lastpatch.log"; [ -f "$workdir/${REPO^^}-IS-PATCHED" ] && rm -f "$workdir/${REPO^^}-IS-PATCHED"; - [ -f "$workdir/EMU_ON" ] && rm -f "$workdir/EMU_ON"; } repoup(){ @@ -196,3 +195,7 @@ USEGIT(){ REPOTYPE(){ $(USEGIT) && printf "git" || printf "svn" } + +EMU(){ + [ -f "$workdir/EMU_ON" ] && printf "EMU" || printf "" +} diff --git a/support/functions/_subversion b/support/functions/_subversion index a4f3db6..244799e 100644 --- a/support/functions/_subversion +++ b/support/functions/_subversion @@ -47,7 +47,6 @@ svncheckout(){ rm -rf "$fc1" _nl [ -f "$workdir/${REPO^^}-IS-PATCHED" ] && rm -f "$workdir/${REPO^^}-IS-PATCHED" - [ -f "$workdir/EMU_ON" ] && rm -f "$workdir/EMU_ON" tar_repo } @@ -110,7 +109,6 @@ done < <(svn co "$trunkurl" "${repodir}" $_rev| sed "s@${repodir}@@g"| awk '{pri reset_="$("${repodir}/config.sh" -R)" printf "Revision: $(REVISION) done..." [ -f "$workdir/${REPO^^}-IS-PATCHED" ] && rm -f "$workdir/${REPO^^}-IS-PATCHED" - [ -f "$workdir/EMU_ON" ] && rm -f "$workdir/EMU_ON" _get_config_menu fi;)) } diff --git a/support/functions/_toolchain b/support/functions/_toolchain index 7202224..acb7948 100644 --- a/support/functions/_toolchain +++ b/support/functions/_toolchain @@ -4,7 +4,7 @@ _toolchain_build_menu(){ [ "$loadprofile" == "yes" ] && load_config selected=$( - "$gui" "$st_" "$bt_" "$title_" --no-cancel --title " -[ $txt_bmenu_title ]- " --menu "_________________________________________________________ \n $txt_bmenu_user = $(whoami)\n Toolchain = $_toolchainname\n $txt_bmenu_comp = $_compiler""gcc\n $txt_bmenu_debu = CPU-Threads($(CPUS)) ${REPO^^}($($(USEGIT) && printf "$(COMMIT)" || printf "$(REVISION)")) SCRIPT(${SIMPLEVERSION}.${VERSIONCOUNTER})\n $txt_bmenu_use = $(echo $USESTRING| sed -e 's/^[ \t]*//')\n _________________________________________________________ \n" 22 75 10 BUILD "$txt_bmenu_build" CONFIGURE "$txt_bmenu_config" UPDATE "$txt_bmenu_update" BACKUP "$txt_bmenu_backup" LOAD_PROFILE "$txt_bmenu_profile" SAVE_PROFILE "$txt_bmenus_profile" SHOW_BUILDLOG "$txt_bmenu_log" EDIT_CONF_DIR "Oscam config PATH" BACK "$txt_bmenu_back" EXIT "$txt_firstmenu_exit") + "$gui" "$st_" "$bt_" "$title_" --no-cancel --title " -[ $txt_bmenu_title $(EMU) ]- " --menu "_________________________________________________________ \n $txt_bmenu_user = $(whoami)\n Toolchain = $_toolchainname\n $txt_bmenu_comp = $_compiler""gcc\n $txt_bmenu_debu = CPU-Threads($(CPUS)) ${REPO^^}($($(USEGIT) && printf "$(COMMIT)" || printf "$(REVISION)")) SCRIPT(${SIMPLEVERSION}.${VERSIONCOUNTER})\n $txt_bmenu_use = $(echo $USESTRING| sed -e 's/^[ \t]*//')\n _________________________________________________________ \n" 22 75 10 BUILD "$txt_bmenu_build" CONFIGURE "$txt_bmenu_config" UPDATE "$txt_bmenu_update" BACKUP "$txt_bmenu_backup" LOAD_PROFILE "$txt_bmenu_profile" SAVE_PROFILE "$txt_bmenus_profile" SHOW_BUILDLOG "$txt_bmenu_log" EDIT_CONF_DIR "Oscam config PATH" BACK "$txt_bmenu_back" EXIT "$txt_firstmenu_exit") [ $? = 255 ] && _toolchain_build_menu case $selected in @@ -46,7 +46,7 @@ _toolchain_config_menu(){ [ "$loadprofile" == "yes" ] && load_config selected=$( - "$gui" "$st_" "$bt_" "$title_" --no-cancel --title " -[ $txt_config_menu ]- " --menu " ADDONS :\n $(e_addons)\n\n PROTOCOLS :\n $(e_protocols)\n\n READERS :\n $(e_readers)\n\n CARD_READERS :\n $(e_card_readers)\n\n USE VARIABLES :\n $(echo $USESTRING| sed -e 's/^[ \t]*//')\n\n" 29 75 6 BACK "$txt_back_build" OSCAM_MODULE "$txt_module_configure" OSCAM_EXTRA "$txt_oscam_extra" BUILD_EXTRA "$txt_build_extra" SELECT_STAPI "select stapi" RESET "$txt_build_reset") + "$gui" "$st_" "$bt_" "$title_" --no-cancel --title " -[ $txt_config_menu $(EMU) ]- " --menu " ADDONS :\n $(e_addons)\n\n PROTOCOLS :\n $(e_protocols)\n\n READERS :\n $(e_readers)\n\n CARD_READERS :\n $(e_card_readers)\n\n USE VARIABLES :\n $(echo $USESTRING| sed -e 's/^[ \t]*//')\n\n" 29 75 6 BACK "$txt_back_build" OSCAM_MODULE "$txt_module_configure" OSCAM_EXTRA "$txt_oscam_extra" BUILD_EXTRA "$txt_build_extra" SELECT_STAPI "select stapi" RESET "$txt_build_reset") [ $? = 255 ] && _toolchain_config_menu case $selected in @@ -112,7 +112,7 @@ _toolchain_main_menu(){ counter out=$( - "$gui" "$st_" "$nc_" "$bt_" "$title_" --help-button --help-label INFO --title "-[ Toolchain $txt_menu ]-" --menu "$txt_main_revision$(REVISION)$($(USEGIT) && printf " @ $(COMMIT) @ $(BRANCH)" || printf " on $(BRANCH)")" "${COUNT+8}" 75 0 ${MENU_OPTIONS}) + "$gui" "$st_" "$nc_" "$bt_" "$title_" --help-button --help-label INFO --title "-[ Toolchain $txt_menu $(EMU) ]-" --menu "$txt_main_revision$(REVISION)$($(USEGIT) && printf " @ $(COMMIT) @ $(BRANCH)" || printf " on $(BRANCH)")" "${COUNT+8}" 75 0 ${MENU_OPTIONS}) IFS=$OIFS first=$(echo "$out" | awk '{printf $1}') tc_info=$(echo "$out" | awk '{printf $2}') @@ -370,7 +370,7 @@ _toolchain_add_menu(){ counter out=$( - "$gui" "$st_" "$nc_" "$bt_" "$title_" --help-button --help-label INFO --title "-[ $txt_add_menu ]-" --menu "$txt_main_revision$(REVISION)" "${COUNT+8}" 75 0 ${MENU_OPTIONS[@]}) + "$gui" "$st_" "$nc_" "$bt_" "$title_" --help-button --help-label INFO --title "-[ $txt_add_menu $(EMU) ]-" --menu "$txt_main_revision$(REVISION)" "${COUNT+8}" 75 0 ${MENU_OPTIONS[@]}) IFS=$OIFS first=$(echo "$out" | awk '{printf $1}') tc_info=$(echo "$out" | awk '{printf $2}') @@ -414,7 +414,7 @@ _toolchain_remove_menu(){ counter out=$( - "$gui" "$st_" "$nc_" "$bt_" "$title_" --title "-[ $txt_remove_menu ]-" --menu "$txt_main_revision$(REVISION)" "${COUNT+8}" 75 0 ${MENU_OPTIONS}) + "$gui" "$st_" "$nc_" "$bt_" "$title_" --title "-[ $txt_remove_menu $(EMU) ]-" --menu "$txt_main_revision$(REVISION)" "${COUNT+8}" 75 0 ${MENU_OPTIONS}) IFS=$OIFS first=$(echo "$out" | awk '{printf $1}') diff --git a/support/functions/_update b/support/functions/_update index 2b8c861..6b3344b 100644 --- a/support/functions/_update +++ b/support/functions/_update @@ -4,7 +4,6 @@ update_me(){ clear;s3logo local_revision=0 online_revision=0 - source "$configdir/urls" s3local="$dldir/s3_github" printf " s3_git CHECK:\n -------------\n" check_url "$s3url" || return @@ -25,35 +24,9 @@ update_me(){ sleep 1 } -update_emu(){ - clear;s3logo - local_revision=0 - online_revision=0 - source "$configdir/urls" - emulocal="$dldir/emu_github" - printf " emu_git CHECK:\n --------------\n" - check_url "$emuurl" || return - - local_revision=$(gitrevision $emulocal) - online_revision=$(gitrevision $emuurl) - - if [ ! "$local_revision" == "$online_revision" ] - then - printf " update emu_git\n from Local Revision: $local_revision\n to Remote Revision: $online_revision\n" - rm -rf "$emulocal"; git clone "$emuurl" "$emulocal" &>/dev/null - else - printf " is up to date\n Online Revision: $online_revision\n" - fi - - printf " Emu-Version: " - grep '#define EMU_VERSION' $emulocal/* | head -1 | awk '{print $3}'; _nl - sleep 1 -} - fix_me(){ clear s3logo - source "$configdir/urls" s3local="$dldir/s3_github" emulocal="$dldir/emu_github"