From cc229bf9e42862a7253e66dc0b8ca9a642ed9743 Mon Sep 17 00:00:00 2001 From: Stefan Fiedler Date: Fri, 2 Nov 2007 13:29:10 +0000 Subject: [PATCH] Stefan Fiedler: scripts/Build-Pkg: don't use ROCK dir if building into real root [2007110208244338690] (https://www.rocklinux.net/submaster) git-svn-id: http://www.rocklinux.org/svn/rock-linux/trunk@8784 c5f82cb5-29bc-0310-9cd0-bff59a50e3bc --- scripts/Build-Pkg | 56 ++++++++++++++++++++++++----------------------- 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/scripts/Build-Pkg b/scripts/Build-Pkg index 62528fa11..a7b533d8f 100755 --- a/scripts/Build-Pkg +++ b/scripts/Build-Pkg @@ -193,35 +193,37 @@ export ROCK_XPKG=$xpkg # Set permissions and ownership of $buildir; $base/build might have different ones. mkdir -p "$builddir"; chmod 700 "$builddir" ; chown 0:0 "$builddir" -pushd "$xroot/" >/dev/null || exit 1 - -realconf=$(cd $base/config; pwd -P) -realdown=$(cd $base/download; pwd -P) -realbase=$(dirname $(cd $base/scripts; pwd -P)) - -if [ ! -e ROCK/loop/scripts ]; then - mkdir -p ROCK/{loop,config,download} - mount --bind $realbase $PWD/ROCK/loop - mount --bind $realconf $PWD/ROCK/config - mount --bind $realdown $PWD/ROCK/download -fi - -for x in Documentation architecture misc package scripts target; do - if [ ! -e ROCK/$x ]; then ln -s "loop/$x" "ROCK/$x"; fi -done - -if [ ! -e "ROCK/build/$ROCKCFG_ID" ]; then - mkdir -p "ROCK/build" - ln -snf ../.. "ROCK/build/$ROCKCFG_ID" +if [ "$xroot" ] ; then + pushd "$xroot/" >/dev/null || exit 1 + + realconf=$(cd $base/config; pwd -P) + realdown=$(cd $base/download; pwd -P) + realbase=$(dirname $(cd $base/scripts; pwd -P)) + + if [ ! -e ROCK/loop/scripts ]; then + mkdir -p ROCK/{loop,config,download} + mount --bind $realbase $PWD/ROCK/loop + mount --bind $realconf $PWD/ROCK/config + mount --bind $realdown $PWD/ROCK/download + fi + + for x in Documentation architecture misc package scripts target; do + if [ ! -e ROCK/$x ]; then ln -s "loop/$x" "ROCK/$x"; fi + done + + if [ ! -e "ROCK/build/$ROCKCFG_ID" ]; then + mkdir -p "ROCK/build" + ln -snf ../.. "ROCK/build/$ROCKCFG_ID" + fi + + # If build is a symlink to somewhere else (NFS share for clusterbuild + # usually) we do _not_ want to extract our stuff there. + # Network latency! + ln -sf loop/src.$xpkg.$id ROCK/src.$xpkg.$id + + popd >/dev/null fi -# If build is a symlink to somewhere else (NFS share for clusterbuild -# usually) we do _not_ want to extract our stuff there. -# Network latency! -ln -sf loop/src.$xpkg.$id ROCK/src.$xpkg.$id - -popd >/dev/null - if [ "$chroot" = 1 ] ; then cd "$xroot" || exit 1