]> Sergey Matveev's repositories - public-inbox.git/blobdiff - script/public-inbox-init
init: support git <2.30 for "-c KEY=VALUE" args
[public-inbox.git] / script / public-inbox-init
index e22a0564c4e4b9673e77b65200ed88cdd0f8000b..6fac4d184d14a822e2f9324cb841fbe26ecc4612 100755 (executable)
@@ -231,8 +231,11 @@ run_die([@x, "$pfx.newsgroup", $ng]) if $ng ne '';
 
 for my $kv (@c_extra) {
        my ($k, $v) = split(/=/, $kv, 2);
-       # --fixed-value for idempotent invocations
-       run_die([@x, qw(--replace-all --fixed-value), "$pfx.$k", $v, $v]);
+       # git 2.30+ has --fixed-value for idempotent invocations,
+       # but that's too new to depend on in 2021.  Perl quotemeta
+       # seems compatible enough for POSIX ERE which git uses
+       my $re = '^'.quotemeta($v).'$';
+       run_die([@x, qw(--replace-all), "$pfx.$k", $v, $re]);
 }
 
 # needed for git prior to v2.1.0