From 54612e333fe72a7fb329f11cf543e87cec80479e Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 12 Nov 2025 18:21:39 +0100 Subject: [PATCH] contrib/template-local: split off from Makefile --- Makefile | 7 ++----- contrib/template-local.sh | 11 +++++++++++ 2 files changed, 13 insertions(+), 5 deletions(-) create mode 100755 contrib/template-local.sh diff --git a/Makefile b/Makefile index 14aab08..b90002d 100644 --- a/Makefile +++ b/Makefile @@ -31,11 +31,8 @@ rsc: $(GEN_RSC) %.capsman.rsc: %.template.rsc contrib/template-capsman.sh contrib/template-capsman.sh $< > $@ -%.local.rsc: %.template.rsc Makefile - sed -e '/\/caps-man\//d' -e '/\/interface\/wifi\//d' -e 's|%TEMPL%|.local|' \ - -e '/^# NOT \/interface\/wireless\/ #$$/,/^# NOT \/interface\/wireless\/ #$$/d' \ - -e '/^# !!/,/^# !!/c # !! Do not edit this file, it is generated from template!' \ - < $< > $@ +%.local.rsc: %.template.rsc contrib/template-local.sh + contrib/template-local.sh $< > $@ %.wifi.rsc: %.template.rsc Makefile sed -e '/\/caps-man\//d' -e '/\/interface\/wireless\//d' -e 's|%TEMPL%|.wifi|' \ diff --git a/contrib/template-local.sh b/contrib/template-local.sh new file mode 100755 index 0000000..bc5b327 --- /dev/null +++ b/contrib/template-local.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +set -e + +sed \ + -e '/\/caps-man\//d' \ + -e '/\/interface\/wifi\//d' \ + -e 's|%TEMPL%|.local|' \ + -e '/^# NOT \/interface\/wireless\/ #$/,/^# NOT \/interface\/wireless\/ #$/d' \ + -e '/^# !!/,/^# !!/c # !! Do not edit this file, it is generated from template!' \ + < "${1}"