ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/macros/doc/addDesc.sh
(Generate patch)

Comparing UserCode/MitAna/macros/doc/addDesc.sh (file contents):
Revision 1.1 by loizides, Thu Jul 16 13:13:55 2009 UTC vs.
Revision 1.2 by loizides, Thu Jul 16 13:39:12 2009 UTC

# Line 1 | Line 1
1   #!/bin/bash
2 + # $Id$
3  
4   hf=$1
5   sf=`dirname $hf`/`basename $hf .h`.cc
6   sf=`echo $sf | replace interface src`
7 +
8 + if ! test -e $sf; then
9 +    echo "Did not find source file for ${hf}, exiting."
10 +    exit 123;
11 + fi
12 +
13   strs="//------------------------------"
14   lnum=`grep -n $strs $hf | cut -d: -f1 | head -n2 | tail -n1`
15  
16   if test -z $lnum; then
17 <    echo "Did not find header description, exiting."
17 >    echo "Did not find header description for ${hf}, exiting."
18      exit 123;
19   fi
20  
14
15 echo $lnum
21   head -n$lnum $hf > ${sf}.tmp
22 < cat $sf | grep -v "// \$Id${sf}.tmp
22 > cat $sf | grep -v "// $$Id" > {sf}.tmp
23   mv ${sf} ${sf}.keep
24   mv ${sf}.tmp $sf
20 exit 1;
21
22 maxlnum=`grep -n ClassImp $sf | cut -d: -f1`
23 f1num=`grep -n $strs $sf | cut -d: -f1 | head -n1 | tail -n1`
24 f2num=`grep -n $strs $sf | cut -d: -f1 | head -n2 | tail -n1`
25
26 if test -z $maxlnum; then
27    echo "Did not find ClassImp in source file, exiting."
28    exit 123;
29 fi
30
31 if test $maxlnum -gt 0; then
32    maxlnum=`expr $maxlnum - 1`
33 fi
34
35 if test $f1num -gt 0; then
36    f1num=`expr $f1num - 1`
37 fi
38 if test $f2num -gt 0; then
39    f2num=`expr $f2num + 1`
40 fi
41
42 echo $maxlnum $f1num - $f2num
43
44 tlnum=`wc -l $sf`
45 echo test $tlnum
46 expr $tlnum - $lnum
47
48 if test $f1num -gt $maxlnum; then
49    echo "->>>>>>>>>>>>>>>>>> $fnum"
50    head -n$maxlnum $sf
51    head -n$lnum $hf | grep -v "// \"
52    tail -n$fnum $sf
53 else
54    echo "dooo";
55 fi

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines