ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/macros/doc/addDesc.sh
Revision: 1.2
Committed: Thu Jul 16 13:39:12 2009 UTC (15 years, 9 months ago) by loizides
Content type: application/x-sh
Branch: MAIN
Changes since 1.1: +9 -40 lines
Log Message:
Next step

File Contents

# User Rev Content
1 loizides 1.1 #!/bin/bash
2 loizides 1.2 # $Id:$
3 loizides 1.1
4     hf=$1
5     sf=`dirname $hf`/`basename $hf .h`.cc
6     sf=`echo $sf | replace interface src`
7 loizides 1.2
8     if ! test -e $sf; then
9     echo "Did not find source file for ${hf}, exiting."
10     exit 123;
11     fi
12    
13 loizides 1.1 strs="//------------------------------"
14     lnum=`grep -n $strs $hf | cut -d: -f1 | head -n2 | tail -n1`
15    
16     if test -z $lnum; then
17 loizides 1.2 echo "Did not find header description for ${hf}, exiting."
18 loizides 1.1 exit 123;
19     fi
20    
21     head -n$lnum $hf > ${sf}.tmp
22 loizides 1.2 cat $sf | grep -v "// $$Id" > {sf}.tmp
23 loizides 1.1 mv ${sf} ${sf}.keep
24     mv ${sf}.tmp $sf