From: Nikolay Manev Date: Sun, 11 May 2025 20:12:30 +0000 (+0300) Subject: adblock-fast: improve the processing of combined list X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=34c02108ce36aa2ef23cef2245ab120273a8e3dd;p=openwrt-packages.git adblock-fast: improve the processing of combined list Signed-off-by: Nikolay Manev adblock-fast: modify gawk statement Signed-off-by: Nikolay Manev --- diff --git a/net/adblock-fast/Makefile b/net/adblock-fast/Makefile index d30cbc811..0083b52fc 100644 --- a/net/adblock-fast/Makefile +++ b/net/adblock-fast/Makefile @@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=adblock-fast PKG_VERSION:=1.1.3 -PKG_RELEASE:=10 +PKG_RELEASE:=11 PKG_MAINTAINER:=Stan Grishin PKG_LICENSE:=AGPL-3.0-or-later diff --git a/net/adblock-fast/files/etc/init.d/adblock-fast b/net/adblock-fast/files/etc/init.d/adblock-fast index 24be72cfa..39745d499 100755 --- a/net/adblock-fast/files/etc/init.d/adblock-fast +++ b/net/adblock-fast/files/etc/init.d/adblock-fast @@ -1471,7 +1471,7 @@ download_lists() { # shellcheck disable=SC2016 if $awk -F "." '{for(f=NF;f>1;f--)printf "%s.",$f;print $1}' "$A_TMP" > "$B_TMP"; then if sort "$B_TMP" > "$A_TMP"; then - if $awk '{if(NR=1){tld=$NF};while(getline){if($NF!~tld"\\."){print tld;tld=$NF}}print tld}' "$A_TMP" > "$B_TMP"; then + if $awk '{ if (NR == 1) { tld = $NF; } else { if ($NF !~ tld "\\.") { results[++count] = tld; print tld; tld = $NF; } } } END { results[++count] = tld; for (i = 1; i <= count; i++) {print results[i];} }' "$A_TMP" > "$B_TMP"; then if $awk -F "." '{for(f=NF;f>1;f--)printf "%s.",$f;print $1}' "$B_TMP" > "$A_TMP"; then if sort -u "$A_TMP" > "$B_TMP"; then output_ok