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

[Xen-changelog] [xen-unstable] Avoid need for GREP variable by avoiding GNUisms. The



# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Node ID bd207697f0c7b3cce4593073435506f6d5b58ef8
# Parent  5525b18b7224966238c0e12123d0e8458e4e74e1
Avoid need for GREP variable by avoiding GNUisms. The
only one we appear to have is use of '-q'. Replace it
with redirection to /dev/null.

Also avoid use of 'tail' by replacing with 'head' or
'grep' as appropriate.

Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 Config.mk             |    2 +-
 buildconfigs/Rules.mk |    4 ++--
 config/Linux.mk       |    2 --
 config/SunOS.mk       |    1 -
 xen/Makefile          |    4 ++--
 xen/arch/x86/Makefile |    3 +--
 6 files changed, 6 insertions(+), 10 deletions(-)

diff -r 5525b18b7224 -r bd207697f0c7 Config.mk
--- a/Config.mk Wed Oct 18 11:38:59 2006 +0100
+++ b/Config.mk Wed Oct 18 13:43:35 2006 +0100
@@ -26,7 +26,7 @@ EXTRA_LIB += $(EXTRA_PREFIX)/$(LIBDIR)
 EXTRA_LIB += $(EXTRA_PREFIX)/$(LIBDIR)
 endif
 
-test-gcc-flag = $(shell $(1) -v --help 2>&1 | $(GREP) -q " $(2) " && echo $(2))
+test-gcc-flag = $(shell $(1) -v --help 2>&1 | grep " $(2) " >/dev/null 2>&1 && 
echo $(2))
 
 ifneq ($(debug),y)
 CFLAGS += -DNDEBUG
diff -r 5525b18b7224 -r bd207697f0c7 buildconfigs/Rules.mk
--- a/buildconfigs/Rules.mk     Wed Oct 18 11:38:59 2006 +0100
+++ b/buildconfigs/Rules.mk     Wed Oct 18 13:43:35 2006 +0100
@@ -22,7 +22,7 @@ endif
 
 # Expand Linux series to Linux version
 LINUX_SERIES   ?= 2.6
-LINUX_VER      ?= $(shell $(GREP) "^LINUX_VER " buildconfigs/mk.linux-2.6-xen 
| sed -e 's/.*=[ ]*//')
+LINUX_VER      ?= $(shell grep "^LINUX_VER " buildconfigs/mk.linux-2.6-xen | 
sed -e 's/.*=[ ]*//')
 
 # Setup Linux search path
 LINUX_SRC_PATH ?= .:..
@@ -125,7 +125,7 @@ ifeq ($(XEN_TARGET_X86_PAE),y)
 ifeq ($(XEN_TARGET_X86_PAE),y)
        sed -e 's!^CONFIG_HIGHMEM4G=y$$!\# CONFIG_HIGHMEM4G is not set!;s!^\# 
CONFIG_HIGHMEM64G is not set$$!CONFIG_HIGHMEM64G=y!' $(CONFIG_FILE) > 
$(CONFIG_FILE)- && mv $(CONFIG_FILE)- $(CONFIG_FILE)
 else
-       $(GREP) '^CONFIG_HIGHMEM64G=y' $(CONFIG_FILE) >/dev/null && ( sed -e 
's!^CONFIG_HIGHMEM64G=y$$!\# CONFIG_HIGHMEM64G is not set!;s!^\# 
CONFIG_HIGHMEM4G is not set$$!CONFIG_HIGHMEM4G=y!' $(CONFIG_FILE) > 
$(CONFIG_FILE)- && mv $(CONFIG_FILE)- $(CONFIG_FILE) ) || true
+       grep '^CONFIG_HIGHMEM64G=y' $(CONFIG_FILE) >/dev/null && ( sed -e 
's!^CONFIG_HIGHMEM64G=y$$!\# CONFIG_HIGHMEM64G is not set!;s!^\# 
CONFIG_HIGHMEM4G is not set$$!CONFIG_HIGHMEM4G=y!' $(CONFIG_FILE) > 
$(CONFIG_FILE)- && mv $(CONFIG_FILE)- $(CONFIG_FILE) ) || true
 endif
 
 # never delete any intermediate files.
diff -r 5525b18b7224 -r bd207697f0c7 config/Linux.mk
--- a/config/Linux.mk   Wed Oct 18 11:38:59 2006 +0100
+++ b/config/Linux.mk   Wed Oct 18 13:43:35 2006 +0100
@@ -10,8 +10,6 @@ STRIP      = $(CROSS_COMPILE)strip
 STRIP      = $(CROSS_COMPILE)strip
 OBJCOPY    = $(CROSS_COMPILE)objcopy
 OBJDUMP    = $(CROSS_COMPILE)objdump
-
-GREP       = grep
 
 INSTALL      = install
 INSTALL_DIR  = $(INSTALL) -d -m0755
diff -r 5525b18b7224 -r bd207697f0c7 config/SunOS.mk
--- a/config/SunOS.mk   Wed Oct 18 11:38:59 2006 +0100
+++ b/config/SunOS.mk   Wed Oct 18 13:43:35 2006 +0100
@@ -11,7 +11,6 @@ OBJCOPY    = $(CROSS_COMPILE)gobjcopy
 OBJCOPY    = $(CROSS_COMPILE)gobjcopy
 OBJDUMP    = $(CROSS_COMPILE)gobjdump
 
-GREP       = ggrep
 SHELL      = bash
 
 INSTALL      = ginstall
diff -r 5525b18b7224 -r bd207697f0c7 xen/Makefile
--- a/xen/Makefile      Wed Oct 18 11:38:59 2006 +0100
+++ b/xen/Makefile      Wed Oct 18 13:43:35 2006 +0100
@@ -96,7 +96,7 @@ include/xen/compile.h: include/xen/compi
            -e 's/@@whoami@@/$(USER)/g' \
            -e 's/@@domain@@/$(shell ([ -x /bin/dnsdomainname ] && 
/bin/dnsdomainname) || ([ -x /bin/domainname ] && /bin/domainname || echo 
[unknown]))/g' \
            -e 's/@@hostname@@/$(shell hostname)/g' \
-           -e 's|@@compiler@@|$(shell $(CC) $(CFLAGS) -v 2>&1 | tail -n 1 | 
sed -e "s;|;/;")|g' \
+           -e 's!@@compiler@@!$(shell $(CC) $(CFLAGS) -v 2>&1 | grep -i 
"gcc.*version")!g' \
            -e 's/@@version@@/$(XEN_VERSION)/g' \
            -e 's/@@subversion@@/$(XEN_SUBVERSION)/g' \
            -e 's/@@extraversion@@/$(XEN_EXTRAVERSION)/g' \
@@ -154,7 +154,7 @@ _cscope:
 
 .PHONY: MAP
 MAP:
-       $(NM) $(TARGET) | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] 
\)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | sort > System.map
+       $(NM) -n $(TARGET) | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] 
\)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' > System.map
 
 .PHONY: FORCE
 FORCE:
diff -r 5525b18b7224 -r bd207697f0c7 xen/arch/x86/Makefile
--- a/xen/arch/x86/Makefile     Wed Oct 18 11:38:59 2006 +0100
+++ b/xen/arch/x86/Makefile     Wed Oct 18 13:43:35 2006 +0100
@@ -46,8 +46,7 @@ obj-$(crash_debug) += gdbstub.o
 
 $(TARGET): $(TARGET)-syms boot/mkelf32
        ./boot/mkelf32 $(TARGET)-syms $(TARGET) 0x100000 \
-       `$(NM) $(TARGET)-syms | sort | tail -n 1 | \
-        sed -e 's/^\([^ ]*\).*/0x\1/'`
+       `$(NM) -nr $(TARGET)-syms | head -n 1 | sed -e 's/^\([^ ]*\).*/0x\1/'`
 
 $(TARGET)-syms: boot/$(TARGET_SUBARCH).o $(ALL_OBJS) xen.lds
        $(MAKE) -f $(BASEDIR)/Rules.mk $(BASEDIR)/common/symbols-dummy.o

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.