On Dec 4, 2003, at 10:51 am, Rudmer van Dijk wrote:

I noticed this about a week ago: head: `-1' option is obsolete; use `-n 1' Try `head --help' for more information. ... why is this obsoleted?

And the most irritating part is that is not phased out, like giving a warning
and then continue, but it only gives an error and stops.



From <http://www.gnu.org/software/coreutils/manual/html_mono/ coreutils.html#SEC7>:


  In a few cases, the GNU utilities' default behavior is incompatible
  with the POSIX standard. To suppress these incompatibilities, define
  the POSIXLY_CORRECTenvironment variable. Unless you are checking for
  POSIX conformance, you probably do not need to define POSIXLY_CORRECT.

  Newer versions of POSIX are occasionally incompatible with older
  versions. For example, older versions of POSIX required the command
  `sort +1' to sort based on the second and succeeding fields in each
  input line, but starting with POSIX 1003.1-2001 the same command is
  required to sort the file named `+1', and you must instead use the
  command `sort -k 2' to get the field-based sort.

  The GNU utilities normally conform to the version of POSIX that is
  standard for your system. To cause them to conform to a different
  version of POSIX, define the _POSIX2_VERSION environment variable to a
  value of the form yyyymm specifying the year and month the standard
  was adopted. Two values are currently supported for _POSIX2_VERSION:
  `199209' stands for POSIX 1003.2-1992, and `200112' stands for POSIX
  1003.1-2001. For example, if you are running older software that
  assumes an older version of POSIX and uses `sort +1', you can work
  around the compatibility problems by setting `_POSIX2_VERSION=199209'
  in your environment.

I seem to recall that this sort of behavior is problematic to the porting of Portage to other Unices (BSD & Mac OS X spring to mind) so I took a look at <http://www.gentoo.org/proj/en/gentoo-alt/macos-1.xml>:

  ....while Portage itself can run on
  these platforms, some ebuilds and eclasses currently contain
  Linux-specific conventions, particularly in how auxilliary programs
  like xargs, find and tar are called. These variations can cause an
  ebuild to execute correctly in a GNU environment but not in a BSD
  environment, or vice-versa.

drobbins proposes this solution, so hopefully the Gentoo developers will remedy your situation:

  The general strategy to address these issues should be as follows.
  First, an emphasis should be placed on writing shell code that is
  truly cross-platform in nature. Second, when there is no suitable
  cross-platform code, Portage should provide a general framework to
  allow ebuilds to easily adapt to situations to where variant calls are
  needed. Here is how Portage addresses the situation currently.

HTH,

Stroller.


-- [EMAIL PROTECTED] mailing list



Reply via email to