diff --git a/support/functions/_misc b/support/functions/_misc index 0bb8a47..87fc049 100644 --- a/support/functions/_misc +++ b/support/functions/_misc @@ -89,15 +89,15 @@ _generate_oscam_name(){ } e_readers(){ silent=$("$svndir/config.sh" -s readers) - printf ${silent//READER_/} + echo ${silent//READER_/} } e_protocols() { silent=$("$svndir/config.sh" -s protocols) - printf ${silent//MODULE_/} + echo ${silent//MODULE_/} } e_card_readers(){ silent=$("$svndir/config.sh" -s card_readers) - printf ${silent//CARDREADER_/} + echo ${silent//CARDREADER_/} } e_addons(){ "$svndir/config.sh" -s addons |sed 's/WEBIF_//g;s/WITH_//g;s/MODULE_//g;s/CS_//g;s/HAVE_//g;s/_CHARSETS//g;s/CW_CYCLE_CHECK/CWCC/g;s/SUPPORT//g' diff --git a/support/functions/_patch b/support/functions/_patch index 6a73fe9..653da09 100644 --- a/support/functions/_patch +++ b/support/functions/_patch @@ -77,6 +77,21 @@ _apply_menupatch(){ sleep 2 } +_checkpatch(){ + files_to_patch=$(grep "^+++ " -i $pdir/$1 | awk '{print $2}' | sort | uniq) + + for fil in ${files_to_patch[@]} + do + + if [ ! -f "$svndir/$fil" ] + then + fil_n=$(sed 's@^[^/]*/@@g' <<<"$fil") + sed -i "s@+++ $fil@+++ $fil_n@g" "$pdir/$1" + fi + + done +} + _apply_consolepatch(){ if [ ! -f "$workdir/SVN-IS-PATCHED" ] then @@ -90,9 +105,11 @@ _apply_consolepatch(){ for e in ${patchlist[@]} do + _checkpatch $e + _w=0 cd "$svndir" - printf "$y_l\n | PATCH : apply $e\n" + printf "$y_l\n | PATCH : apply $e" patch -F 10 -f -p0 < "$pdir/$e" >>"$patchlog" 2>/dev/null hunks=$(grep -c1 "^Hunk" "$patchlog") fails=$(grep -c1 "hunks FAILED" "$patchlog")