From e291d680558f40ae6d0d0a7006ac1991a6910d2f Mon Sep 17 00:00:00 2001 From: Dirk Brenken Date: Sat, 18 Apr 2020 15:33:16 +0200 Subject: [PATCH] adblock: filter spurious line endings in sources * prevent processing of spurious line endings that confuses (g)awk Signed-off-by: Dirk Brenken --- net/adblock/Makefile | 2 +- net/adblock/files/adblock.sh | 14 ++++++-------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/net/adblock/Makefile b/net/adblock/Makefile index 2bc8c0080..1a4b7f556 100644 --- a/net/adblock/Makefile +++ b/net/adblock/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=adblock PKG_VERSION:=4.0.4 -PKG_RELEASE:=3 +PKG_RELEASE:=4 PKG_LICENSE:=GPL-3.0-or-later PKG_MAINTAINER:=Dirk Brenken diff --git a/net/adblock/files/adblock.sh b/net/adblock/files/adblock.sh index fd2bbffd4..4fa4902ca 100755 --- a/net/adblock/files/adblock.sh +++ b/net/adblock/files/adblock.sh @@ -1255,11 +1255,10 @@ f_main() then if [ -s "${adb_tmpdir}/tmp.rem.whitelist" ] then - "${adb_awk}" "${src_rset}" "${src_tmpload}" | \ - grep -Evf "${adb_tmpdir}/tmp.rem.whitelist" | \ - "${adb_awk}" 'BEGIN{FS="."}{for(f=NF;f>1;f--)printf "%s.",$f;print $1}' > "${src_tmpsort}" + "${adb_awk}" "${src_rset}" "${src_tmpload}" | sed "s/\r//g" | \ + grep -Evf "${adb_tmpdir}/tmp.rem.whitelist" | "${adb_awk}" 'BEGIN{FS="."}{for(f=NF;f>1;f--)printf "%s.",$f;print $1}' > "${src_tmpsort}" else - "${adb_awk}" "${src_rset}" "${src_tmpload}" | \ + "${adb_awk}" "${src_rset}" "${src_tmpload}" | sed "s/\r//g" | \ "${adb_awk}" 'BEGIN{FS="."}{for(f=NF;f>1;f--)printf "%s.",$f;print $1}' > "${src_tmpsort}" fi rm -f "${src_tmpload}" @@ -1294,11 +1293,10 @@ f_main() then if [ -s "${adb_tmpdir}/tmp.rem.whitelist" ] then - "${adb_awk}" "${src_rset}" "${src_tmpload}" | \ - grep -Evf "${adb_tmpdir}/tmp.rem.whitelist" | \ - "${adb_awk}" 'BEGIN{FS="."}{for(f=NF;f>1;f--)printf "%s.",$f;print $1}' > "${src_tmpsort}" + "${adb_awk}" "${src_rset}" "${src_tmpload}" | sed "s/\r//g" | \ + grep -Evf "${adb_tmpdir}/tmp.rem.whitelist" | "${adb_awk}" 'BEGIN{FS="."}{for(f=NF;f>1;f--)printf "%s.",$f;print $1}' > "${src_tmpsort}" else - "${adb_awk}" "${src_rset}" "${src_tmpload}" | \ + "${adb_awk}" "${src_rset}" "${src_tmpload}" | sed "s/\r//g" | \ "${adb_awk}" 'BEGIN{FS="."}{for(f=NF;f>1;f--)printf "%s.",$f;print $1}' > "${src_tmpsort}" fi rm -f "${src_tmpload}"