db-jdo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcai...@apache.org
Subject svn commit: r612326 - /db/jdo/bin/behead
Date Wed, 16 Jan 2008 00:48:47 GMT
Author: mcaisse
Date: Tue Jan 15 16:48:45 2008
New Revision: 612326

URL: http://svn.apache.org/viewvc?rev=612326&view=rev
Log:
Add workaround for FrameMaker import bug. Add blank line to top of enum files for import.

Modified:
    db/jdo/bin/behead

Modified: db/jdo/bin/behead
URL: http://svn.apache.org/viewvc/db/jdo/bin/behead?rev=612326&r1=612325&r2=612326&view=diff
==============================================================================
--- db/jdo/bin/behead (original)
+++ db/jdo/bin/behead Tue Jan 15 16:48:45 2008
@@ -27,16 +27,25 @@
 do
     ROOT=`basename $FILE .java`
     OUTFILE=${TARGETDIR}/${ROOT}.txt
+    IS_ENUM=0
     if [ `grep -c "public enum" $FILE` -gt 0 ]
     then
         STARTINDEX=`grep --max-count=1 -n "${ENUMSTARTPATTERN}" $FILE | cut -d: -f1 `
+        IS_ENUM=1
     else
         STARTINDEX=`grep --max-count=1 -n $STARTPATTERN $FILE | cut -d: -f1 `
+        IS_ENUM=0
     fi
         #echo $STARTINDEX
         ENDINDEX=`wc -l $FILE | sed -e "s/^  *//" | cut -f1 -d" " `
         #echo $ENDINDEX
         NUMLINES=`expr $ENDINDEX - $STARTINDEX + 1`
         echo Copying ${NUMLINES} lines from $FILE to $OUTFILE
-        tail -n ${NUMLINES} $FILE > ${OUTFILE}
+        if [ ${IS_ENUM} -eq 1 ]
+        then
+            # Workaround for Frame bug: Add blank line at beginning
+            tail -n ${NUMLINES} $FILE | sed -e "1i\ " > ${OUTFILE}
+        else
+            tail -n ${NUMLINES} $FILE > ${OUTFILE}
+        fi
 done



Mime
View raw message