[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Libguestfs] [PATCH] virt-v2v: silence P2V build error on x86_64



This is a user case if users build virt-v2v on x86_64 platform
and only want to try V2V section then they must see P2V rpm
build error, it's not necessary for V2V users.

In addition, if some automation scripts call autobuild.sh on
x86_64 platform then the programming also will exit due to
the buiding error.

Signed-off-by: Alex Jia <ajia redhat com>
---
 autobuild.sh |   15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/autobuild.sh b/autobuild.sh
index 21886a7..7d07cbd 100755
--- a/autobuild.sh
+++ b/autobuild.sh
@@ -50,6 +50,10 @@ fi
 rm -f $NAME-*.tar.gz
 ./Build dist
 
+if [ -z "$ARCH" ]; then
+    ARCH=`uname -p`
+fi
+
 if [ -f /usr/bin/rpmbuild ]; then
   if [ -n "$AUTOBUILD_COUNTER" ]; then
     EXTRA_RELEASE=".auto$AUTOBUILD_COUNTER"
@@ -63,10 +67,13 @@ if [ -f /usr/bin/rpmbuild ]; then
            --define "extra_release $EXTRA_RELEASE" \
            --clean virt-v2v.spec
 
-  rpmbuild --nodeps -ba --target i686 \
-           --define "_sourcedir `pwd`" \
-           --define "extra_release $EXTRA_RELEASE" \
-           --clean rubygem-virt-p2v.spec
+  # virt-p2v only can be built on i686 platform now
+  if [ "$ARCH" = "i686" ]; then
+      rpmbuild --nodeps -ba --target $ARCH \
+               --define "_sourcedir `pwd`" \
+               --define "extra_release $EXTRA_RELEASE" \
+               --clean rubygem-virt-p2v.spec
+  fi
 fi
 
 exit 0
-- 
1.7.10.2


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]