diff libtomcrypt/filter.pl @ 398:59c7938af2bd

merge of '1250b8af44b62d8f4fe0f8d9fc7e7a1cc34e7e1c' and '7f8670ac3bb975f40967f3979d09d2199b7e90c8'
author Matt Johnston <matt@ucc.asn.au>
date Sat, 03 Feb 2007 08:20:30 +0000
parents 0cbe8f6dbf9e
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/libtomcrypt/filter.pl	Sat Feb 03 08:20:30 2007 +0000
@@ -0,0 +1,30 @@
+#!/usr/bin/perl
+
+# we want to filter every between START_INS and END_INS out and then insert crap from another file (this is fun)
+
+$dst = shift;
+$ins = shift;
+
+open(SRC,"<$dst");
+open(INS,"<$ins");
+open(TMP,">tmp.delme");
+
+$l = 0;
+while (<SRC>) {
+   if ($_ =~ /START_INS/) {
+      print TMP $_;
+      $l = 1;
+      while (<INS>) {
+         print TMP $_;
+      }
+      close INS;
+   } elsif ($_ =~ /END_INS/) {
+      print TMP $_;
+      $l = 0;
+   } elsif ($l == 0) {
+      print TMP $_;
+   }
+}
+
+close TMP;
+close SRC;