2 # create-version-itexi.py
4 """ when being called on lilypond.org, pass it the location of the
5 top source dir on the command-line. """
13 # FIXME: if the depth depends on the type of build, figure it
15 ### just like depth in our GNUmakefiles
16 # these links are relative from /~graham/web/
18 # these links are relative from the v2.13 docs
19 #depth = "../../../../"
29 myDir
= os
.path
.dirname(sys
.argv
[0])
30 # use two abspaths to work around some windows python bug
31 topDir
= os
.path
.join(os
.path
.abspath(myDir
)+os
.sep
+'..'+os
.sep
+'..'+os
.sep
)
32 topDir
= os
.path
.abspath( topDir
)
35 # TODO: this might be useful for other scripts; can we make it available?
36 manuals
= map(lambda x
: os
.path
.splitext(x
)[0],
38 glob
.glob(os
.path
.join(topDir
,'Documentation', '*.te??'))))
39 #manuals = map(lambda x: 'glossary' if x=='music-glossary' else x, manuals)
40 manuals
.append('internals')
43 version_file_path
= os
.path
.join(topDir
, "VERSION")
45 version_contents
= open(version_file_path
).readlines()
49 for line
in version_contents
:
50 if (line
.startswith('MAJOR_VERSION')):
52 if (line
.startswith('MINOR_VERSION')):
54 if (line
.startswith('PATCH_LEVEL')):
56 if (line
.startswith('VERSION_STABLE')):
57 VERSION_STABLE
= line
[15:-1]
58 if (line
.startswith('VERSION_DEVEL')):
59 VERSION_DEVEL
= line
[14:-1]
61 VERSION
= str(major
)+'.'+str(minor
)+'.'+str(patch
)
63 def make_macro(name
, string
):
69 print "@c ************************ Version numbers ************"
70 make_macro("version", VERSION
)
71 make_macro("versionStable", VERSION_STABLE
)
72 make_macro("versionDevel", VERSION_DEVEL
)