Browse Source

update function for github

add ./s3 update_me
add ./s3 update_emu
add ./s3 fix_me

update_me  creats support/downloads/s3_github folder mirror
	- autoupdate local files s3 + support folder
update_emu creats support/downloads/emu_github folder mirror
fix_me overwrite all files with the local s3_github files

remove config_h_fixer
pull/9/head
root 6 years ago
parent
commit
0da1fa9370
  1. 6
      s3
  2. 1
      support/functions/_cmd_build
  3. 4
      support/functions/_misc
  4. 4
      support/functions/_subversion
  5. 92
      support/functions/_update

6
s3

@ -66,7 +66,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 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"; CUSTOM_CONFDIR="not_set";
UPX="not_set"; UPX="not_set";
@ -124,6 +124,10 @@ else
for e in "${s3opts[@]}";do for e in "${s3opts[@]}";do
if [ "$e" == "$1" ];then if [ "$e" == "$1" ];then
case $e in case $e in
fix_me|\
update_me|\
update_emu|\
update_all|\
svnrestore|\ svnrestore|\
checkout|\ checkout|\
upload_cam) if [ ! -n "$2" ];then upload_cam) if [ ! -n "$2" ];then

1
support/functions/_cmd_build

@ -10,7 +10,6 @@ _cmd_build(){
fi; fi;
source "$tccfgdir/$_toolchainname"; source "$tccfgdir/$_toolchainname";
_reset_config; _reset_config;
#_fix_config_h;
echo $WH; echo $WH;
ologo >"$ldir/$log_name"; ologo >"$ldir/$log_name";

4
support/functions/_misc

@ -21,9 +21,7 @@ timer_stop(){ Te="$(date +%s)";};
timer_start(){ Ts="$(date +%s)";}; timer_start(){ Ts="$(date +%s)";};
decode(){ echo -en "$1" | base64 -d;}; decode(){ echo -en "$1" | base64 -d;};
get_module_name(){ echo "${INTERNAL_MODULES[$1]}";}; get_module_name(){ echo "${INTERNAL_MODULES[$1]}";};
_fix_config_h(){ _=0; gitrevision(){ svn info $1 |grep Rev: |cut -d " " -f 4;};
#_pcsc_off;_stapi5_off;
};
_wait(){ echo -e "$w_l";read -n1 -r -p " $txt_help3" key;tput cuu1;echo ' ';} _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;}; _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";}; _pcsc_on(){ sed -i 's@^//#define CARDREADER_PCSC 1@#define CARDREADER_PCSC 1@g' "$svndir/config.h";};

4
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"; 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; fi;
[ -f "$svndir/config.h" ]&& reset_="$("$svndir/config.sh" -R)"; [ -f "$svndir/config.h" ]&& reset_="$("$svndir/config.sh" -R)";
_fix_config_h;
rm -rf "$fc1"; rm -rf "$fc1";
_nl; _nl;
[ -f "$workdir/SVN-IS-PATCHED" ] && rm -f "$workdir/SVN-IS-PATCHED"; [ -f "$workdir/SVN-IS-PATCHED" ] && rm -f "$workdir/SVN-IS-PATCHED";
@ -91,7 +90,6 @@ svnup(){
fi; fi;
if [ -f "$svndir/config.h" ];then if [ -f "$svndir/config.h" ];then
reset_="$("$svndir/config.sh" -R)"; reset_="$("$svndir/config.sh" -R)";
_fix_config_h;
fi; fi;
}; };
svnpatch(){ svnpatch(){
@ -142,7 +140,6 @@ _dialog_checkout(){
[ ! "$upc1" == "1" ] && _dialog_checkout1; [ ! "$upc1" == "1" ] && _dialog_checkout1;
if [ -f "$svndir/config.sh" ];then if [ -f "$svndir/config.sh" ];then
reset_="$("$svndir/config.sh" -R)"; reset_="$("$svndir/config.sh" -R)";
_fix_config_h;
fi; fi;
_get_config_menu; _get_config_menu;
fi; fi;
@ -186,7 +183,6 @@ done < <(svn co "$trunkurl" "$svndir" $_rev| sed "s@$svndir@@g"| awk '{print $2}
if [ -f "$svndir/config.sh" ];then if [ -f "$svndir/config.sh" ];then
reset_="$("$svndir/config.sh" -R)"; reset_="$("$svndir/config.sh" -R)";
echo "Revision: $(REVISION) done..."; echo "Revision: $(REVISION) done...";
_fix_config_h;
[ -f "$workdir/SVN-IS-PATCHED" ] && rm -f "$workdir/SVN-IS-PATCHED"; [ -f "$workdir/SVN-IS-PATCHED" ] && rm -f "$workdir/SVN-IS-PATCHED";
_get_config_menu; _get_config_menu;
fi;)); fi;));

92
support/functions/_update

@ -1,38 +1,66 @@
#!/bin/bash #!/bin/bash
start_update(){ update_me(){
clear;s3logo; clear;s3logo;
echo -e $w_l"$txt_loading\t-->\t $Y$filename"; local_revision=0;
url="https://github.com/gorgone/s3_releases/archive/s3_rc5.1.tar.gz"; online_revision=0;
cd "$dldir";echo -e $P; source "$configdir/urls";
wget -N --no-hsts --https-only --progress=dot "$url" 2>&1 |grep --line-buffered "%" |awk '{ printf "\033["'9'";"'41'"H\033[K > %-4s", $7;}'; s3local="$dldir/s3_github";
tput cup 8 40;echo -en $G"$txt_done "; echo -en " s3_git CHECK:\n -------------\n";
echo -en $w_l"\n $txt_check\t-->\t $Y$filename";echo -en $G"\t OK";sleep 1; if [ -d "$s3local/.svn" ]; then
echo -en $w_l"\n $txt_extracting\t-->\t $Y$filename"; local_revision=$(gitrevision $s3local);
echo -en $G" $txt_done\n\n$re_"; fi
sleep 3; 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(){ update_emu(){
clear;s3logo;LOCALVERSIONCOUNTER=$VERSIONCOUNTER; clear;s3logo;
source <(wget -qO- --no-cache --no-cookies https://raw.githubusercontent.com/gorgone/s3_update/master/lastversion); local_revision=0;
echo -e "$w_l\n latest online Version ---> $SIMPLEVERSION\n ====================="; online_revision=0;
filename=$(echo "$_md5sum" | awk '{printf $2}';); source "$configdir/urls";
echo -e "$C filename\t\t ---> $filename\n ========"; emulocal="$dldir/emu_github";
echo -e "$Y Version Counter ---> $VERSIONCOUNTER\n ===============$re_\n"; 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 update_all(){
for i in "${whatsnew[*]}" update_me;
do update_emu;
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;
} }

Loading…
Cancel
Save