Whamcloud - gitweb
Try to avoid a race where two rpmbuilds on the same node are trying to stage
authorbrian <brian>
Sun, 27 Aug 2006 14:12:24 +0000 (14:12 +0000)
committerbrian <brian>
Sun, 27 Aug 2006 14:12:24 +0000 (14:12 +0000)
the same rpm -- which ends up happening in the same directory. In order for
this race avoidance to work, the caller has to supply a unique TMPDIR which
rpmbuild will use at it's _tmpdir. Default to /var/tmp if not supplied.

build/lbuild
build/lmake

index 09266e2..cfdc8a0 100755 (executable)
@@ -18,6 +18,7 @@ CONFIGURE_FLAGS=
 EXTERNAL_PATCHES=
 EXTRA_VERSION=
 STAGEDIR=
 EXTERNAL_PATCHES=
 EXTRA_VERSION=
 STAGEDIR=
+TMPDIR=${TMPDIR:-"/var/tmp"}
 
 # from target file
 KERNEL=
 
 # from target file
 KERNEL=
@@ -545,11 +546,13 @@ build_kernel()
     done
 
     $RPMBUILD $targets -bb lustre-kernel-2.4.spec \
     done
 
     $RPMBUILD $targets -bb lustre-kernel-2.4.spec \
+        --define "_tmpdir $TMPDIR" \
         --define "_topdir $TOPDIR" || \
         fatal 1 "Error building rpms for $BUILD_ARCHS."
 
     if (( $DO_SRC )) ; then
         $RPMBUILD -bs lustre-kernel-2.4.spec \
         --define "_topdir $TOPDIR" || \
         fatal 1 "Error building rpms for $BUILD_ARCHS."
 
     if (( $DO_SRC )) ; then
         $RPMBUILD -bs lustre-kernel-2.4.spec \
+            --define "_tmpdir $TMPDIR" \
             --define "_topdir $TOPDIR" || \
             fatal 1 "Error building .src.rpm."
     fi
             --define "_topdir $TOPDIR" || \
             fatal 1 "Error building .src.rpm."
     fi
@@ -575,6 +578,7 @@ build_lustre()
     ./configure "--with-linux=${LINUX}" ${CONFIGURE_FLAGS}
 
     $RPMBUILD $targets -bb build/lustre.spec \
     ./configure "--with-linux=${LINUX}" ${CONFIGURE_FLAGS}
 
     $RPMBUILD $targets -bb build/lustre.spec \
+        --define "_tmpdir $TMPDIR" \
         --define "_topdir $TOPDIR" || \
         fatal 1 "Error building rpms for $BUILD_ARCHS."
 
         --define "_topdir $TOPDIR" || \
         fatal 1 "Error building rpms for $BUILD_ARCHS."
 
index 0c195c0..4aa15d2 100755 (executable)
@@ -10,6 +10,7 @@ TARGET_ARCH=
 TARGET_CONFIG=
 JOBS=1
 CONFIGURE_FLAGS=
 TARGET_CONFIG=
 JOBS=1
 CONFIGURE_FLAGS=
+TMPDIR=${TMPDIR:-"/var/tmp"}
 
 # commands to run
 BUILD_LUSTRE=0
 
 # commands to run
 BUILD_LUSTRE=0
@@ -492,6 +493,7 @@ build_lustre()
        < build/lustre.spec.in \
        > build/lustre.spec
     $RPMBUILD --target ${TARGET_ARCH} -bb build/lustre.spec \
        < build/lustre.spec.in \
        > build/lustre.spec
     $RPMBUILD --target ${TARGET_ARCH} -bb build/lustre.spec \
+        --define "_tmpdir $TMPDIR" \
        --define "_topdir $(lbuild_topdir)" || \
        fatal 1 "Error building Lustre rpms."
     # $MAKE_J "$MAKE_CC" || fatal 1 "Error building Lustre."
        --define "_topdir $(lbuild_topdir)" || \
        fatal 1 "Error building Lustre rpms."
     # $MAKE_J "$MAKE_CC" || fatal 1 "Error building Lustre."