From b16a18cba6ce231cf1acb106723f0b4b7693a488 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Wed, 26 Sep 2018 23:12:34 -0400 Subject: [PATCH] build: Include extra information in the package version. Previously only the "effective revision", i.e. the hrev by itself, was used. Now we include the "commits ahead" count and the "dirty" flag, if they're there, using _ instead of - of course. Change-Id: I5238d01926c2cca242bffbdef30bff606a173a06 Reviewed-on: https://review.haiku-os.org/596 Reviewed-by: waddlesplash (cherry picked from commit e7c5d994267fb7d49e3dd50c2854e9b37c9ffca1) Reviewed-on: https://review.haiku-os.org/597 --- build/jam/FileRules | 29 ----------------------------- build/jam/PackageRules | 4 ++-- 2 files changed, 2 insertions(+), 31 deletions(-) diff --git a/build/jam/FileRules b/build/jam/FileRules index b0d6d7369d..a84830fbe1 100644 --- a/build/jam/FileRules +++ b/build/jam/FileRules @@ -405,35 +405,6 @@ 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)"` - if [ -z "$revision" ]; then - echo "Error: unable to determine the effective Haiku revision." - echo " If you are using a Haiku clone without tags, you can set" - echo " the revision tag to use with e.g. HAIKU_REVISION=hrev43210" - exit 1 - fi - echo "${revision:-0}" > "$(1)" -} - - rule DataFileToSourceFile sourceFile : dataFile : dataVariable : sizeVariable { sourceFile = [ FGristFiles $(sourceFile) ] ; diff --git a/build/jam/PackageRules b/build/jam/PackageRules index 2826b6e313..2e27f73360 100644 --- a/build/jam/PackageRules +++ b/build/jam/PackageRules @@ -117,7 +117,7 @@ rule PreprocessPackageOrRepositoryInfo target : source : architecture defines += HAIKU_BUILD_FEATURE_$(featureSplit:UJ=_)_ENABLED ; } - local revisionFile = [ DetermineEffectiveHaikuRevision ] ; + local revisionFile = [ DetermineHaikuRevision ] ; Depends $(target) : $(source) $(revisionFile) ; if useCPP in $(flags) { @@ -135,7 +135,7 @@ rule PreprocessPackageOrRepositoryInfo target : source : architecture actions PreprocessPackageOrRepositoryInfo1 { - revision=`cat $(2[2])` + revision=`cat $(2[2]) | sed 's/[+-]/_/g'` version=$(HAIKU_VERSION)_${revision} sed $(HAIKU_SED_REPLACEMENTS) \ -e s,%HAIKU_VERSION%,${version}-1, \