adblock: filter spurious line endings in sources
authorDirk Brenken <dev@brenken.org>
Sat, 18 Apr 2020 13:33:16 +0000 (15:33 +0200)
committerDirk Brenken <dev@brenken.org>
Sat, 18 Apr 2020 13:33:16 +0000 (15:33 +0200)
* prevent processing of spurious line endings
  that confuses (g)awk

Signed-off-by: Dirk Brenken <dev@brenken.org>
net/adblock/Makefile
net/adblock/files/adblock.sh

index 2bc8c0080d643365b4f4cc0a4daf610ada25e9bb..1a4b7f5569f1189922a8b159f48e55454cdce194 100644 (file)
@@ -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 <dev@brenken.org>
 
index fd2bbffd40b15173d65f89cabcc6bac90c6fe3ec..4fa4902ca74256292e443574ec31c307d409cadd 100755 (executable)
@@ -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}"