[Haiku-commits] r26439 - haiku/trunk/build/jam

axeld at BerliOS axeld at mail.berlios.de
Tue Jul 15 21:23:35 CEST 2008


Author: axeld
Date: 2008-07-15 21:23:34 +0200 (Tue, 15 Jul 2008)
New Revision: 26439
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=26439&view=rev

Modified:
   haiku/trunk/build/jam/ImageRules
Log:
* When updating all targets, symlinks and directories are now also recreated.
* Removed superfluous white space.


Modified: haiku/trunk/build/jam/ImageRules
===================================================================
--- haiku/trunk/build/jam/ImageRules	2008-07-15 18:26:40 UTC (rev 26438)
+++ haiku/trunk/build/jam/ImageRules	2008-07-15 19:23:34 UTC (rev 26439)
@@ -11,7 +11,7 @@
 	} else {
 		grist = $(gristToPrepend) ;
 	}
-	
+
 	return $(target:G=$(grist)) ;
 }
 
@@ -110,7 +110,7 @@
 		__is_on_image on $(directory) = true ;
 		DIRECTORY_TOKENS on $(directory) = $(directoryTokens) ;
 		NotFile $(directory) ;
-	
+
 		# mark the parent dir as not to be created
 		local parent = [ FReverse $(directoryTokens) ] ;
 		parent = [ FReverse $(parent[2-]) ] ;
@@ -138,6 +138,19 @@
 	return $(filteredTargets) ;
 }
 
+
+rule IncludeAllTargetsInContainer container
+{
+	local filterVar
+		= [ on $(container) return $(HAIKU_INCLUDE_IN_CONTAINER_VAR) ] ;
+	if $(filterVar) {
+		return $($(filterVar)) ;
+	}
+
+	return ;
+}
+
+
 rule AddFilesToContainer container : directoryTokens : targets : destName
 {
 	# AddFilesToContainer <container> : <directoryTokens> : <targets>
@@ -149,7 +162,8 @@
 
 	# If the image shall only be updated, we filter out all targets not marked
 	# accordingly.
-	if [ on $(container) return $(HAIKU_CONTAINER_UPDATE_ONLY) ] {
+	if [ on $(container) return $(HAIKU_CONTAINER_UPDATE_ONLY) ]
+		&& ! [ IncludeAllTargetsInContainer $(container) ] {
 		local filterVar
 			= [ on $(container) return $(HAIKU_INCLUDE_IN_CONTAINER_VAR) ] ;
 		if $(filterVar) {
@@ -198,7 +212,8 @@
 	#
 
 	# If the image shall only be updated, we don't add any symlinks.
-	if [ on $(container) return $(HAIKU_CONTAINER_UPDATE_ONLY) ] {
+	if [ on $(container) return $(HAIKU_CONTAINER_UPDATE_ONLY) ]
+		&& ! [ IncludeAllTargetsInContainer $(container) ] {
 		return ;
 	}
 
@@ -238,6 +253,7 @@
 
 	# If the image shall only be updated, we don't copy any directories
 	if [ on $(container) return $(HAIKU_CONTAINER_UPDATE_ONLY) ]
+			&& ! [ IncludeAllTargetsInContainer $(container) ]
 			&& ! $(alwaysUpdate) {
 		return ;
 	}
@@ -279,7 +295,8 @@
 		: $(targets) ;
 
 	# If the image shall only be updated, we don't add any symlinks.
-	if [ on $(container) return $(HAIKU_CONTAINER_UPDATE_ONLY) ] {
+	if [ on $(container) return $(HAIKU_CONTAINER_UPDATE_ONLY) ]
+		&& ! [ IncludeAllTargetsInContainer $(container) ] {
 		return ;
 	}
 
@@ -316,7 +333,8 @@
 	#
 
 	# If the image shall only be updated, we don't add any symlinks.
-	if [ on $(container) return $(HAIKU_CONTAINER_UPDATE_ONLY) ] {
+	if [ on $(container) return $(HAIKU_CONTAINER_UPDATE_ONLY) ]
+		&& ! [ IncludeAllTargetsInContainer $(container) ] {
 		return ;
 	}
 
@@ -336,7 +354,7 @@
 		}
 
 		local name = $(target:BS) ;
-		local linkTarget = [ FDirName /boot $(installDir:G=) $(name) ] ; 
+		local linkTarget = [ FDirName /boot $(installDir:G=) $(name) ] ;
 
 		AddSymlinkToContainer $(container) : beos system add-ons kernel boot
 			: $(linkTarget) : $(name) ;
@@ -369,7 +387,8 @@
 
 	# If the image shall only be updated, we don't create directories.
 	if $(dirsToCreate)
-		&& ! [ on $(container) return $(HAIKU_CONTAINER_UPDATE_ONLY) ] {
+		&& ( ! [ on $(container) return $(HAIKU_CONTAINER_UPDATE_ONLY) ]
+			|| [ IncludeAllTargetsInContainer $(container) ] ) {
 		Depends $(scriptBody) : $(dirsToCreate) ;
 		CreateContainerMakeDirectoriesScript1 $(scriptBody) : $(dirsToCreate) ;
 
@@ -380,20 +399,20 @@
 			local resourceFiles = [ on $(dir) return $(ATTRIBUTE_FILES) ] ;
 			if $(resourceFiles) {
 				local dirTokens = [ on $(dir) return $(DIRECTORY_TOKENS) ] ;
-	
+
 				# translate resources file to file with attributes
 				local attributeFile = $(script)-attributes-$(dirTokens:J=-) ;
 				ResAttr $(attributeFile) : $(resourceFiles) ;
-	
+
 				# use a unique dummy target for this file, on which we
 				# can define the TARGET_DIR variable
 				local dummyTarget = $(script)-attributes-dummy-$(dir:G=) ;
 				NotFile $(dummyTarget) ;
 				TARGET_DIR on $(dummyTarget) = $(dir:G=) ;
-	
+
 				Depends $(dummyTarget) : $(initScript) $(attributeFile) ;
 				Depends $(script) : $(dummyTarget) ;
-	
+
 				AppendToContainerMakeDirectoriesScriptAttributes $(dummyTarget)
 					: $(initScript) $(attributeFile) ;
 			}
@@ -442,7 +461,7 @@
 				NotFile $(dummyTarget) ;
 				TARGET_DIR on $(dummyTarget) = $(dir:G=) ;
 				INSTALL_TARGET_NAME on $(dummyTarget) = $(name) ;
-	
+
 				Depends $(dummyTarget) : $(initScript) $(target) ;
 				Depends $(script) : $(dummyTarget) ;
 
@@ -467,7 +486,7 @@
 			OUTPUT_SCRIPT on $(dummyTarget) = $(initScript) ;
 			AppendToContainerCopyFilesScript $(dummyTarget) : $(targets) ;
 		}
-	
+
 		local symlinks = [ on $(dir) return $(SYMLINKS_TO_INSTALL) ] ;
 		local symlink ;
 		for symlink in $(symlinks) {
@@ -492,22 +511,26 @@
 	}
 }
 
+
 actions piecemeal AppendToContainerCopyFilesScript bind OUTPUT_SCRIPT
 {
 	echo \$cp "\"\${sPrefix}$(2)\"" "\"\${tPrefix}$(TARGET_DIR)\"" >> $(OUTPUT_SCRIPT)
 }
 
+
 actions AppendToContainerCopyFilesScriptSingleFile
 {
 	echo \$cp "\"\${sPrefix}$(2[2])\"" \
 		"\"\${tPrefix}$(TARGET_DIR)/$(INSTALL_TARGET_NAME)\"" >> $(2[1])
 }
 
+
 actions AddSymlinkToContainerCopyFilesScript
 {
 	echo \$ln -sfn "\"$(SYMLINK_TARGET)\"" "\"\${tPrefix}$(1:G=)\"" >> $(2[1])
 }
 
+
 actions AddDirectoryToContainerCopyFilesScript
 {
 	echo \$cp -r $(EXCLUDE_PATTERNS) "\"\${sPrefix}$(SOURCE_DIRECTORY)/.\"" \
@@ -725,7 +748,7 @@
 
 actions BuildHaikuImageUserGroupFile
 {
-	echo "$(HAIKU_IMAGE_USER_GROUP_ENTRIES)" | tr '|' '\n' > $(1) 
+	echo "$(HAIKU_IMAGE_USER_GROUP_ENTRIES)" | tr '|' '\n' > $(1)
 }
 
 rule AddUserToHaikuImage user : uid : gid : home : shell : realName




More information about the Haiku-commits mailing list