From: Remi Gacogne Date: Thu, 24 Jan 2019 16:38:28 +0000 (+0100) Subject: Use perl instead of sed to conditionally remove lines from Makefiles X-Git-Tag: rec-4.2.0-alpha1^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F7416%2Fhead;p=thirdparty%2Fpdns.git Use perl instead of sed to conditionally remove lines from Makefiles --- diff --git a/pdns/Makefile.am b/pdns/Makefile.am index 9bb09a6fd9..40030a515e 100644 --- a/pdns/Makefile.am +++ b/pdns/Makefile.am @@ -1515,43 +1515,43 @@ if HAVE_SYSTEMD pdns.service: pdns.service.in $(AM_V_GEN)sed -e 's![@]sbindir[@]!$(sbindir)!' < $< > $@ if !HAVE_SYSTEMD_LOCK_PERSONALITY - $(AM_V_GEN)sed -i '' -e '/^LockPersonality/d' $@ + $(AM_V_GEN)perl -ni -e 'print unless /^LockPersonality/' $@ endif if !HAVE_SYSTEMD_PRIVATE_DEVICES - $(AM_V_GEN)sed -i '' -e '/^PrivateDevices/d' $@ + $(AM_V_GEN)perl -ni -e 'print unless /^PrivateDevices/' $@ endif if !HAVE_SYSTEMD_PRIVATE_TMP - $(AM_V_GEN)sed -i '' -e '/^PrivateTmp/d' $@ + $(AM_V_GEN)perl -ni -e 'print unless /^PrivateTmp/' $@ endif if !HAVE_SYSTEMD_PROTECT_CONTROL_GROUPS - $(AM_V_GEN)sed -i '' -e '/^ProtectControlGroups/d' $@ + $(AM_V_GEN)perl -ni -e 'print unless /^ProtectControlGroups/' $@ endif if !HAVE_SYSTEMD_PROTECT_HOME - $(AM_V_GEN)sed -i '' -e '/^ProtectHome/d' $@ + $(AM_V_GEN)perl -ni -e 'print unless /^ProtectHome/' $@ endif if !HAVE_SYSTEMD_PROTECT_KERNEL_MODULES - $(AM_V_GEN)sed -i '' -e '/^ProtectKernelModules/d' $@ + $(AM_V_GEN)perl -ni -e 'print unless /^ProtectKernelModules/' $@ endif if !HAVE_SYSTEMD_PROTECT_KERNEL_TUNABLES - $(AM_V_GEN)sed -i '' -e '/^ProtectKernelTunables/d' $@ + $(AM_V_GEN)perl -ni -e 'print unless /^ProtectKernelTunables/' $@ endif if !HAVE_SYSTEMD_PROTECT_SYSTEM - $(AM_V_GEN)sed -i '' -e '/^ProtectSystem/d' $@ + $(AM_V_GEN)perl -ni -e 'print unless /^ProtectSystem/' $@ endif if !HAVE_SYSTEMD_RESTRICT_ADDRESS_FAMILIES - $(AM_V_GEN)sed -i '' -e '/^RestrictAddressFamilies/d' $@ + $(AM_V_GEN)perl -ni -e 'print unless /^RestrictAddressFamilies/' $@ endif if !HAVE_SYSTEMD_RESTRICT_NAMESPACES - $(AM_V_GEN)sed -i '' -e '/^RestrictNamespaces/d' $@ + $(AM_V_GEN)perl -ni -e 'print unless /^RestrictNamespaces/' $@ endif if !HAVE_SYSTEMD_RESTRICT_REALTIME - $(AM_V_GEN)sed -i '' -e '/^RestrictRealtime/d' $@ + $(AM_V_GEN)perl -ni -e 'print unless /^RestrictRealtime/' $@ endif if !HAVE_SYSTEMD_SYSTEM_CALL_ARCHITECTURES - $(AM_V_GEN)sed -i '' -e '/^SystemCallArchitectures/d' $@ + $(AM_V_GEN)perl -ni -e 'print unless /^SystemCallArchitectures/' $@ endif if !HAVE_SYSTEMD_SYSTEM_CALL_FILTER - $(AM_V_GEN)sed -i '' -e '/^SystemCallFilter/d' $@ + $(AM_V_GEN)perl -ni -e 'print unless /^SystemCallFilter/' $@ endif pdns@.service: pdns.service diff --git a/pdns/dnsdistdist/Makefile.am b/pdns/dnsdistdist/Makefile.am index 578f4643c8..ceeb6d0404 100644 --- a/pdns/dnsdistdist/Makefile.am +++ b/pdns/dnsdistdist/Makefile.am @@ -324,43 +324,43 @@ if HAVE_SYSTEMD dnsdist.service: dnsdist.service.in $(AM_V_GEN)sed -e 's![@]bindir[@]!$(bindir)!' < $< > $@ if !HAVE_SYSTEMD_LOCK_PERSONALITY - $(AM_V_GEN)sed -i '' -e '/^LockPersonality/d' $@ + $(AM_V_GEN)perl -ni -e 'print unless /^LockPersonality/' $@ endif if !HAVE_SYSTEMD_PRIVATE_DEVICES - $(AM_V_GEN)sed -i '' -e '/^PrivateDevices/d' $@ + $(AM_V_GEN)perl -ni -e 'print unless /^PrivateDevices/' $@ endif if !HAVE_SYSTEMD_PRIVATE_TMP - $(AM_V_GEN)sed -i '' -e '/^PrivateTmp/d' $@ + $(AM_V_GEN)perl -ni -e 'print unless /^PrivateTmp/' $@ endif if !HAVE_SYSTEMD_PROTECT_CONTROL_GROUPS - $(AM_V_GEN)sed -i '' -e '/^ProtectControlGroups/d' $@ + $(AM_V_GEN)perl -ni -e 'print unless /^ProtectControlGroups/' $@ endif if !HAVE_SYSTEMD_PROTECT_HOME - $(AM_V_GEN)sed -i '' -e '/^ProtectHome/d' $@ + $(AM_V_GEN)perl -ni -e 'print unless /^ProtectHome/' $@ endif if !HAVE_SYSTEMD_PROTECT_KERNEL_MODULES - $(AM_V_GEN)sed -i '' -e '/^ProtectKernelModules/d' $@ + $(AM_V_GEN)perl -ni -e 'print unless /^ProtectKernelModules/' $@ endif if !HAVE_SYSTEMD_PROTECT_KERNEL_TUNABLES - $(AM_V_GEN)sed -i '' -e '/^ProtectKernelTunables/d' $@ + $(AM_V_GEN)perl -ni -e 'print unless /^ProtectKernelTunables/' $@ endif if !HAVE_SYSTEMD_PROTECT_SYSTEM - $(AM_V_GEN)sed -i '' -e '/^ProtectSystem/d' $@ + $(AM_V_GEN)perl -ni -e 'print unless /^ProtectSystem/' $@ endif if !HAVE_SYSTEMD_RESTRICT_ADDRESS_FAMILIES - $(AM_V_GEN)sed -i '' -e '/^RestrictAddressFamilies/d' $@ + $(AM_V_GEN)perl -ni -e 'print unless /^RestrictAddressFamilies/' $@ endif if !HAVE_SYSTEMD_RESTRICT_NAMESPACES - $(AM_V_GEN)sed -i '' -e '/^RestrictNamespaces/d' $@ + $(AM_V_GEN)perl -ni -e 'print unless /^RestrictNamespaces/' $@ endif if !HAVE_SYSTEMD_RESTRICT_REALTIME - $(AM_V_GEN)sed -i '' -e '/^RestrictRealtime/d' $@ + $(AM_V_GEN)perl -ni -e 'print unless /^RestrictRealtime/' $@ endif if !HAVE_SYSTEMD_SYSTEM_CALL_ARCHITECTURES - $(AM_V_GEN)sed -i '' -e '/^SystemCallArchitectures/d' $@ + $(AM_V_GEN)perl -ni -e 'print unless /^SystemCallArchitectures/' $@ endif if !HAVE_SYSTEMD_SYSTEM_CALL_FILTER - $(AM_V_GEN)sed -i '' -e '/^SystemCallFilter/d' $@ + $(AM_V_GEN)perl -ni -e 'print unless /^SystemCallFilter/' $@ endif dnsdist@.service: dnsdist.service diff --git a/pdns/recursordist/Makefile.am b/pdns/recursordist/Makefile.am index 9dfd6dbb05..92c8ae5a27 100644 --- a/pdns/recursordist/Makefile.am +++ b/pdns/recursordist/Makefile.am @@ -451,43 +451,43 @@ if HAVE_SYSTEMD pdns-recursor.service: pdns-recursor.service.in $(AM_V_GEN)sed -e 's![@]sbindir[@]!$(sbindir)!' < $< > $@ if !HAVE_SYSTEMD_LOCK_PERSONALITY - $(AM_V_GEN)sed -i '' -e '/^LockPersonality/d' $@ + $(AM_V_GEN)perl -ni -e 'print unless /^LockPersonality/' $@ endif if !HAVE_SYSTEMD_PRIVATE_DEVICES - $(AM_V_GEN)sed -i '' -e '/^PrivateDevices/d' $@ + $(AM_V_GEN)perl -ni -e 'print unless /^PrivateDevices/' $@ endif if !HAVE_SYSTEMD_PRIVATE_TMP - $(AM_V_GEN)sed -i '' -e '/^PrivateTmp/d' $@ + $(AM_V_GEN)perl -ni -e 'print unless /^PrivateTmp/' $@ endif if !HAVE_SYSTEMD_PROTECT_CONTROL_GROUPS - $(AM_V_GEN)sed -i '' -e '/^ProtectControlGroups/d' $@ + $(AM_V_GEN)perl -ni -e 'print unless /^ProtectControlGroups/' $@ endif if !HAVE_SYSTEMD_PROTECT_HOME - $(AM_V_GEN)sed -i '' -e '/^ProtectHome/d' $@ + $(AM_V_GEN)perl -ni -e 'print unless /^ProtectHome/' $@ endif if !HAVE_SYSTEMD_PROTECT_KERNEL_MODULES - $(AM_V_GEN)sed -i '' -e '/^ProtectKernelModules/d' $@ + $(AM_V_GEN)perl -ni -e 'print unless /^ProtectKernelModules/' $@ endif if !HAVE_SYSTEMD_PROTECT_KERNEL_TUNABLES - $(AM_V_GEN)sed -i '' -e '/^ProtectKernelTunables/d' $@ + $(AM_V_GEN)perl -ni -e 'print unless /^ProtectKernelTunables/' $@ endif if !HAVE_SYSTEMD_PROTECT_SYSTEM - $(AM_V_GEN)sed -i '' -e '/^ProtectSystem/d' $@ + $(AM_V_GEN)perl -ni -e 'print unless /^ProtectSystem/' $@ endif if !HAVE_SYSTEMD_RESTRICT_ADDRESS_FAMILIES - $(AM_V_GEN)sed -i '' -e '/^RestrictAddressFamilies/d' $@ + $(AM_V_GEN)perl -ni -e 'print unless /^RestrictAddressFamilies/' $@ endif if !HAVE_SYSTEMD_RESTRICT_NAMESPACES - $(AM_V_GEN)sed -i '' -e '/^RestrictNamespaces/d' $@ + $(AM_V_GEN)perl -ni -e 'print unless /^RestrictNamespaces/' $@ endif if !HAVE_SYSTEMD_RESTRICT_REALTIME - $(AM_V_GEN)sed -i '' -e '/^RestrictRealtime/d' $@ + $(AM_V_GEN)perl -ni -e 'print unless /^RestrictRealtime/' $@ endif if !HAVE_SYSTEMD_SYSTEM_CALL_ARCHITECTURES - $(AM_V_GEN)sed -i '' -e '/^SystemCallArchitectures/d' $@ + $(AM_V_GEN)perl -ni -e 'print unless /^SystemCallArchitectures/' $@ endif if !HAVE_SYSTEMD_SYSTEM_CALL_FILTER - $(AM_V_GEN)sed -i '' -e '/^SystemCallFilter/d' $@ + $(AM_V_GEN)perl -ni -e 'print unless /^SystemCallFilter/' $@ endif pdns-recursor@.service: pdns-recursor.service