* Added new rule CopyDirectoryToHaikuImage which recursively copies a

directory to the image. It supports exclude patterns.
* Changed Add{Source,Header}DirectoryToHaikuImage to use the
  CopyDirectoryToHaikuImage rule. The special handling in the
  build_haiku_image script is gone now.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24586 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2008-03-26 04:14:25 +00:00
parent baba54f94f
commit 88c4c6627b
5 changed files with 76 additions and 92 deletions
-78
View File
@@ -9,8 +9,6 @@
# imagePath
# imageSize
# addBuildCompatibilityLibDir
# sourceDirsToCopy
# headerDirsToCopy
# updateOnly
# dontClearImage
# isVMwareImage
@@ -183,82 +181,6 @@ if [ ! $updateOnly ]; then
fi # ! updateOnly
# install sources
sourcesDest=${tPrefix}home/HaikuSources
# create sources directory
if [ -n "${sourceDirsToCopy}" ]; then
echo "Installing Haiku Sources ..."
$mkdir -p ${sourcesDest}
fi
# When building in the root of the source directory, sourceDir is "." and
# the source directory are not prefixed, which breaks the sed expressions
# used below. We work around, by adjusting the strings to match and insert.
sourcePathPrefix=$sourceDir
destPathPrefix=$sourcesDest
if [ $sourcePathPrefix = "." ]; then
sourcePathPrefix=""
destPathPrefix="${sourcesDest}/"
fi
for sourcesDir in ${sourceDirsToCopy}; do
echo " sources dir: ${sourcesDir}"
# create all subdirectories
subDirs=$(find ${sourcesDir} -type d | grep -v '.svn' |
sed -e "s@^${sourcePathPrefix}@${destPathPrefix}@")
$mkdir -p ${subDirs}
# get all files and copy each one individually
sourceFiles=$(find $sourcesDir -type f | grep -v '.svn')
for sourceFile in $sourceFiles; do
destSourceFile=$(echo $sourceFile |
sed -e "s@^${sourcePathPrefix}@${destPathPrefix}@")
$cp ${sPrefix}$sourceFile $destSourceFile
done
done
# install headers
headersDest=${tPrefix}develop
# create headers directory
if [ -n "${headerDirsToCopy}" ]; then
echo "Installing Haiku Headers ..."
$mkdir -p ${headersDest}
fi
# See above (sourceDirs)
sourcePathPrefix=$sourceDir
destPathPrefix=$headersDest
if [ $sourcePathPrefix = "." ]; then
sourcePathPrefix=""
destPathPrefix="${headersDest}/"
fi
for headersDir in ${headerDirsToCopy}; do
echo " header dir: ${headersDir}"
# create all subdirectories
subDirs=$(find ${headersDir} -type d | grep -v '.svn' |
sed -e "s@^${sourcePathPrefix}@${destPathPrefix}@")
$mkdir -p ${subDirs}
# get all files and copy each one individually
headerFiles=$(find $headersDir -type f | grep -v '.svn')
for headerFile in $headerFiles; do
destHeaderFile=$(echo $headerFile |
sed -e "s@^${sourcePathPrefix}@${destPathPrefix}@")
$cp ${sPrefix}$headerFile $destHeaderFile
done
done
# unmount
if [ $isImage ]; then
echo "Unmounting ..."