* When updating all targets, symlinks and directories are now also recreated.

* Removed superfluous white space.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26439 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2008-07-15 19:23:34 +00:00
parent 2cfee16a9e
commit c5134b4758
+28 -5
View File
@@ -138,6 +138,19 @@ rule FilterContainerUpdateTargets targets : filterVariable
return $(filteredTargets) ; 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 rule AddFilesToContainer container : directoryTokens : targets : destName
{ {
# AddFilesToContainer <container> : <directoryTokens> : <targets> # AddFilesToContainer <container> : <directoryTokens> : <targets>
@@ -149,7 +162,8 @@ rule AddFilesToContainer container : directoryTokens : targets : destName
# If the image shall only be updated, we filter out all targets not marked # If the image shall only be updated, we filter out all targets not marked
# accordingly. # accordingly.
if [ on $(container) return $(HAIKU_CONTAINER_UPDATE_ONLY) ] { if [ on $(container) return $(HAIKU_CONTAINER_UPDATE_ONLY) ]
&& ! [ IncludeAllTargetsInContainer $(container) ] {
local filterVar local filterVar
= [ on $(container) return $(HAIKU_INCLUDE_IN_CONTAINER_VAR) ] ; = [ on $(container) return $(HAIKU_INCLUDE_IN_CONTAINER_VAR) ] ;
if $(filterVar) { if $(filterVar) {
@@ -198,7 +212,8 @@ rule AddSymlinkToContainer container : directoryTokens : linkTarget : linkName
# #
# If the image shall only be updated, we don't add any symlinks. # 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 ; return ;
} }
@@ -238,6 +253,7 @@ rule CopyDirectoryToContainer container : directoryTokens : sourceDirectory
# If the image shall only be updated, we don't copy any directories # If the image shall only be updated, we don't copy any directories
if [ on $(container) return $(HAIKU_CONTAINER_UPDATE_ONLY) ] if [ on $(container) return $(HAIKU_CONTAINER_UPDATE_ONLY) ]
&& ! [ IncludeAllTargetsInContainer $(container) ]
&& ! $(alwaysUpdate) { && ! $(alwaysUpdate) {
return ; return ;
} }
@@ -279,7 +295,8 @@ rule AddDriversToContainer container : relativeDirectoryTokens : targets
: $(targets) ; : $(targets) ;
# If the image shall only be updated, we don't add any symlinks. # 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 ; return ;
} }
@@ -316,7 +333,8 @@ rule AddBootModuleSymlinksToContainer container : targets
# #
# If the image shall only be updated, we don't add any symlinks. # 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 ; return ;
} }
@@ -369,7 +387,8 @@ rule CreateContainerMakeDirectoriesScript container : script
# If the image shall only be updated, we don't create directories. # If the image shall only be updated, we don't create directories.
if $(dirsToCreate) if $(dirsToCreate)
&& ! [ on $(container) return $(HAIKU_CONTAINER_UPDATE_ONLY) ] { && ( ! [ on $(container) return $(HAIKU_CONTAINER_UPDATE_ONLY) ]
|| [ IncludeAllTargetsInContainer $(container) ] ) {
Depends $(scriptBody) : $(dirsToCreate) ; Depends $(scriptBody) : $(dirsToCreate) ;
CreateContainerMakeDirectoriesScript1 $(scriptBody) : $(dirsToCreate) ; CreateContainerMakeDirectoriesScript1 $(scriptBody) : $(dirsToCreate) ;
@@ -492,22 +511,26 @@ rule CreateContainerCopyFilesScript container : script
} }
} }
actions piecemeal AppendToContainerCopyFilesScript bind OUTPUT_SCRIPT actions piecemeal AppendToContainerCopyFilesScript bind OUTPUT_SCRIPT
{ {
echo \$cp "\"\${sPrefix}$(2)\"" "\"\${tPrefix}$(TARGET_DIR)\"" >> $(OUTPUT_SCRIPT) echo \$cp "\"\${sPrefix}$(2)\"" "\"\${tPrefix}$(TARGET_DIR)\"" >> $(OUTPUT_SCRIPT)
} }
actions AppendToContainerCopyFilesScriptSingleFile actions AppendToContainerCopyFilesScriptSingleFile
{ {
echo \$cp "\"\${sPrefix}$(2[2])\"" \ echo \$cp "\"\${sPrefix}$(2[2])\"" \
"\"\${tPrefix}$(TARGET_DIR)/$(INSTALL_TARGET_NAME)\"" >> $(2[1]) "\"\${tPrefix}$(TARGET_DIR)/$(INSTALL_TARGET_NAME)\"" >> $(2[1])
} }
actions AddSymlinkToContainerCopyFilesScript actions AddSymlinkToContainerCopyFilesScript
{ {
echo \$ln -sfn "\"$(SYMLINK_TARGET)\"" "\"\${tPrefix}$(1:G=)\"" >> $(2[1]) echo \$ln -sfn "\"$(SYMLINK_TARGET)\"" "\"\${tPrefix}$(1:G=)\"" >> $(2[1])
} }
actions AddDirectoryToContainerCopyFilesScript actions AddDirectoryToContainerCopyFilesScript
{ {
echo \$cp -r $(EXCLUDE_PATTERNS) "\"\${sPrefix}$(SOURCE_DIRECTORY)/.\"" \ echo \$cp -r $(EXCLUDE_PATTERNS) "\"\${sPrefix}$(SOURCE_DIRECTORY)/.\"" \