fix generator of localized_schema.php

This commit is contained in:
Andrew Dolgov 2011-12-13 13:18:34 +04:00
parent 9da0e4a2ff
commit 43dd8898bd

View file

@ -2,17 +2,18 @@
BASENAME=`basename $0` BASENAME=`basename $0`
TMPFILE="/tmp/$BASENAME-$$.tmp" TMPFILE="/tmp/$BASENAME-$$.tmp"
OUTFILE="include/localized_schema.php"
cat schema/ttrss_schema_pgsql.sql | grep 'insert.*pref_name' | awk -F\' '{ print $8 }' > $TMPFILE cat schema/ttrss_schema_pgsql.sql | grep 'insert.*pref_name' | awk -F\' '{ print $8 }' > $TMPFILE
cat schema/ttrss_schema_pgsql.sql | grep 'insert.*pref_name' | awk -F\' '{ print $6 }' >> $TMPFILE cat schema/ttrss_schema_pgsql.sql | grep 'insert.*pref_name' | awk -F\' '{ print $6 }' >> $TMPFILE
echo "<?php # This file has been generated at: " `date` > localized_schema.php echo "<?php # This file has been generated at: " `date` > $OUTFILE
echo >> localized_schema.php echo >> $OUTFILE
cat utils/localized_schema.txt >> localized_schema.php cat utils/localized_schema.txt >> $OUTFILE
echo >> localized_schema.php echo >> $OUTFILE
cat $TMPFILE | grep -v '^$' | sed "s/.*/__('&');/" >> localized_schema.php cat $TMPFILE | grep -v '^$' | sed "s/.*/__('&');/" >> $OUTFILE
echo "?>" >> localized_schema.php echo "?>" >> $OUTFILE
rm $TMPFILE rm $TMPFILE