zsh-workers
 help / color / mirror / code / Atom feed
* POSIX conformance in coreutils
@ 2005-01-12  1:01 Vin Shelton
  2005-01-12  9:18 ` Stephane Chazelas
  2005-01-12 10:27 ` POSIX conformance in coreutils Peter Stephenson
  0 siblings, 2 replies; 10+ messages in thread
From: Vin Shelton @ 2005-01-12  1:01 UTC (permalink / raw)
  To: zsh-workers

GNU coreutils (at least versions 5.2.1 and 5.3.0) enforce POSIX
conformance, so they don't like 'tail -1', instead they require
'tail -n 1'.

This causes problems in E01options.tst:

  # Count the number of directories on the stack.  Don't care what they are.
  dircount() { dirs -v | tail -1 | awk '{ print $1 + 1}'; }

tail: `-1' option is obsolete; use `-n 1'
Try `tail --help' for more information.


It's easy enough to change the E01options.tst script to use 'test -n
1', but that's probably not the right thing to do.

We could also add

_POSIX2_VERSION=199209

to the test.  This would probably not break older versions of tail,
and would force new versions of tail to accept the old syntax.  Patch
attached:

Index: ChangeLog
===================================================================
RCS file: /cvsroot/zsh/zsh/ChangeLog,v
retrieving revision 1.2463
diff -a -u -U0 -r1.2463 ChangeLog
--- ChangeLog	10 Jan 2005 18:43:19 -0000	1.2463
+++ ChangeLog	12 Jan 2005 00:58:28 -0000
@@ -0,0 +1,5 @@
+2005-01-11  Vin Shelton  <acs@xemacs.org>
+
+	* Test/E01options.ztst: Add _POSIX2_VERSION=199209 to silence new
+	coreutils' versions of tail.
+
Index: Test/E01options.ztst
===================================================================
RCS file: /cvsroot/zsh/zsh/Test/E01options.ztst,v
retrieving revision 1.13
diff -a -u -r1.13 E01options.ztst
--- Test/E01options.ztst	9 Sep 2004 15:03:31 -0000	1.13
+++ Test/E01options.ztst	12 Jan 2005 00:58:32 -0000
@@ -116,7 +116,7 @@
 >scalar
   
   # Count the number of directories on the stack.  Don't care what they are.
-  dircount() { dirs -v | tail -1 | awk '{ print $1 + 1}'; }
+  dircount() { dirs -v | _POSIX2_VERSION=199209 tail -1 | awk '{ print $1 + 1}'; }
   unsetopt autopushd
   cd tmpcd
   dircount

HTH,
  Vin


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2005-02-23 18:24 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-12  1:01 POSIX conformance in coreutils Vin Shelton
2005-01-12  9:18 ` Stephane Chazelas
2005-01-12 16:12   ` POSIX conformance in Solaris Danek Duvall
2005-01-12 10:27 ` POSIX conformance in coreutils Peter Stephenson
2005-01-12 10:42   ` Stephane Chazelas
2005-01-12 14:19   ` Vin Shelton
2005-01-12 15:58     ` Peter Stephenson
2005-02-23 16:36       ` Oliver Kiddle
     [not found]         ` <okiddle@yahoo.co.uk>
2005-02-23 18:24           ` Peter Stephenson
2005-01-12 16:18     ` Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).