Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 29834 - Syntax incompatible with new coreutils/sort causes graphviz 1.10 build to fail
Summary: Syntax incompatible with new coreutils/sort causes graphviz 1.10 build to fail
Status: RESOLVED DUPLICATE of bug 28414
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Todd Berman (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on: 28414
Blocks:
  Show dependency tree
 
Reported: 2003-09-28 13:24 UTC by Arve Knudsen
Modified: 2005-07-17 13:06 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch to replace antiquated sort syntax (graphviz.txt,412 bytes, patch)
2003-09-28 13:28 UTC, Arve Knudsen
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Arve Knudsen 2003-09-28 13:24:30 UTC
During the build process make calls sort with the now unsupported syntax +0 -1 
(specifying field keys), the correct syntax would be -k1,2. A simple search and 
replace on graphviz-1.10/dotneato/common/Makefile seems sufficient.

Reproducible: Always
Steps to Reproduce:
1. emerge graphviz
2.
3.

Actual Results:  
sed s/_//g color_names | sort +0 -1 > color_lib
sort: invalid option -- 1
Comment 1 Arve Knudsen 2003-09-28 13:28:09 UTC
Created attachment 18434 [details, diff]
Patch to replace antiquated sort syntax

A simple sed statement replaces unsupported syntax for specifying sort fields
in dotneato/common/Makefile. I'm no bash/sed expert, but it looks like it
works
(builds).
Comment 2 Seemant Kulleen (RETIRED) gentoo-dev 2003-09-28 19:03:56 UTC
brandy, can you confirm the fix please?
Comment 3 Andreas Simon 2003-09-29 01:59:49 UTC
The patch worked here. Thanks.
Comment 4 Brandy Westcott (RETIRED) gentoo-dev 2003-09-29 03:18:34 UTC
Both coreutils-5.0 and coreutils-5.0.91 still support the deprecated
field-key syntax if we are using glibc-2.3.2
From sort.c in coreutils-5.0.91:


	  if (obsolete_usage && optarg[0] == '+')
	    {
	      /* Treat +POS1 [-POS2] as a key if possible; but silently
		 treat an operand as a file if it is not a valid +POS1.  */
		 .....
		  if (optind != argc && argv[optind][0] == '-'
		      && ISDIGIT (argv[optind][1]))
		      .....


So the deprecated syntax is supported if obsolete_usage is true.
This variable is set in sort.c: 

	bool obsolete_usage = (posix2_version () < 200112);

and the posix2_version function reads the _POSIX2_VERSION macro from /usr/include/unistd.h
which is:

	#define _POSIX2_VERSION	199209L

The only way I can reproduce this error is by setting the _POSIX2_VERSION
macro to something greater than 200112 when installing coreutils.
Comment 5 Brandy Westcott (RETIRED) gentoo-dev 2003-09-29 03:27:35 UTC
Since glibc-cvs isn't currently supported, closing...
Comment 6 Todd Berman (RETIRED) gentoo-dev 2003-09-29 06:30:06 UTC
although it isnt supported, whats in glibc-cvs will soon be in glibc.

Will this patch break existing glibc installs?

if not, we might as well apply it now so to be proactive and prevent future
bugs :)
Comment 7 Arve Knudsen 2003-09-29 08:50:18 UTC
I'm using glibc-2.3.2-r4, which defines _POSIX2_VERSION as 200112L.
Comment 8 Martin Schlemmer (RETIRED) gentoo-dev 2003-09-29 10:18:43 UTC
We need to decide - either we fix this, or we 'fix' coreutils I guess.
Johnm did a eclass to support this, althought its not sufficient in
that it do not catch them all.  I did though add it to the bug, but I
see he have not updated it yet.
Comment 9 Jason Rhinelander 2003-09-29 13:41:18 UTC
This is a duplicate of bug 28414 (or vice-versa), which has a "better" patch
- the patch here misses one of the deprecated sort calls.
Comment 10 Martin Holzer (RETIRED) gentoo-dev 2003-10-28 06:22:07 UTC
so which patch is better, here or in #28414 ?
Comment 11 Seemant Kulleen (RETIRED) gentoo-dev 2003-12-08 19:03:52 UTC

*** This bug has been marked as a duplicate of 28414 ***