gorgone
5 years ago
1 changed files with 45 additions and 32 deletions
@ -1,40 +1,53 @@ |
|||||
#!/bin/bash |
#!/bin/bash |
||||
|
|
||||
enable_emu(){ |
enable_emu(){ |
||||
clear;s3logo; |
clear |
||||
if [ -d "$svndir" ];then |
s3logo |
||||
quicksvnrestore; |
if [ -d "$svndir" ] |
||||
else |
then |
||||
checkout; |
printf "$w_l quicksvnrestore $G$txt_wait\n" |
||||
fi; |
quicksvnrestore |
||||
pname="oscam-emu.patch"; |
else |
||||
source "$configdir/urls"; |
printf "$w_l checkout $G$txt_wait\n" |
||||
emulocal="$dldir/emu_github"; |
checkout |
||||
|
fi |
||||
|
|
||||
if [ -f "$emulocal/oscam-emu.patch" ];then |
pname="oscam-emu.patch" |
||||
echo -en "$w_l Emu Revision : $y_l"; |
source "$configdir/urls" |
||||
grep '\+#define EMU_VERSION' "$emulocal/oscam-emu.patch" |cut -d " " -f 3; |
emulocal="$dldir/emu_github" |
||||
if [ -f "$emulocal/$pname" ];then |
|
||||
cp -rf "$emulocal/$pname" "$svndir"; |
if [ -f "$emulocal/oscam-emu.patch" ] |
||||
fi |
then |
||||
fi |
printf "$w_l Emu Revision : $y_l" |
||||
echo -e $re_;cd $svndir;echo $(date)>"$workdir/patch.log"; |
grep '\+#define EMU_VERSION' "$emulocal/oscam-emu.patch" |cut -d " " -f 3 |
||||
patch -p0 < $pname |tee -a "$workdir/patch.log" \ |
if [ -f "$emulocal/$pname" ] |
||||
|grep --line-buffered -v '^[0-9]\|^/' \ |
then |
||||
|sed -e "s@^patching file@$Y patching file $WH----->$C@g;" \ |
cp -rf "$emulocal/$pname" "$svndir" |
||||
|sed -e "s@^Hunk@$P Hunk@g;" \ |
fi |
||||
|sed -e "s@FAILED@"$R"FAILED@g;" \ |
fi |
||||
|sed -e "s@succeeded@"$WH"succeeded@g;"; |
|
||||
|
printf $re_ |
||||
|
cd $svndir |
||||
|
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) |
fcount=0 |
||||
hcount=0;hcount=$(grep -o 'Hunk #' -i "$workdir/patch.log" | wc -l) |
fcount=$(grep -o 'FAILED at' -i "$workdir/patch.log" | wc -l) |
||||
if [ ! "$fcount" == "0" ] || [ ! "$hcount" == "0" ];then |
hcount=0; |
||||
echo -e "\n$WH Patch Result\n ------------\n Hunk Count :" $hcount; |
hcount=$(grep -o 'Hunk #' -i "$workdir/patch.log" | wc -l) |
||||
echo -e " Fail Count :" $fcount; |
if [ ! "$fcount" == "0" ] || [ ! "$hcount" == "0" ] |
||||
# todo ask for restore svn yes / no / show log |
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 |
else |
||||
echo -e "\n$WH Patch Staus :$G CLEAN "; |
printf "\n$WH Patch Staus :$G CLEAN " |
||||
touch "$workdir/EMU_ON"; |
touch "$workdir/EMU_ON" |
||||
fi |
fi |
||||
echo -e $re_; |
printf $re_ |
||||
} |
} |
||||
|
Loading…
Reference in new issue