From: Fabian Keil <fk@fabiankeil.de>
Date: Wed, 5 Aug 2020 09:23:06 +0000 (+0200)
Subject: tools/url-pattern-translator.pl: Skip patterns that have already been converted
X-Git-Tag: v_3_0_29~241
X-Git-Url: http://www.privoxy.org/gitweb/%22https:/static/gitweb.js?a=commitdiff_plain;h=2b20e4dfd8c1fa382ce680bcffb37e0a7af34634;p=privoxy.git

tools/url-pattern-translator.pl: Skip patterns that have already been converted

It should now be safe to "convert" a file multiple times.

Sponsored by: Robert Klemme
---

diff --git a/tools/url-pattern-translator.pl b/tools/url-pattern-translator.pl
index 4a786876..5bdcac10 100755
--- a/tools/url-pattern-translator.pl
+++ b/tools/url-pattern-translator.pl
@@ -15,9 +15,6 @@
 #
 # url-pattern-translator.pl old.action > new.action 
 #
-# Only convert your files once, or, as RoboCop used to say,
-# there will be... trouble.
-#
 # Copyright (c) 2008 Fabian Keil <fk@fabiankeil.de>
 #
 # Permission to use, copy, modify, and distribute this software for any
@@ -106,6 +103,10 @@ sub looks_interesting($) {
 
         $type_to_skip = "predefined settings";
 
+    } elsif (m@^\s*PCRE-HOST-PATTERN:@) {
+
+        $type_to_skip = "already converted pcre host patttern";
+
     }
 
     #p("Skipping " . $type_to_skip . ": " . $_) if defined $type_to_skip;