Encode the hrev revision into the package versions

This commit is contained in:
Ingo Weinhold 2013-10-10 21:38:07 +02:00
parent 04d9b3e89c
commit 97d30f2cfb
2 changed files with 13 additions and 4 deletions

View File

@ -11,6 +11,11 @@
# directory paths and the like. # directory paths and the like.
# The Haiku (base) version. For development builds the revision will be
# attached.
HAIKU_VERSION = r1~alpha4_pm ;
#pragma mark - container settings #pragma mark - container settings
# Haiku image # Haiku image

View File

@ -42,7 +42,6 @@ rule PreprocessPackageInfo source : directory : architecture
local target = $(source:BSG=package-info)-package-info ; local target = $(source:BSG=package-info)-package-info ;
local defines = HAIKU_PACKAGING_ARCH=$(architecture) ; local defines = HAIKU_PACKAGING_ARCH=$(architecture) ;
local sedReplacements = %HAIKU_PACKAGING_ARCH%,$(architecture) ; local sedReplacements = %HAIKU_PACKAGING_ARCH%,$(architecture) ;
sedReplacements += %HAIKU_VERSION%,R1~alpha4_pm-1 ;
if $(HAIKU_BOOTSTRAP_BUILD) { if $(HAIKU_BOOTSTRAP_BUILD) {
defines += HAIKU_BOOTSTRAP_BUILD ; defines += HAIKU_BOOTSTRAP_BUILD ;
target = $(target)-bootstrap ; target = $(target)-bootstrap ;
@ -58,13 +57,15 @@ rule PreprocessPackageInfo source : directory : architecture
+= %HAIKU_SECONDARY_PACKAGING_ARCH_SUFFIX%, ; += %HAIKU_SECONDARY_PACKAGING_ARCH_SUFFIX%, ;
} }
local revisionFile = [ DetermineHaikuRevision ] ;
MakeLocate $(target) : $(directory) ; MakeLocate $(target) : $(directory) ;
Depends $(target) : $(source) ; Depends $(target) : $(source) $(revisionFile) ;
CCDEFS on $(target) = [ FDefines $(defines) ] ; CCDEFS on $(target) = [ FDefines $(defines) ] ;
HAIKU_SED_REPLACEMENTS on $(target) = "-e s,$(sedReplacements),g" ; HAIKU_SED_REPLACEMENTS on $(target) = "-e s,$(sedReplacements),g" ;
PreprocessPackageInfo1 $(target) : $(source) ; PreprocessPackageInfo1 $(target) : $(source) $(revisionFile) ;
return $(target) ; return $(target) ;
} }
@ -72,7 +73,10 @@ rule PreprocessPackageInfo source : directory : architecture
actions PreprocessPackageInfo1 actions PreprocessPackageInfo1
{ {
sed $(HAIKU_SED_REPLACEMENTS) < $(2) | $(HOST_CC) -E -w $(CCDEFS) - -o $(1) revision=`sed -n 's,^\(hrev[0-9]*\).*,\1,p' $(2[2])`
sed $(HAIKU_SED_REPLACEMENTS) \
-e s,%HAIKU_VERSION%,$(HAIKU_VERSION)_${revision:-0}-1, < $(2[1]) \
| $(HOST_CC) -E -w $(CCDEFS) - -o $(1)
} }