From 4b77f94b5398111c839f7fe0f48b52a1087585b0 Mon Sep 17 00:00:00 2001 From: Stan Grishin Date: Sat, 14 Jan 2023 23:00:30 +0000 Subject: [PATCH] simple-adblock: update sed for allowing domains Signed-off-by: Stan Grishin --- net/simple-adblock/Makefile | 2 +- net/simple-adblock/files/simple-adblock.init | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/net/simple-adblock/Makefile b/net/simple-adblock/Makefile index 725ec66b8f..de1ca0e052 100644 --- a/net/simple-adblock/Makefile +++ b/net/simple-adblock/Makefile @@ -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 PKG_LICENSE:=GPL-3.0-or-later diff --git a/net/simple-adblock/files/simple-adblock.init b/net/simple-adblock/files/simple-adblock.init index e57a03b45b..fb6e99588a 100644 --- a/net/simple-adblock/files/simple-adblock.init +++ b/net/simple-adblock/files/simple-adblock.init @@ -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