Closed bobh0303 closed 7 years ago
You can do this as of today's commit, but it's not pretty: VERSION = '1.200' devver = getversion() if devver != '' : VERSION += "-dev-" + devver
The tricky bit is inserting the - when there is something to add and not otherwise. I wonder what would be an easier user interface to this?
A couple of issues with this approach:
1) The resulting VERSION string isn't acceptable to the version
parameter of font()
; I fixed this by creating a fontVersion global which I used in the font() function, i.e.:
VERSION = '1.200'
fontVersion = VERSION
devver = getversion()
if devver != '' : VERSION += "-dev-" + devver
2) In the case of a dev version, smith exe
is now broken:
[18/19] Copier: ../../usr/lib/waf-1.6.8-b2d8f48ab96b0a4a23fe92e0176b39bc/waflib/extras/installer.nsi OFL.txt OFL-FAQ.txt FONTLOG.txt README.md documentation/DOCUMENTATION.txt documentation/Lateef-features.odt documentation/Lateef-features.pdf documentation/Lateef-typesample.odt documentation/Lateef-typesample.pdf documentation/README.txt -> results/installer_LateefGR.nsi
[19/19] installers/LateefGR-1.200-dev-7432fbM.exe: results/installer_LateefGR.nsi -> results/installers/LateefGR-1.200-dev-7432fbM.exe
00:05:16 runner ' /usr/bin/makensis -V4 -Oinstaller_LateefGR.log installer_LateefGR.nsi '
smith: Leaving directory `/vagrant/font-lateef/results'
File "/usr/bin/smith", line 162, in <module>
Scripting.waf_entry_point(cwd, VERSION, wafdir)
File "/usr/lib/waf-1.6.8-b2d8f48ab96b0a4a23fe92e0176b39bc/waflib/Scripting.py", line 158, in waf_entry_point
run_commands()
File "/usr/lib/waf-1.6.8-b2d8f48ab96b0a4a23fe92e0176b39bc/waflib/Scripting.py", line 249, in run_commands
run_command(cmd_name)
File "/usr/lib/waf-1.6.8-b2d8f48ab96b0a4a23fe92e0176b39bc/waflib/Scripting.py", line 235, in run_command
ctx.execute()
File "/usr/lib/waf-1.6.8-b2d8f48ab96b0a4a23fe92e0176b39bc/waflib/Scripting.py", line 555, in execute
return execute_method(self)
File "/usr/lib/waf-1.6.8-b2d8f48ab96b0a4a23fe92e0176b39bc/waflib/extras/wafplus.py", line 338, in execute
return old_exec(bld)
File "/usr/lib/waf-1.6.8-b2d8f48ab96b0a4a23fe92e0176b39bc/waflib/Build.py", line 232, in execute
self.execute_build()
File "/usr/lib/waf-1.6.8-b2d8f48ab96b0a4a23fe92e0176b39bc/waflib/Build.py", line 254, in execute_build
self.compile()
File "/usr/lib/waf-1.6.8-b2d8f48ab96b0a4a23fe92e0176b39bc/waflib/Tools/errcheck.py", line 167, in check_compile
ret = self.orig_compile()
File "/usr/lib/waf-1.6.8-b2d8f48ab96b0a4a23fe92e0176b39bc/waflib/Build.py", line 363, in compile
raise Errors.BuildError(self.producer.error)
File "/usr/lib/waf-1.6.8-b2d8f48ab96b0a4a23fe92e0176b39bc/waflib/Errors.py", line 51, in __init__
WafError.__init__(self, self.format_error())
Build failed
-> task failed (exit status 1):
{task 140445263727952: installers/LateefGR-1.200-dev-7432fbM.exe installer_LateefGR.nsi -> LateefGR-1.200-dev-7432fbM.exe}
' /usr/bin/makensis -V4 -Oinstaller_LateefGR.log installer_LateefGR.nsi '
for the record:
vagrant@smith:/vagrant/font-lateef$ smith version
Version of smith currently installed (as a package):
Version: 0.3.2-0~2927-snapshot-201612171301~ubuntu14.04.1
Version of waf currently installed:
waf 1.6.8 (11517)
This is due to the VIProductVersion parsing the VERSION expecting it to be purely numeric. Fixed in 097781e to ignore everything after the numbers in a VERSION string.
For dev builds, it would be nice if the zip and exe filenames could include the info returned by getversion(). So for example instead of
LateefGR-1.200.zip
we might haveLateefGR-1.200-dev-a1b2c3d4.zip