Add DetermineEffectiveHaikuRevision rule
Simplifies PreprocessPackageInfo a bit.
This commit is contained in:
parent
d4bfbab374
commit
af559cd6ee
@ -377,6 +377,7 @@ rule DetermineHaikuRevision
|
|||||||
if ! [ on $(gitIndex) return $(HAIKU_GIT_REVISION_DETERMINED) ] {
|
if ! [ on $(gitIndex) return $(HAIKU_GIT_REVISION_DETERMINED) ] {
|
||||||
HAIKU_GIT_REVISION_DETERMINED on $(gitIndex) = 1 ;
|
HAIKU_GIT_REVISION_DETERMINED on $(gitIndex) = 1 ;
|
||||||
MakeLocate $(revisionFile) : $(HAIKU_BUILD_OUTPUT_DIR) ;
|
MakeLocate $(revisionFile) : $(HAIKU_BUILD_OUTPUT_DIR) ;
|
||||||
|
LocalClean clean : $(revisionFile) ;
|
||||||
if $(HAIKU_REVISION) {
|
if $(HAIKU_REVISION) {
|
||||||
DetermineHaikuRevision2 $(revisionFile) ;
|
DetermineHaikuRevision2 $(revisionFile) ;
|
||||||
} else if [ Glob [ FDirName $(HAIKU_TOP) .git ] : index ] {
|
} else if [ Glob [ FDirName $(HAIKU_TOP) .git ] : index ] {
|
||||||
@ -404,6 +405,29 @@ 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)"`
|
||||||
|
echo "${revision:-0}" > "$(1)"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
rule DataFileToSourceFile sourceFile : dataFile : dataVariable : sizeVariable
|
rule DataFileToSourceFile sourceFile : dataFile : dataVariable : sizeVariable
|
||||||
{
|
{
|
||||||
sourceFile = [ FGristFiles $(sourceFile) ] ;
|
sourceFile = [ FGristFiles $(sourceFile) ] ;
|
||||||
|
@ -67,7 +67,7 @@ rule PreprocessPackageInfo source : directory : architecture
|
|||||||
+= %HAIKU_SECONDARY_PACKAGING_ARCH_SUFFIX%, ;
|
+= %HAIKU_SECONDARY_PACKAGING_ARCH_SUFFIX%, ;
|
||||||
}
|
}
|
||||||
|
|
||||||
local revisionFile = [ DetermineHaikuRevision ] ;
|
local revisionFile = [ DetermineEffectiveHaikuRevision ] ;
|
||||||
local updateRequiresFiles ;
|
local updateRequiresFiles ;
|
||||||
local haikuPortsRepositoryFile ;
|
local haikuPortsRepositoryFile ;
|
||||||
if ! $(HAIKU_BOOTSTRAP_BUILD) {
|
if ! $(HAIKU_BOOTSTRAP_BUILD) {
|
||||||
@ -92,9 +92,9 @@ rule PreprocessPackageInfo source : directory : architecture
|
|||||||
|
|
||||||
actions PreprocessPackageInfo1
|
actions PreprocessPackageInfo1
|
||||||
{
|
{
|
||||||
revision=`sed -n 's,^\(hrev[0-9]*\).*,\1,p' $(2[2])`
|
revision=`cat $(2[2])`
|
||||||
sed $(HAIKU_SED_REPLACEMENTS) \
|
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)
|
| $(HOST_CC) -E -w $(CCDEFS) - -o $(1)
|
||||||
|
|
||||||
if [ -n "$(2[4]:E)" ]; then
|
if [ -n "$(2[4]:E)" ]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user