From f3961006ac9718be34ecdf9cd00d69c2aff4e510 Mon Sep 17 00:00:00 2001 From: David Schleef Date: Wed, 7 Jan 2004 21:07:12 +0000 Subject: [PATCH] Convert make_filter to sh. Add make_filter's id to the output Original commit message from CVS: Convert make_filter to sh. Add make_filter's id to the output --- gst/videofilter/gstvideotemplate.c | 4 ++- gst/videofilter/make_filter | 51 +++++++++++++++--------------- 2 files changed, 28 insertions(+), 27 deletions(-) diff --git a/gst/videofilter/gstvideotemplate.c b/gst/videofilter/gstvideotemplate.c index f633a5fa8..d44247749 100644 --- a/gst/videofilter/gstvideotemplate.c +++ b/gst/videofilter/gstvideotemplate.c @@ -19,8 +19,10 @@ */ /* - * This file was (probably) generated from gstvideotemplate.c, + * This file was (probably) generated from * $Id$ + * and + * MAKEFILTERVERSION */ #ifdef HAVE_CONFIG_H diff --git a/gst/videofilter/make_filter b/gst/videofilter/make_filter index 2cc66ffaa..481f8ede2 100755 --- a/gst/videofilter/make_filter +++ b/gst/videofilter/make_filter @@ -1,33 +1,32 @@ -#!/usr/bin/perl -# +#!/bin/sh -if(scalar(@ARGV) < 1){ - print "$0 Objectname\n"; - print " creates gstobjectname.{c,h} implementing GstObjectname,\n"; - print " subclassing GstVideofilter.\n"; - exit(0); -} +Template=$1; +srcfile=$2; -$Template = $ARGV[0]; -($TEMPLATE = $Template) =~ tr/a-z/A-Z/; -($template = $Template) =~ tr/A-Z/a-z/; +if test x"$1" = x ; then + echo "$0 Objectname [srcfile]\n"; + echo " creates gstobjectname.{c,h} implementing GstObjectname,\n"; + echo " subclassing GstVideofilter.\n"; + exit 1; +fi -open IN, "gstvideotemplate.c"; -open OUT, ">gst$template.c"; +if test x"$2" = x ; then + srcfile="gstvideotemplate.c" +fi -@lines = ; -map { - s/gstvideotemplate\.c/SOURCEFILE/g; - s/Videotemplate/$Template/g; - s/videotemplate/$template/g; - s/VIDEOTEMPLATE/$TEMPLATE/g; - # remember to break up the Id: in the line below - s/\$I[d]: (.*)\$/$1/g; - s/SOURCEFILE/gstvideotemplate\.c/g; -} @lines; +id=$(echo '$Id$I[d]: \(.*\)\$/\1/g" ) -print OUT @lines; +TEMPLATE=$(echo $Template | tr a-z A-Z) +template=$(echo $Template | tr A-Z a-z) -close IN; -close OUT; +# remember to break up the Id: in the line below +sed \ + -e "s/gstvideotemplate\.c/SOURCEFILE/g" \ + -e "s/Videotemplate/$Template/g" \ + -e "s/videotemplate/$template/g" \ + -e "s/VIDEOTEMPLATE/$TEMPLATE/g" \ + -e "s/\$I[d]: \(.*\)\$/\1/g" \ + -e "s/SOURCEFILE/gstvideotemplate\.c/g" \ + -e "s/MAKEFILTERVERSION/$id/g" \ + $srcfile >gst$template.c -- 2.34.1