You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
1.3 KiB
40 lines
1.3 KiB
#!/bin/bash
|
|
|
|
enable_emu(){
|
|
clear;s3logo;
|
|
if [ -d "$svndir" ];then
|
|
quicksvnrestore;
|
|
else
|
|
checkout;
|
|
fi;
|
|
pname="oscam-emu.patch";
|
|
source "$configdir/urls";
|
|
emulocal="$dldir/emu_github";
|
|
|
|
if [ -f "$emulocal/oscam-emu.patch" ];then
|
|
echo -en "$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" "$svndir";
|
|
fi
|
|
fi
|
|
echo -e $re_;cd $svndir;echo $(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
|
|
echo -e "\n$WH Patch Result\n ------------\n Hunk Count :" $hcount;
|
|
echo -e " Fail Count :" $fcount;
|
|
# todo ask for restore svn yes / no / show log
|
|
else
|
|
echo -e "\n$WH Patch Staus :$G CLEAN ";
|
|
touch "$workdir/EMU_ON";
|
|
fi
|
|
echo -e $re_;
|
|
}
|
|
|