Preserve resources and attributes when copying stripped binaries

When asked to strip binaries when copying to containers we now
strip to a temporary file, copy over resources to it, copy it
to the container, then copy the attributes from the original
source.

This should allow stripping binaries while preserving attributes
and resources even when copying to images.
This commit is contained in:
François Revol
2013-10-12 02:37:20 +02:00
parent e2332987bc
commit a427aa2f4a
2 changed files with 10 additions and 3 deletions
+9 -3
View File
@@ -800,11 +800,17 @@ actions AppendToContainerCopyFilesScriptStripFile
>> $(2[1]) >> $(2[1])
fi fi
echo \$cp "\"\${sPrefix}$(2[2])\"" \ echo "stripped_file=\"\${tmpDir}/stripped_\$\$\"" >> $(2[1])
echo \$strip -o "\"\${stripped_file}\"" "\"\${sPrefix}$(2[2])\"" >> $(2[1])
echo \$xres -o "\"\${stripped_file}\"" "\"\${sPrefix}$(2[2])\"" >> $(2[1])
echo \$cp "\"\${stripped_file}\"" \
"\"\${tPrefix}$(TARGET_DIR)/$(INSTALL_TARGET_NAME)\"" >> $(2[1])
echo \$copyattr "\"\${sPrefix}$(2[2])\"" \
"\"\${tPrefix}$(TARGET_DIR)/$(INSTALL_TARGET_NAME)\"" >> $(2[1]) "\"\${tPrefix}$(TARGET_DIR)/$(INSTALL_TARGET_NAME)\"" >> $(2[1])
echo \$strip "\"\${tPrefix}$(TARGET_DIR)/$(INSTALL_TARGET_NAME)\"" \ echo \$rm "\"\${stripped_file}\"" >> $(2[1])
"2>/dev/null" "|| true" >> $(2[1])
} }
+1
View File
@@ -184,6 +184,7 @@ AddVariableToScript $(script) : addBuildCompatibilityLibDir
: $(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR) ; : $(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR) ;
AddTargetVariableToScript $(script) : <build>copyattr ; AddTargetVariableToScript $(script) : <build>copyattr ;
AddTargetVariableToScript $(script) : $(HAIKU_STRIP_$(TARGET_ARCH)) : strip ; AddTargetVariableToScript $(script) : $(HAIKU_STRIP_$(TARGET_ARCH)) : strip ;
AddTargetVariableToScript $(script) : <build>xres ;
# create the other scripts # create the other scripts
local makeDirsScript = <FloppyBootArchive>haiku-floppyboot-make-dirs ; local makeDirsScript = <FloppyBootArchive>haiku-floppyboot-make-dirs ;