Add user settable HAIKU_REVISION build variable

Can be set to a revision string (hrev4...) to override the revision
determined via git. Useful when the repository doesn't have tags.
This commit is contained in:
Ingo Weinhold 2013-11-20 16:42:05 +01:00
parent 1329152b52
commit 5fc2757a74
2 changed files with 14 additions and 2 deletions

View File

@ -375,10 +375,12 @@ rule DetermineHaikuRevision
local gitIndex = <haiku-rootdir-git>index ;
local revisionFile = <haiku-rootdir-git>haiku-revision ;
if ! [ on $(gitIndex) return $(HAIKU_GIT_REVISION_DETERMINED) ] {
if [ Glob [ FDirName $(HAIKU_TOP) .git ] : index ] {
MakeLocate $(revisionFile) : $(HAIKU_BUILD_OUTPUT_DIR) ;
if $(HAIKU_REVISION) {
DetermineHaikuRevision2 $(revisionFile) ;
} else if [ Glob [ FDirName $(HAIKU_TOP) .git ] : index ] {
HAIKU_GIT_REVISION_DETERMINED on $(gitIndex) = 1 ;
SEARCH on $(gitIndex) = [ FDirName $(HAIKU_TOP) .git ] ;
MakeLocate $(revisionFile) : $(HAIKU_BUILD_OUTPUT_DIR) ;
Depends $(revisionFile) : $(gitIndex) ;
DetermineHaikuRevision1 $(revisionFile) : $(gitIndex) ;
} else {
@ -396,6 +398,12 @@ actions DetermineHaikuRevision1
}
actions DetermineHaikuRevision2
{
echo $(HAIKU_REVISION) > $(1)
}
rule DataFileToSourceFile sourceFile : dataFile : dataVariable : sizeVariable
{
sourceFile = [ FGristFiles $(sourceFile) ] ;

View File

@ -87,6 +87,10 @@ HAIKU_DONT_CLEAR_IMAGE = 1 ;
# several times larger than even with level 1.
HAIKU_PACKAGE_COMPRESSION_LEVEL = 1 ;
# Override the Haiku revision string determined via git. This is e.g. useful,
# when your git repository doesn't have hrev tags. You may need to remove the
# file <generated>/build/haiku-revision whenever you change this variable.
HAIKU_REVISION = hrev66666 ;
# Affects the haiku-image, haiku-vmware-image, and install-haiku targets. Only
# targets on which the HAIKU_INCLUDE_IN_IMAGE variable has been set will be