Whamcloud - gitweb
smash the HEAD with the contents of b_cmd. HEAD_PRE_CMD_SMASH and
[fs/lustre-release.git] / lustre / scripts / lbuild
index 3664e02..2c76308 100755 (executable)
@@ -29,8 +29,6 @@ UP_ARCHS=
 
 DATE=$(date)
 
-RPMBUILD=
-
 cleanup()
 {
     true
@@ -149,14 +147,6 @@ check_options()
 #    TARGET_FILE="$TOPDIR/kernel_patches/targets/$TARGET.target"
 #    [ -r "$TARGET_FILE" ] || \
 #      usage 1 "Target '$TARGET' was not found."
-
-    RPMBUILD=`which rpmbuild`
-    if [ $? -ne 0 -o ! "$RPMBUILD" -o "$RPMBUILD" == "" ]; then
-       RPMBUILD=`which rpm`
-       if [ $? -ne 0 -o ! "$RPMBUILD" -o "$RPMBUILD" == "" ]; then
-           usage 1 "Could not find binary for making rpms (tried rpmbuild and rpm)."
-       fi
-    fi
 }
 
 uniqify()
@@ -244,7 +234,7 @@ unpack_lustre()
        untar "$LUSTRE"
        [ -d lustre ] || ln -sf lustre* lustre
     else
-       cvs -d "$CVSROOT" -qz3 co -r "$TAG" -d "$DIRNAME" lustre || \
+       cvs -d "$CVSROOT" -qz3 co -D "$DATE" "-r$TAG" -d "$DIRNAME" lustre || \
            fatal 1 "There was an error checking out Lustre from CVS."
        echo "Creating lustre tarball..."
        tar zcf "$DIRNAME.tar.gz" "$DIRNAME" \
@@ -280,7 +270,6 @@ patch_linux()
     popd >/dev/null
     echo "Full patch has been saved in ${FULL_PATCH##*/}."
     echo "Replacing .config files..."
-    [ -d linux/configs ] || mkdir linux/configs
     rm -f linux/configs/*
     cp -v lustre/kernel_patches/kernel_configs/kernel-${VERSION}-${TARGET}*.config linux/configs/
 }
@@ -312,7 +301,7 @@ prep_build()
        -e "s/@KERNEL_SOURCE@/$KERNEL/g" \
        -e "s/@LUSTRE_SOURCE@/${LUSTRE##*/}/g" \
        -e "s/@LUSTRE_TARGET@/$TARGET/g" \
-       -e "s#@CONFIGURE_FLAGS@#$CONFIGURE_FLAGS#g" \
+       -e "s/@CONFIGURE_FLAGS@/$CONFIGURE_FLAGS/g" \
        -e "s/@BASE_ARCHS@/$BASE_ARCHS/g" \
        -e "s/@BIGMEM_ARCHS@/$BIGMEM_ARCHS/g" \
        -e "s/@BOOT_ARCHS@/$BOOT_ARCHS/g" \
@@ -348,11 +337,11 @@ build()
        targets="--target $arch $targets"
     done
 
-    $RPMBUILD $targets -bb lustre-kernel-2.4.spec \
+    rpmbuild $targets -bb lustre-kernel-2.4.spec \
        --define "_topdir $TOPDIR" || \
        fatal 1 "Error building rpms for $arch."
 
-    (( $DO_SRC )) && $RPMBUILD -bs lustre-kernel-2.4.spec \
+    (( $DO_SRC )) && rpmbuild -bs lustre-kernel-2.4.spec \
        --define "_topdir $TOPDIR" || \
        fatal 1 "Error building .src.rpm."
 }