From 04d9b3e89cb79dbfc4102f32df4f663bbfdbe934 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Thu, 10 Oct 2013 21:37:27 +0200 Subject: [PATCH] CopySetHaikuRevision: Pull out rule DetermineHaikuRevision --- build/jam/FileRules | 44 ++++++++++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/build/jam/FileRules b/build/jam/FileRules index cdbb05ee5b..0bbe2174a3 100644 --- a/build/jam/FileRules +++ b/build/jam/FileRules @@ -339,25 +339,10 @@ rule CopySetHaikuRevision target : source # - Output file target. Gristed and located target. # - ELF object to be copied. Gristed and located target. - # If existing, make the target depend on the .git/index file in the - # root directory, so it gets updated when the revision changes due to - # commits or merges. - local gitIndex = index ; - local revisionFile = haiku-revision ; - if ! [ on $(gitIndex) return $(HAIKU_GIT_REVISION_DETERMINED) ] { - if [ Glob [ FDirName $(HAIKU_TOP) .git ] : index ] { - HAIKU_GIT_REVISION_DETERMINED on $(gitIndex) = 1 ; - SEARCH on $(gitIndex) = [ FDirName $(HAIKU_TOP) .git ] ; - MakeLocate $(revisionFile) : $(HAIKU_BUILD_OUTPUT_DIR) ; - Depends $(revisionFile) : $(gitIndex) ; - DetermineHaikuRevision $(revisionFile) : $(gitIndex) ; - } else { - revisionFile = ; - } - } - PropagateContainerUpdateTargetFlags $(target) : $(source) ; + local revisionFile = [ DetermineHaikuRevision ] ; + Depends $(target) : copyattr set_haiku_revision $(source) $(revisionFile) ; CopySetHaikuRevision1 $(target) @@ -379,7 +364,30 @@ actions CopySetHaikuRevision1 } -actions DetermineHaikuRevision +rule DetermineHaikuRevision +{ + # If existing, make the target depend on the .git/index file in the + # root directory, so it gets updated when the revision changes due to + # commits or merges. + local gitIndex = index ; + local revisionFile = haiku-revision ; + if ! [ on $(gitIndex) return $(HAIKU_GIT_REVISION_DETERMINED) ] { + if [ Glob [ FDirName $(HAIKU_TOP) .git ] : index ] { + HAIKU_GIT_REVISION_DETERMINED on $(gitIndex) = 1 ; + SEARCH on $(gitIndex) = [ FDirName $(HAIKU_TOP) .git ] ; + MakeLocate $(revisionFile) : $(HAIKU_BUILD_OUTPUT_DIR) ; + Depends $(revisionFile) : $(gitIndex) ; + DetermineHaikuRevision1 $(revisionFile) : $(gitIndex) ; + } else { + revisionFile = ; + } + } + + return $(revisionFile) ; +} + + +actions DetermineHaikuRevision1 { $(HAIKU_TOP)/build/scripts/determine_haiku_revision $(HAIKU_TOP) $(1) }