Skip to content

Commit

Permalink
Remove oscam-emu patch support
Browse files Browse the repository at this point in the history
- oscam-emu patch is deprecated, so switch to use oscam-patched repo checkout
- move trunkurl variable from s3 to support/config/urls
- options enable_emu + disable_emu to switch between trunkurl and emuurl
- option update_emu removed
- show EMU hint in menus when enabled
  • Loading branch information
WXbet committed Apr 15, 2024
1 parent 68534aa commit 688c2b1
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 101 deletions.
16 changes: 9 additions & 7 deletions s3
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

VERSIONCOUNTER=336
SIMPLEVERSION="2024.04"
VERSIONCOUNTER=340
SIMPLEVERSION="2024.05"
OIFS=$IFS
export NCURSES_NO_UTF8_ACS=1

Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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<SOURCE>="some url"
Expand Down Expand Up @@ -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"
Expand Down
5 changes: 3 additions & 2 deletions support/configs/urls
Original file line number Diff line number Diff line change
@@ -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";
58 changes: 9 additions & 49 deletions support/functions/_emu
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
2 changes: 0 additions & 2 deletions support/functions/_git
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -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
}
2 changes: 1 addition & 1 deletion support/functions/_gui_build
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions support/functions/_misc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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[@]}"
Expand Down Expand Up @@ -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]=
Expand Down Expand Up @@ -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}')
Expand Down Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion support/functions/_repo
Original file line number Diff line number Diff line change
Expand Up @@ -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(){
Expand Down Expand Up @@ -196,3 +195,7 @@ USEGIT(){
REPOTYPE(){
$(USEGIT) && printf "git" || printf "svn"
}

EMU(){
[ -f "$workdir/EMU_ON" ] && printf "EMU" || printf ""
}
2 changes: 0 additions & 2 deletions support/functions/_subversion
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -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;))
}
10 changes: 5 additions & 5 deletions support/functions/_toolchain
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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}')
Expand Down Expand Up @@ -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}')
Expand Down Expand Up @@ -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}')

Expand Down
27 changes: 0 additions & 27 deletions support/functions/_update
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"

Expand Down

0 comments on commit 688c2b1

Please sign in to comment.