Chriss wrote:No, the according pkgver() function is called directly after the sources are downloaded, before patches are applied, and before cmake and make is run in the build step. But it's a bash function - I can pretty much do everything bash let's me do, so I can in theory run cmake or a python script. Preference on a python script I think.
Well, it doesn't look like the build number discussion will be wrapped up within the next few hours, and fumbling around with that after creation of the release branch... I don't know. Currently I'd prefer to do that after the 0.4.5 release.
So, if you want to build the build number composition logic into a bash/Python script, here are the relevant lines from our make_versioncpp.py script which construct the build number:
Code: Select all
commit = check_output(["git", "show", "-s", "--format=%h", "HEAD"]).strip()
timestamp = float(check_output(["git", "show", "-s", "--format=%ct", "HEAD"]).strip())
build_no = ".".join([datetime.utcfromtimestamp(timestamp).strftime("%Y-%m-%d"), commit])
Basically, the timestamp of the commit gets fetched, converted into UTC timezone and after that into a string of the format "YYYY-MM-DD", where YYYY is the four digit year number, and MM and DD the two digit month and day numbers of that timestamp. That string is suffixed with "." and the commit hash as returned by: