simple-adblock: update sed for allowing domains 20317/head
authorStan Grishin <stangri@melmac.ca>
Sat, 14 Jan 2023 23:00:30 +0000 (23:00 +0000)
committerStan Grishin <stangri@melmac.ca>
Sat, 14 Jan 2023 23:00:30 +0000 (23:00 +0000)
Signed-off-by: Stan Grishin <stangri@melmac.ca>
net/simple-adblock/Makefile
net/simple-adblock/files/simple-adblock.init

index 725ec66b8fef5535ed2fa02e18e4d4451342ee66..de1ca0e0522de430036c605ede7c9487726d3dca 100644 (file)
@@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=simple-adblock
 PKG_VERSION:=1.9.3
-PKG_RELEASE:=5
+PKG_RELEASE:=6
 PKG_MAINTAINER:=Stan Grishin <stangri@melmac.ca>
 PKG_LICENSE:=GPL-3.0-or-later
 
index e57a03b45b22d4c72aa379cc894212c02f6fa31a..fb6e99588afd38043384848f63bbf2faab848e6e 100644 (file)
@@ -790,7 +790,7 @@ download_lists() {
        for hf in $blocked_domain $canaryDomains; do echo "$hf" | sed "$domainsFilter" >> $B_TMP; done
        allowed_domain="${allowed_domain}
 $(cat $A_TMP)"
-       for hf in ${allowed_domain}; do hf="$(echo "$hf" | sed 's/\./\\./g')"; allow_filter="$allow_filter/^(.*\.)?${hf}$/d;"; done
+       for hf in ${allowed_domain}; do hf="$(echo "$hf" | sed 's/\./\\./g')"; allow_filter="$allow_filter/(^|\.)${hf}$/d;"; done
 
        [ ! -s "$B_TMP" ] && return 1
 
@@ -966,7 +966,7 @@ adb_allow() {
                        for c in $string; do
                                output 2 "  $c "
                                hf="$(echo "$c" | sed 's/\./\\./g')"
-                               if sed -i "/^${hf}$/d;/\.${hf}$/d;" "$outputFile" && \
+                               if sed -i "/(^|\.)${hf}$/d;" "$outputFile" && \
                                        uci_add_list_if_new "${packageName}" 'config' 'allowed_domain' "$c"; then
                                                output_ok
                                else