WebHosting Paid by #1Payday.Loans


   The ROCK Linux project has been discontinued in 2010. Here are the old data for the historical record!

?mode=patch&uid=2006091315185411038
Discarded Patch: 2006091315185411038 (by blindcoder)
+ blindcoder
Votecheck 'core-strong': Missing 1 qualified vote(s) (clifford, fake, teha)
scripts/Build-Pkg
Benjamin Schieder:
        fix some tmpfs related problems in Build-Pkg

by blindcoder
depends on [2006091100524749360]
Benjamin Schieder:
        fix some tmpfs related problems in Build-Pkg
--- scripts/Build-Pkg   (Revision 27)
+++ scripts/Build-Pkg   (Arbeitskopie)
@@ -187,6 +187,8 @@
 export ROCK_PKG=$pkg
 export ROCK_XPKG=$xpkg
 
+mkdir -p "$builddir"; chmod 700 "$builddir"
+
 if [ "$chroot" = 1 ] ; then
 
        cd "$xroot" || exit 1
@@ -296,7 +298,6 @@
        # If build is a symlink to somewhere else (NFS share for clusterbuild
        # usually) we do _not_ want to extract our stuff there.
        # Network latency!
-       mkdir -p "$builddir"; chmod 700 "$builddir"
        ln -s loop/src.$xpkg.$id ROCK/src.$xpkg.$id
 
        cat > "$builddir/chroot.sh" <<- EOT
@@ -335,11 +336,23 @@
        returncode=$?
 
        # Only remove $builddir if it is empty.
-       rmdir --ignore-fail-on-non-empty "$builddir"
+       if [ `find "$builddir" | grep -c .` -lt 1 ] ; then
+               if [ "$ROCKCFG_SRC_TMPFS" = 1 ]; then
+                       umount "$builddir"
+               fi
+               rmdir --ignore-fail-on-non-empty "$builddir"
+       fi
 
        exit $returncode
 fi
 
+# This must happen _before_ the FLWRAPPER starts or we get into trouble
+if [ $clear_src = 1 ] ; then
+       if [ "$ROCKCFG_SRC_TMPFS" = 1 ]; then
+               mount | grep -q "$builddir" || mount -t tmpfs -o $ROCKCFG_SRC_TMPFS_OPT tmpfs "$builddir"
+       fi
+fi
+
 if [ "$ROCKCFG_FLIST" = "flwrapper" -a -z "$FLWRAPPER" ] ; then
        export FLWRAPPER_WLOG="$builddir/fl_wrapper.wlog"
        export FLWRAPPER_RLOG="$builddir/fl_wrapper.rlog"
@@ -676,12 +689,6 @@
 
 echo_status "Preparing build in src.$xpkg.$id"
 
-if [ $clear_src = 1 ] ; then
-       if [ "$ROCKCFG_SRC_TMPFS" = 1 ]; then
-               mount -t tmpfs -o $ROCKCFG_SRC_TMPFS_OPT tmpfs "$builddir"
-       fi
-fi
-
 if [ "$xroot" != "$root" ] ; then
        for x in $flistroot ; do
                [ -d $xroot/$x ] || mkdir -p $xroot/$x
@@ -1244,9 +1251,16 @@
        rm -f $base/build/$ROCKCFG_ID/pseudonative_handler
 fi
 
+if [ "$ROCKCFG_FLIST" = "flwrapper" ] ; then
+       unset LD_PRELOAD
+fi
 if [ -f $root/var/adm/logs/$stagelevel-$xpkg.log ] ; then
        if [ $clear_src = 1 ] ; then
-               rm -rf "$builddir"/* "$builddir"
+               rm -rf "$builddir"/*
+               if [ "$ROCKCFG_SRC_TMPFS" = 1 ]; then
+                       umount "$builddir"
+               fi
+               rmdir "$builddir"
        else
                cp $root/var/adm/logs/$stagelevel-$xpkg.out "$builddir/BUILD-LOG"
        fi
@@ -1258,7 +1272,11 @@
        exit 0
 else
        if [ $clear_src = 1 -a "$ROCKCFG_ALWAYS_CLEAN" = 1 ] ; then
-               rm -rf "$builddir"/* "$builddir"
+               rm -rf "$builddir"/*
+               if [ "$ROCKCFG_SRC_TMPFS" = 1 ]; then
+                       umount "$builddir"
+               fi
+               rmdir "$builddir"
        else
                cp $root/var/adm/logs/$stagelevel-$xpkg.out "$builddir/ERROR-LOG"
        fi

[Download this patch]