get_revision.sh 753 B

12345678910111213141516171819202122232425262728293031
  1. #!/bin/sh
  2. # List of files which should be considered imprtant
  3. # for the behavior of fpcmake binary
  4. # fpcmake.inc and Makefile should be excluded from that list
  5. if [ "$#" -ge 1 ] ; then
  6. important_files="$*"
  7. else
  8. important_sources=`ls -1 fpcm*.pp fpcmake.ini Makefile.fpc`
  9. fi
  10. LANG=C
  11. export LANG
  12. tmpfiles=
  13. for f in $important_sources ; do
  14. tmpfile=.tmp.$f
  15. tmpfiles="$tmpfiles $tmpfile"
  16. svn info $f > $tmpfile
  17. done
  18. # echo "svn_info is $svn_info"
  19. svn_date=`gawk '/Last Changed Date: / {print $4 }' $tmpfiles | sort -n | tail -1`
  20. svn_rev=`gawk '/Last Changed Rev: / {print $4 }' $tmpfiles | sort -n | tail -1`
  21. echo "for files $important_sources, date is $svn_date, rev is $svn_rev"
  22. echo "'$svn_date rev $svn_rev'" > revision.inc
  23. rm -Rf $tmpfiles