Whamcloud - gitweb
b=21586 More stderr/stdout redirections
authorBrian J. Murrell <brian@sun.com>
Fri, 8 Jan 2010 16:25:44 +0000 (11:25 -0500)
committerRobert Read <rread@sun.com>
Tue, 12 Jan 2010 17:31:30 +0000 (09:31 -0800)
Just a few more redirections to get some commands' output into the
appropriate log files.

We should actually return the 255, not just assign it to a unused variable.

i=yangsheng
i=wangyb

build/lbuild
build/lbuild-sles
build/lbuild.old_school

index 3478342..99513c5 100755 (executable)
@@ -986,7 +986,8 @@ find_linux_rpm() {
     for arch in $TARGET_ARCHS_ALL; do
         local found_rpm="" rpm
         for rpm in ${pathtorpms}/${arch}/*.rpm; do
     for arch in $TARGET_ARCHS_ALL; do
         local found_rpm="" rpm
         for rpm in ${pathtorpms}/${arch}/*.rpm; do
-            if rpm -q --provides -p "$rpm" | grep -q "kernel${prefix} = $wanted_kernel"; then
+            if rpm -q --provides -p "$rpm" 2>&3 | grep -q "kernel${prefix} = $wanted_kernel" 2>&3; then
+
                 found_rpm="$rpm"
                 ret=0
                 break
                 found_rpm="$rpm"
                 ret=0
                 break
@@ -1285,7 +1286,7 @@ find_rpm() {
         case "$match_type" in
             provides)
                 # match is any valid ERE (i.e. given to egrep) match
         case "$match_type" in
             provides)
                 # match is any valid ERE (i.e. given to egrep) match
-                if rpm -q --provides -p "$file" | egrep -q "$match"; then
+                if rpm -q --provides -p "$file" 2>&3 | egrep -q "$match"; then
                     echo "$file"
                     popd >/dev/null
                     return 0
                     echo "$file"
                     popd >/dev/null
                     return 0
@@ -1432,7 +1433,7 @@ build_mptlinux() {
                   --define "_tmppath /var/tmp" \
                   --define "_topdir ${TOPDIR}" \
                   --define "kernel_obj $linux" \
                   --define "_tmppath /var/tmp" \
                   --define "_topdir ${TOPDIR}" \
                   --define "kernel_obj $linux" \
-                  ${TOPDIR}/SPECS/mptlinux.spec; then
+                  ${TOPDIR}/SPECS/mptlinux.spec 2>&1; then
         return 1
     fi
     if $DO_SRC; then
         return 1
     fi
     if $DO_SRC; then
@@ -1440,7 +1441,7 @@ build_mptlinux() {
                       --define "_tmppath /var/tmp" \
                       --define "_topdir ${TOPDIR}" \
                       --define "kernel_obj $linux" \
                       --define "_tmppath /var/tmp" \
                       --define "_topdir ${TOPDIR}" \
                       --define "kernel_obj $linux" \
-                      ${TOPDIR}/SPECS/mptlinux.spec; then
+                      ${TOPDIR}/SPECS/mptlinux.spec 2>&1; then
             return 1
         fi
     fi
             return 1
         fi
     fi
@@ -1488,7 +1489,7 @@ build_rdac() {
                   --define "_tmppath /var/tmp" \
                   --define "_topdir ${TOPDIR}" \
                   --define "kernel_obj $linux" \
                   --define "_tmppath /var/tmp" \
                   --define "_topdir ${TOPDIR}" \
                   --define "kernel_obj $linux" \
-                  ${TOPDIR}/SPECS/rdac.spec; then
+                  ${TOPDIR}/SPECS/rdac.spec 2>&1; then
         return 1
     fi
     if $DO_SRC; then
         return 1
     fi
     if $DO_SRC; then
@@ -1496,7 +1497,7 @@ build_rdac() {
                       --define "_tmppath /var/tmp" \
                       --define "_topdir ${TOPDIR}" \
                       --define "kernel_obj $linux" \
                       --define "_tmppath /var/tmp" \
                       --define "_topdir ${TOPDIR}" \
                       --define "kernel_obj $linux" \
-                      ${TOPDIR}/SPECS/rdac.spec; then
+                      ${TOPDIR}/SPECS/rdac.spec 2>&1; then
             return 1
         fi
     fi
             return 1
         fi
     fi
index 83fae95..94af57a 100644 (file)
@@ -45,7 +45,7 @@ prepare_and_build_srpm() {
     # now build it
     if ! $RPMBUILD $rpmbuildopt $targets \
                    --define "_topdir $TOPDIR" \
     # now build it
     if ! $RPMBUILD $rpmbuildopt $targets \
                    --define "_topdir $TOPDIR" \
-                   $TOPDIR/SOURCES/kernel-$RPMSMPTYPE.spec >&2; then
+                   $TOPDIR/SOURCES/kernel-$RPMSMPTYPE.spec 2>&1; then
         fatal 1 "Failed to build kernel RPM"
     fi
 #fi
         fatal 1 "Failed to build kernel RPM"
     fi
 #fi
@@ -53,7 +53,7 @@ prepare_and_build_srpm() {
     # for SLES, we also need to build the kernel-source rpm
     if ! $RPMBUILD $rpmbuildopt $targets \
                    --define "_topdir $TOPDIR" \
     # for SLES, we also need to build the kernel-source rpm
     if ! $RPMBUILD $rpmbuildopt $targets \
                    --define "_topdir $TOPDIR" \
-                   $TOPDIR/SOURCES/kernel-source.spec >&2; then
+                   $TOPDIR/SOURCES/kernel-source.spec 2>&1; then
         fatal 1 "Failed to build kernel source RPM"
     fi
 
         fatal 1 "Failed to build kernel source RPM"
     fi
 
@@ -100,7 +100,7 @@ find_linux_devel_paths() {
     LINUXRELEASE=$(find_linux_release ${LINUXOBJ:-$LINUX})
     if [ -z "$LINUXRELEASE" ]; then
         echo "Failed to find linux release in ${LINUXOBJ:-$LINUX}"
     LINUXRELEASE=$(find_linux_release ${LINUXOBJ:-$LINUX})
     if [ -z "$LINUXRELEASE" ]; then
         echo "Failed to find linux release in ${LINUXOBJ:-$LINUX}"
-        RC=255
+        return 255
     fi
 }
 
     fi
 }
 
index 6a0708b..362da9f 100644 (file)
@@ -25,7 +25,7 @@ build_tarball() {
         mkdir $RPMTOPDIR/BUILD/
         rpm -ivh $KERNELDIR/$SRPM --define "_topdir $RPMTOPDIR" || \
             { rm -rf $RPMTOPDIR; fatal 1 "Error installing kernel SRPM."; }
         mkdir $RPMTOPDIR/BUILD/
         rpm -ivh $KERNELDIR/$SRPM --define "_topdir $RPMTOPDIR" || \
             { rm -rf $RPMTOPDIR; fatal 1 "Error installing kernel SRPM."; }
-        $RPMBUILD -bp --nodeps --target i686 $RPMTOPDIR/SPECS/$SPEC --define "_topdir $RPMTOPDIR"
+        $RPMBUILD -bp --nodeps --target i686 $RPMTOPDIR/SPECS/$SPEC --define "_topdir $RPMTOPDIR" 2>&1
         pushd $RPMTOPDIR/BUILD/kernel-${lnxmaj}/linux-${lnxmaj} && {
             make mrproper
             cp configs/kernel-${lnxmaj}-i686-smp.config .config
         pushd $RPMTOPDIR/BUILD/kernel-${lnxmaj}/linux-${lnxmaj} && {
             make mrproper
             cp configs/kernel-${lnxmaj}-i686-smp.config .config
@@ -175,13 +175,13 @@ build_kernel() {
 
     $RPMBUILD $targets $rpmbuildopt lustre-kernel-2.4.spec \
         --define "_tmppath $TMPDIR" \
 
     $RPMBUILD $targets $rpmbuildopt lustre-kernel-2.4.spec \
         --define "_tmppath $TMPDIR" \
-        --define "_topdir $TOPDIR" || \
+        --define "_topdir $TOPDIR" 2>&1 || \
         fatal 1 "Error building rpms for $BUILD_ARCHS."
 
     if $DO_SRC; then
         $RPMBUILD -bs lustre-kernel-2.4.spec \
             --define "_tmppath $TMPDIR" \
         fatal 1 "Error building rpms for $BUILD_ARCHS."
 
     if $DO_SRC; then
         $RPMBUILD -bs lustre-kernel-2.4.spec \
             --define "_tmppath $TMPDIR" \
-            --define "_topdir $TOPDIR" || \
+            --define "_topdir $TOPDIR" 2>&1 || \
             fatal 1 "Error building .src.rpm."
     fi
 
             fatal 1 "Error building .src.rpm."
     fi