diff --git a/build/jam/FileRules b/build/jam/FileRules index a07112ef21..c6c5556ee0 100644 --- a/build/jam/FileRules +++ b/build/jam/FileRules @@ -377,6 +377,7 @@ rule DetermineHaikuRevision if ! [ on $(gitIndex) return $(HAIKU_GIT_REVISION_DETERMINED) ] { HAIKU_GIT_REVISION_DETERMINED on $(gitIndex) = 1 ; MakeLocate $(revisionFile) : $(HAIKU_BUILD_OUTPUT_DIR) ; + LocalClean clean : $(revisionFile) ; if $(HAIKU_REVISION) { DetermineHaikuRevision2 $(revisionFile) ; } else if [ Glob [ FDirName $(HAIKU_TOP) .git ] : index ] { @@ -404,6 +405,29 @@ actions DetermineHaikuRevision2 } +rule DetermineEffectiveHaikuRevision +{ + local revisionFile = effective-haiku-revision ; + if ! [ on $(revisionFile) return $(HAIKU_EFFECTIVE_REVISION_DETERMINED) ] { + HAIKU_EFFECTIVE_REVISION_DETERMINED on $(revisionFile) = 1 ; + MakeLocate $(revisionFile) : $(HAIKU_BUILD_OUTPUT_DIR) ; + local rawRevision = [ DetermineHaikuRevision ] ; + Depends $(revisionFile) : $(rawRevision) ; + DetermineEffectiveHaikuRevision1 $(revisionFile) : $(rawRevision) ; + LocalClean clean : $(revisionFile) ; + } + + return $(revisionFile) ; +} + + +actions DetermineEffectiveHaikuRevision1 +{ + revision=`sed -n 's,^\(hrev[0-9]*\).*,\1,p' "$(2:E=unknown-revision)"` + echo "${revision:-0}" > "$(1)" +} + + rule DataFileToSourceFile sourceFile : dataFile : dataVariable : sizeVariable { sourceFile = [ FGristFiles $(sourceFile) ] ; diff --git a/build/jam/PackageRules b/build/jam/PackageRules index ccfbcdafe1..2fbeea33a6 100644 --- a/build/jam/PackageRules +++ b/build/jam/PackageRules @@ -67,7 +67,7 @@ rule PreprocessPackageInfo source : directory : architecture += %HAIKU_SECONDARY_PACKAGING_ARCH_SUFFIX%, ; } - local revisionFile = [ DetermineHaikuRevision ] ; + local revisionFile = [ DetermineEffectiveHaikuRevision ] ; local updateRequiresFiles ; local haikuPortsRepositoryFile ; if ! $(HAIKU_BOOTSTRAP_BUILD) { @@ -92,9 +92,9 @@ rule PreprocessPackageInfo source : directory : architecture actions PreprocessPackageInfo1 { - revision=`sed -n 's,^\(hrev[0-9]*\).*,\1,p' $(2[2])` + revision=`cat $(2[2])` sed $(HAIKU_SED_REPLACEMENTS) \ - -e s,%HAIKU_VERSION%,$(HAIKU_VERSION)_${revision:-0}-1, < $(2[1]) \ + -e s,%HAIKU_VERSION%,$(HAIKU_VERSION)_${revision}-1, < $(2[1]) \ | $(HOST_CC) -E -w $(CCDEFS) - -o $(1) if [ -n "$(2[4]:E)" ]; then