cvs commit: patches/coreutils coreutils-5.0-posixver-1.patch

jim at linuxfromscratch.org jim at linuxfromscratch.org
Mon Dec 1 16:06:43 PST 2003


jim         03/12/01 17:06:43

  Added:       coreutils coreutils-5.0-posixver-1.patch
  Log:
  Added: coreutils-5.0-posixver-1.patch
  
  Revision  Changes    Path
  1.1                  patches/coreutils/coreutils-5.0-posixver-1.patch
  
  Index: coreutils-5.0-posixver-1.patch
  ===================================================================
  Submitted By: Greg Schafer <gschafer at zip dot com dot au>
  Date: 2003-12-01
  Initial Package Version: 5.0
  Origin: Idea borrowed from Debian.
  Description: Override system POSIX2 version.
  
  Glibc's newer than 2.3.2 define _POSIX_VERSION as 200112L. Compiling Coreutils
  on such a Glibc system causes some of the utilities (head, tail, sort etc) to
  reject the traditional syntax of those utilities which, BTW, happens to be
  embedded in literally millions of scripts everywhere. e.g. tail -1 results in:
  
  tail: `-1' option is obsolete; use `-n 1'
  
  The problem can of course be worked around by exporting _POSIX_VERSION=199209
  into the environment. This patch addresses the issue at the source and restores
  the traditional behaviour until all of the many affected scripts and packages
  can be fixed. The new behaviour can still be had by exporting
  _POSIX_VERSION=200112 into the environment.
  
  diff -Naur coreutils-5.0.orig/lib/posixver.c coreutils-5.0/lib/posixver.c
  --- coreutils-5.0.orig/lib/posixver.c	2002-02-16 08:13:08.000000000 +0000
  +++ coreutils-5.0/lib/posixver.c	2003-12-01 05:09:19.000000000 +0000
  @@ -37,6 +37,11 @@
   # define _POSIX2_VERSION 0
   #endif
   
  +/* Do what Debian does and override system POSIX2 version pending transition
  +   discussions.  */
  +#undef _POSIX2_VERSION
  +#define _POSIX2_VERSION 199209L
  +
   /* The POSIX version that utilities should conform to.  The default is
      specified by the system.  */
   
  
  
  



More information about the patches mailing list