]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
awk version of merge-cf.data.pre
authorhno <>
Wed, 26 Sep 2007 04:18:13 +0000 (04:18 +0000)
committerhno <>
Wed, 26 Sep 2007 04:18:13 +0000 (04:18 +0000)
scripts/merge-cf.data.pre.awk [new file with mode: 0755]
scripts/split-cf.data.pre.pl

diff --git a/scripts/merge-cf.data.pre.awk b/scripts/merge-cf.data.pre.awk
new file mode 100755 (executable)
index 0000000..e09cd09
--- /dev/null
@@ -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}
index 1805dc3eeeabad02ccd5dd05491324abc3bb20e6..aaf73a49f7f5ef93da934f60998e7328a7c5f248 100755 (executable)
@@ -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 <henrik@henriknordstrom.net½
+# Henrik Nordstrom <henrik@henriknordstrom.net>
 #
-# $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