From: hno <> Date: Wed, 26 Sep 2007 04:18:13 +0000 (+0000) Subject: awk version of merge-cf.data.pre X-Git-Tag: SQUID_3_0_RC1~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=58fbbd9f4153a41f9ad0badd41093fa0da49558b;p=thirdparty%2Fsquid.git awk version of merge-cf.data.pre --- diff --git a/scripts/merge-cf.data.pre.awk b/scripts/merge-cf.data.pre.awk new file mode 100755 index 0000000000..e09cd09293 --- /dev/null +++ b/scripts/merge-cf.data.pre.awk @@ -0,0 +1,21 @@ +# +# This script reassembles a split configuration file back into a cf.data.pre +# file. + +BEGIN { dir = SRCDIR "conf/"; } +/^NAME: / { + tag = $2; + file=dir tag ".txt"; + $0 = "FILE_NOT_FOUND"; + getline < file; + if (/^FILE_NOT_FOUND/) { + print "ERROR: '" file "' not found!" > "/dev/stderr"; + exit 1; + } + print; + while (getline < file) { + print; + } + next; +} +{print} diff --git a/scripts/split-cf.data.pre.pl b/scripts/split-cf.data.pre.pl index 1805dc3eee..aaf73a49f7 100755 --- a/scripts/split-cf.data.pre.pl +++ b/scripts/split-cf.data.pre.pl @@ -8,9 +8,9 @@ use File::Basename; # This mess is designed to parse the squid config template file # cf.data.pre and split it into separare files, one per option # -# Henrik Nordstrom # -# $Id: split-cf.data.pre.pl,v 1.1 2007/08/08 07:38:33 hno Exp $ +# $Id: split-cf.data.pre.pl,v 1.2 2007/09/25 22:18:13 hno Exp $ # # The template file is reasonably simple to parse. There's a number of