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 <waddlesplash@gmail.com>
(cherry picked from commit e7c5d994267fb7d49e3dd50c2854e9b37c9ffca1)
Reviewed-on: https://review.haiku-os.org/597
This commit is contained in:
Augustin Cavalier 2018-09-26 23:12:34 -04:00 committed by waddlesplash
parent c29a7780db
commit b16a18cba6
2 changed files with 2 additions and 31 deletions

View File

@ -405,35 +405,6 @@ actions DetermineHaikuRevision2
}
rule DetermineEffectiveHaikuRevision
{
local revisionFile = <haiku-rootdir>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) ] ;

View File

@ -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, \