forked from mia/Aegisub
Added a new py script for SVN 1.3+
Originally committed to SVN as r577.
This commit is contained in:
parent
3d5be2bc55
commit
90d7d02926
1 changed files with 28 additions and 0 deletions
28
core/build/make-svn-rev-header-svn13.py
Normal file
28
core/build/make-svn-rev-header-svn13.py
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
#!/usr/bin/env python
|
||||||
|
# This file is used to automatically extract the SVN revision number and
|
||||||
|
# create a C include file.
|
||||||
|
|
||||||
|
#includes
|
||||||
|
from os.path import isfile
|
||||||
|
from sys import exit
|
||||||
|
|
||||||
|
#Get our SVN entries file - this has the rev # in it
|
||||||
|
svnfile=open('../.svn/entries', 'r')
|
||||||
|
|
||||||
|
svncontent=svnfile.readlines(10)
|
||||||
|
|
||||||
|
revision=svncontent[3]
|
||||||
|
|
||||||
|
#Write out our data
|
||||||
|
if isfile("svn-revision.h"):
|
||||||
|
infile = file("svn-revision.h", "r")
|
||||||
|
for ln in infile:
|
||||||
|
if ln == "#define BUILD_SVN_REVISION " + revision + "\n":
|
||||||
|
infile.close()
|
||||||
|
exit()
|
||||||
|
|
||||||
|
outfile = file("svn-revision.h", "w+")
|
||||||
|
outfile.write("// This file is automatically generated by make-svn-rev-header.py\n")
|
||||||
|
outfile.write("// Do not modify or add to revision control\n\n")
|
||||||
|
outfile.write("#define BUILD_SVN_REVISION " + revision + "\n")
|
||||||
|
outfile.close()
|
Loading…
Reference in a new issue