From: Brian J. Murrell Date: Fri, 8 Jan 2010 16:38:20 +0000 (-0500) Subject: b=21586 More stderr/stdout redirections X-Git-Tag: v1_8_1_60~2 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=6d381b200265879806a321f4046877fd3aba89cf;p=fs%2Flustre-release.git b=21586 More stderr/stdout redirections 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 --- diff --git a/build/lbuild b/build/lbuild index e2e1b6c..227d737 100755 --- a/build/lbuild +++ b/build/lbuild @@ -991,7 +991,8 @@ find_linux_rpm() { 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 @@ -1294,7 +1295,7 @@ find_rpm() { 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 @@ -1441,7 +1442,7 @@ build_mptlinux() { --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 @@ -1449,7 +1450,7 @@ build_mptlinux() { --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 @@ -1497,7 +1498,7 @@ build_rdac() { --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 @@ -1505,7 +1506,7 @@ build_rdac() { --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 diff --git a/build/lbuild-sles b/build/lbuild-sles index 83fae95..94af57a 100644 --- a/build/lbuild-sles +++ b/build/lbuild-sles @@ -45,7 +45,7 @@ prepare_and_build_srpm() { # 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 @@ -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" \ - $TOPDIR/SOURCES/kernel-source.spec >&2; then + $TOPDIR/SOURCES/kernel-source.spec 2>&1; then 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}" - RC=255 + return 255 fi } diff --git a/build/lbuild.old_school b/build/lbuild.old_school index 1af9190..088219b 100644 --- a/build/lbuild.old_school +++ b/build/lbuild.old_school @@ -34,7 +34,7 @@ build_tarball() { 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 @@ -184,13 +184,13 @@ build_kernel() { $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" \ - --define "_topdir $TOPDIR" || \ + --define "_topdir $TOPDIR" 2>&1 || \ fatal 1 "Error building .src.rpm." fi