[Ovirt-devel] [PATCH 4/4] build-all.sh: Avoid unnecessary "grep" in IP-addr-extraction code

Jim Meyering meyering at redhat.com
Sun Jun 15 21:00:25 UTC 2008


save a pipe/process

>From 488ca2d17d6b654b85ccd146a98aacbc5c62532f Mon Sep 17 00:00:00 2001
Date: Sun, 15 Jun 2008 14:55:43 +0200
Subject: [PATCH] * build-all.sh: Avoid an unnecessary "grep" in IP-addr-extraction code.

---
 build-all.sh |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/build-all.sh b/build-all.sh
index eb9c848..e681f18 100755
--- a/build-all.sh
+++ b/build-all.sh
@@ -226,7 +226,8 @@ fi
 # NOTE: create-wui-appliance.sh must be run as root
 if [ $update_app == 1 ]; then
     # FIXME: This can go away once we have livecd tools building the appliances
-    VIRBR=$(virsh net-dumpxml default | grep "<ip address=" | sed "s/.*ip address='\(.*\)' .*/\1/")
+    VIRBR=$(virsh net-dumpxml default \
+	    | sed -n "s/.*ip address='\([^.]*\)' .*/\1/p")
     test -z $VIRBR && die "Could not get ip address of default network for app"

     cd $BASE/wui-appliance
--
1.5.6.rc2.47.g075fa




More information about the ovirt-devel mailing list