diff --git a/s3 b/s3 index caeb277..55f80b5 100755 --- a/s3 +++ b/s3 @@ -66,7 +66,7 @@ declare -a SHORT_READERS; declare -a SHORT_CARD_READERS; declare -A INTERNAL_ #filled arrays config_cases=( all addons protocols readers card_readers ); -s3opts=( help cedit clean tccheck tcrepair upload lang_select loadonly checkout ssh_profiles syscheck sysinfo svnup menu get_patch tedit svnpatch profiles svnrestore update ); # extendable with plugins +s3opts=( help cedit clean fix_me tccheck tcrepair upload update_me update_emu update_all lang_select loadonly checkout ssh_profiles syscheck sysinfo svnup menu get_patch tedit svnpatch profiles svnrestore update ); # extendable with plugins CUSTOM_CONFDIR="not_set"; UPX="not_set"; @@ -124,6 +124,10 @@ else for e in "${s3opts[@]}";do if [ "$e" == "$1" ];then case $e in + fix_me|\ + update_me|\ + update_emu|\ + update_all|\ svnrestore|\ checkout|\ upload_cam) if [ ! -n "$2" ];then diff --git a/support/functions/_cmd_build b/support/functions/_cmd_build index ff2b752..604edb6 100644 --- a/support/functions/_cmd_build +++ b/support/functions/_cmd_build @@ -10,7 +10,6 @@ _cmd_build(){ fi; source "$tccfgdir/$_toolchainname"; _reset_config; - #_fix_config_h; echo $WH; ologo >"$ldir/$log_name"; diff --git a/support/functions/_misc b/support/functions/_misc index 04b3fad..ab1bda2 100644 --- a/support/functions/_misc +++ b/support/functions/_misc @@ -21,9 +21,7 @@ timer_stop(){ Te="$(date +%s)";}; timer_start(){ Ts="$(date +%s)";}; decode(){ echo -en "$1" | base64 -d;}; get_module_name(){ echo "${INTERNAL_MODULES[$1]}";}; -_fix_config_h(){ _=0; -#_pcsc_off;_stapi5_off; -}; +gitrevision(){ svn info $1 |grep Rev: |cut -d " " -f 4;}; _wait(){ echo -e "$w_l";read -n1 -r -p " $txt_help3" key;tput cuu1;echo ' ';} _systype(){ systype="bad";case "$(uname -m)" in x86|x86_64|amd64|i686) systype="ok";;esac;}; _pcsc_on(){ sed -i 's@^//#define CARDREADER_PCSC 1@#define CARDREADER_PCSC 1@g' "$svndir/config.h";}; diff --git a/support/functions/_subversion b/support/functions/_subversion index a254001..3f137f7 100644 --- a/support/functions/_subversion +++ b/support/functions/_subversion @@ -32,7 +32,6 @@ checkout(){ echo -en "$w_l""SVN Revision : $y_l""$("$svndir/config.sh" -r) $b_l$mac_$re_\n$w_l SVN UserPath : $y_l""$svndir"; fi; [ -f "$svndir/config.h" ]&& reset_="$("$svndir/config.sh" -R)"; - _fix_config_h; rm -rf "$fc1"; _nl; [ -f "$workdir/SVN-IS-PATCHED" ] && rm -f "$workdir/SVN-IS-PATCHED"; @@ -91,7 +90,6 @@ svnup(){ fi; if [ -f "$svndir/config.h" ];then reset_="$("$svndir/config.sh" -R)"; - _fix_config_h; fi; }; svnpatch(){ @@ -142,7 +140,6 @@ _dialog_checkout(){ [ ! "$upc1" == "1" ] && _dialog_checkout1; if [ -f "$svndir/config.sh" ];then reset_="$("$svndir/config.sh" -R)"; - _fix_config_h; fi; _get_config_menu; fi; @@ -186,7 +183,6 @@ done < <(svn co "$trunkurl" "$svndir" $_rev| sed "s@$svndir@@g"| awk '{print $2} if [ -f "$svndir/config.sh" ];then reset_="$("$svndir/config.sh" -R)"; echo "Revision: $(REVISION) done..."; - _fix_config_h; [ -f "$workdir/SVN-IS-PATCHED" ] && rm -f "$workdir/SVN-IS-PATCHED"; _get_config_menu; fi;)); diff --git a/support/functions/_update b/support/functions/_update index 2a6cb8a..c63e989 100644 --- a/support/functions/_update +++ b/support/functions/_update @@ -1,38 +1,66 @@ #!/bin/bash -start_update(){ -clear;s3logo; -echo -e $w_l"$txt_loading\t-->\t $Y$filename"; -url="https://github.com/gorgone/s3_releases/archive/s3_rc5.1.tar.gz"; -cd "$dldir";echo -e $P; -wget -N --no-hsts --https-only --progress=dot "$url" 2>&1 |grep --line-buffered "%" |awk '{ printf "\033["'9'";"'41'"H\033[K > %-4s", $7;}'; -tput cup 8 40;echo -en $G"$txt_done "; -echo -en $w_l"\n $txt_check\t-->\t $Y$filename";echo -en $G"\t OK";sleep 1; -echo -en $w_l"\n $txt_extracting\t-->\t $Y$filename"; -echo -en $G" $txt_done\n\n$re_"; -sleep 3; +update_me(){ + clear;s3logo; + local_revision=0; + online_revision=0; + source "$configdir/urls"; + s3local="$dldir/s3_github"; + echo -en " s3_git CHECK:\n -------------\n"; + if [ -d "$s3local/.svn" ]; then + local_revision=$(gitrevision $s3local); + fi + online_revision=$(gitrevision $s3url); + if [ ! $local_revision == $online_revision ]; then + echo -en " update s3_git to\n Local Revision: $online_revision\n"; + svn -q checkout "$s3url" "$s3local"; + cd "$s3local"; + echo -en " update all files ...\n\n"; + yes | cp -rf s3 "$workdir/s3"; + yes | cp -rf support "$workdir/support"; + else + echo -en " is up to date\n Online Revision: $online_revision\n\n"; + fi } -update(){ -clear;s3logo;LOCALVERSIONCOUNTER=$VERSIONCOUNTER; -source <(wget -qO- --no-cache --no-cookies https://raw.githubusercontent.com/gorgone/s3_update/master/lastversion); -echo -e "$w_l\n latest online Version ---> $SIMPLEVERSION\n ====================="; -filename=$(echo "$_md5sum" | awk '{printf $2}';); -echo -e "$C filename\t\t ---> $filename\n ========"; -echo -e "$Y Version Counter ---> $VERSIONCOUNTER\n ===============$re_\n"; +update_emu(){ + clear;s3logo; + local_revision=0; + online_revision=0; + source "$configdir/urls"; + emulocal="$dldir/emu_github"; + echo -en " emu_git CHECK:\n --------------\n"; + if [ -d "$emulocal/.svn" ]; then + local_revision=$(gitrevision $emulocal); + fi + online_revision=$(gitrevision $emuurl); + if [ ! $local_revision == $online_revision ]; then + echo -en " update emu_git to\n Local Revision: $online_revision\n\n"; + svn -q checkout "$emuurl" "$emulocal"; + else + echo -en " is up to date\n Online Revision: $online_revision\n\n"; + fi + sleep 1; + cd "$emulocal"; + ls; +} + +fix_me(){ + clear;s3logo; + source "$configdir/urls"; + s3local="$dldir/s3_github"; + if [ -d "$s3local/.svn" ];then + cd "$s3local"; + echo -en " overwrite all files ...\n\n"; + yes | cp -rf s3 "$workdir/s3"; + yes | cp -rf support "$workdir/support"; + else + update_me; + fix_me; + fi +} -if [ $LOCALVERSIONCOUNTER -lt $VERSIONCOUNTER ];then - for i in "${whatsnew[*]}" - do - echo -e " $w_l$i$re_"; - done - echo -e "$R\n NEW VERSION FOUND\n\n$w_l UPDATE$G 1=YES$w_l /$R 2=NO\n$re_"; - read -n1 -p " -> " key; - case "$key" in - 1) echo -e " start Update\n"; start_update;; - *) echo -e " no Update\n";; - esac; -else - echo -e "$w_l\n NO NEW VERSION FOUND$re_\n"; -fi; +update_all(){ +update_me; +update_emu; }