Copying source directories to the image was broken, when building from

the root of the source tree. Added a work-around that should fix the
problem.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23544 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2008-01-15 21:21:02 +00:00
parent 21210ba894
commit 498c6565c6
1 changed files with 13 additions and 3 deletions

View File

@ -184,19 +184,29 @@ if [ -n "${sourceDirsToCopy}" ]; then
$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@^${sourceDir}@${sourcesDest}@")
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@^${sourceDir}@${sourcesDest}@")
sed -e "s@^${sourcePathPrefix}@${destPathPrefix}@")
$cp ${sPrefix}$sourceFile $destSourceFile
done
done