Browse Source

adblock: filter spurious line endings in sources

* prevent processing of spurious line endings
  that confuses (g)awk

Signed-off-by: Dirk Brenken <dev@brenken.org>
lilik-openwrt-22.03
Dirk Brenken 5 years ago
parent
commit
e291d68055
No known key found for this signature in database GPG Key ID: 9D71CD547BFAE684
2 changed files with 7 additions and 9 deletions
  1. +1
    -1
      net/adblock/Makefile
  2. +6
    -8
      net/adblock/files/adblock.sh

+ 1
- 1
net/adblock/Makefile View 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>


+ 6
- 8
net/adblock/files/adblock.sh View File

@ -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}"


Loading…
Cancel
Save