On Tue, Jan 27, 2004 at 10:46:55AM +1000, [EMAIL PROTECTED] wrote:
>Building 4.4.0 RC2 on Solaris gives the following on Solaris for
>xc/programs/Xserver/hw/xfree86
>
>rm -f build.new
>echo "#define BUILD_DATE `date +%Y%m%d`" > build.new
>echo "#define CLOG_DATE `if tail CHANGELOG |  grep -F -q '$XFree86:'; then
>tail
> CHANGELOG | grep -F '$XFree86:' |  sed s,'.* \([0-9][0-9]*\)/\([0-9][0-9]
>*\)/\(
>[0-9][0-9]*\).*,\1\2\3,';  else echo 0; fi`" >> build.new
>grep: illegal option -- F
>grep: illegal option -- q
>Usage: grep -hblcnsviw pattern file . . .
>+ rm -f xf86Build.h
>+ mv -f build.new xf86Build.h
>rm -f build.new
>
>/usr/xpg4/bin/grep needs to be used instead of the default /usr/bin/grep.
>
>Should ChangelogDate and ChangelogDateCmd be added to sun.cf to corect
>this?

Or we could add GrepCmd and define it to /usr/xpg4/bin/grep for older
versions of Solaris.

Or use 'fgrep' instead of -F, and redirect to /dev/null instead of -q.
We use fgrep in lnxdoc.rules, this might be the easiest solution.  I've
attached a patch that does this.  Let me know if it works for you.

David
-- 
David Dawes
developer/release engineer                      The XFree86 Project
www.XFree86.org/~dawes
Index: xfree86.cf
===================================================================
RCS file: /home/x-cvs/xc/config/cf/xfree86.cf,v
retrieving revision 3.466
diff -u -r3.466 xfree86.cf
--- xfree86.cf  11 Jan 2004 18:48:11 -0000      3.466
+++ xfree86.cf  27 Jan 2004 15:59:02 -0000
@@ -74,8 +74,8 @@
 
 #ifndef ChangelogDateCmd
 # define ChangelogDateCmd if tail $(CHANGELOGFILE) | \                 @@\
-       grep -F -q '$$XFree86:'; then \                                 @@\
-         tail $(CHANGELOGFILE) | grep -F '$$XFree86:' | \              @@\
+       fgrep '$$XFree86:' >/dev/null 2>&1; then \                      @@\
+         tail $(CHANGELOGFILE) | fgrep '$$XFree86:' | \                @@\
          sed s,'.* \([0-9][0-9]*\)/\([0-9][0-9]*\)/\([0-9][0-9]*\).*,\1\2\3,'; \ @@\
        else echo 0; fi
 #endif

Reply via email to