From a585dbc537b7b8e781594f03eb9d33bc769de3ba 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 | 8 ++++++++ 2 files changed, 10 insertions(+), 5 deletions(-) create mode 100755 contrib/template-local.sh diff --git a/Makefile b/Makefile index 31bebf1..6a566b3 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..8212028 --- /dev/null +++ b/contrib/template-local.sh @@ -0,0 +1,8 @@ +#!/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}"