Quellcode durchsuchen

* Generate revision.inc include file depending on last modified comitted file

git-svn-id: trunk@23954 -
pierre vor 12 Jahren
Ursprung
Commit
98e9423978
2 geänderte Dateien mit 28 neuen und 0 gelöschten Zeilen
  1. 1 0
      .gitattributes
  2. 27 0
      utils/fpcm/get_revision.sh

+ 1 - 0
.gitattributes

@@ -14161,6 +14161,7 @@ utils/fpcm/fpcmmain.pp svneol=native#text/plain
 utils/fpcm/fpcmpkg.pp svneol=native#text/plain
 utils/fpcm/fpcmwr.pp svneol=native#text/plain
 utils/fpcm/fpmake.pp svneol=native#text/plain
+utils/fpcm/get_revision.sh svneol=native#text/plain
 utils/fpcm/makefile.exm -text
 utils/fpcm/printmakefilefpcrequirements.sh svneol=native#text/plain
 utils/fpcm/readme.txt svneol=native#text/plain

+ 27 - 0
utils/fpcm/get_revision.sh

@@ -0,0 +1,27 @@
+#!/bin/sh
+
+# List of files which should be considered imprtant
+# for the behavior of fpcmake binary
+# fpcmake.inc and Makefile should be excluded from that list
+important_sources=`ls -1 fpcm*.pp fpcmake.ini Makefile.fpc`
+
+LANG=C
+export LANG
+
+tmpfiles=
+
+for f in $important_sources ; do
+  tmpfile=.tmp.$f
+  tmpfiles="$tmpfiles $tmpfile"
+  svn info $f > $tmpfile
+done
+
+# echo "svn_info is $svn_info"
+svn_date=`gawk '/Last Changed Date: / {print $4 }' $tmpfiles | sort -n | tail -1`
+svn_rev=`gawk '/Last Changed Rev: / {print $4 }' $tmpfiles | sort -n | tail -1`
+echo "for files $important_sources, date is $svn_date, rev is $svn_rev"
+echo "'$svn_date rev $svn_rev'" > revision.inc
+rm -Rf $tmpfiles
+
+
+