adblock-fast: improve the processing of combined list
authorNikolay Manev <redacted>
Sun, 11 May 2025 20:12:30 +0000 (23:12 +0300)
committerStan Grishin <redacted>
Tue, 13 May 2025 16:42:43 +0000 (09:42 -0700)
Signed-off-by: Nikolay Manev <redacted>
adblock-fast: modify gawk statement

Signed-off-by: Nikolay Manev <redacted>
net/adblock-fast/Makefile
net/adblock-fast/files/etc/init.d/adblock-fast

index d30cbc811da4eb915efc3295a23fa30f261b8df9..0083b52fc2af552c7b19db4537c4dc5fc7b0ee89 100644 (file)
@@ -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 <stangri@melmac.ca>
 PKG_LICENSE:=AGPL-3.0-or-later
 
index 24be72cfa4a246c4fb755cfa3f2bf71d85872efb..39745d499bae98c0031fdb77574d0e739f198ca1 100755 (executable)
@@ -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
git clone https://git.99rst.org/PROJECT