From f169371de85767b70243608d474014c3b22d68c4 Mon Sep 17 00:00:00 2001
From: yangsheng <yangsheng>
Date: Thu, 15 May 2008 05:48:58 +0000
Subject: [PATCH] Branch b1_6 b=15655 i=brian, mjmac

Fixed the sles10 patchless rpm built against smp config for i686.
Fixed the new download site.
---
 build/lbuild | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/build/lbuild b/build/lbuild
index 4c7294faa7..372096c788 100755
--- a/build/lbuild
+++ b/build/lbuild
@@ -382,6 +382,10 @@ download_and_build_tarball() {
         -O "$KERNELDIR/$srpm" ; then
         fatal 1 "Could not download target $kernel_file's kernel SRPM $srpm from downloads.lustre.org."
     fi
+    [ -s "$KERNELDIR/$srpm" ] || {
+        rm -rf $KERNELDIR/$srpm
+        fatal 1 "Could not download target $kernel_file's kernel SRPM $srpm from downloads.lustre.org."
+    }
 
     build_tarball $target $srpm
 }
@@ -420,10 +424,15 @@ load_target()
                 build_tarball $CANONICAL_TARGET $KERNEL_SRPM
             else
                 if (( $DOWNLOAD )) ; then
-                    echo "Downloading http://downloads.lustre.org/public/kernels/$CANONICAL_TARGET/old/$KERNEL..."
-                    if ! wget -nv "http://downloads.lustre.org/public/kernels/$CANONICAL_TARGET/old/$KERNEL" -O "$KERNELDIR/$KERNEL" ; then
+                    echo "Downloading http://downloads.lustre.org/public/kernels/$DISTRO/old/$KERNEL..."
+                    if ! wget -nv "http://downloads.lustre.org/public/kernels/$DISTRO/old/$KERNEL" -O "$KERNELDIR/$KERNEL" ; then
                         # see if we can do it with an SRPM from the download site
                         download_and_build_tarball $CANONICAL_TARGET $KERNEL_FILE
+                    else
+                        [ -s "$KERNELDIR/$KERNEL" ] || {
+                            rm -rf "$KERNELDIR/$KERNEL"
+                            fatal 1 "Target $TARGET's kernel $KERNEL not found in directory $KERNELDIR."
+                        }
                     fi
                 else
                     fatal 1 "Target $TARGET's kernel file $KERNEL not found in kernel directory $KERNELDIR."
@@ -984,13 +993,14 @@ store_for_reuse()
 
 set_rpm_smp_type()
 {
+    local infact_arch=${TARGET_ARCH}
     RPMSMPTYPE=default
+    [ "$infact_arch" == "i586" ] && infact_arch="i686"
     for smp_type in $SMP_ARCHS; do
-        [ $TARGET_ARCH == $smp_type ] && RPMSMPTYPE=smp && break
+        [ $infact_arch == $smp_type ] && RPMSMPTYPE=smp && break
     done
-
     for smp_type in $BIGSMP_ARCHS; do
-        [ $TARGET_ARCH == $smp_type ] && RPMSMPTYPE=bigsmp && break
+        [ $infact_arch == $smp_type ] && RPMSMPTYPE=bigsmp && break
     done
 }
 
-- 
GitLab