Re: Who broke sort(1) ?

2002-09-27 Thread M. Warner Losh

In message: [EMAIL PROTECTED]
attila! [EMAIL PROTECTED] writes:
: However, I do object to GNU's heavy handed removal of a
: flag which is in extensive use. I don't have a problem
: with the new syntax, but leave the old one intact

I keep telling people we should hack sort to only refuse to accept it
if the _POSIX_ME_HARDER environment variable is set.

FreeBSD has never been a total slave to standards.

Warner

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: Who broke sort(1) ?

2002-09-26 Thread Nick Hilliard

 It's not like people didn't have nine years' advance warning to fix
 their scripts.
 
 When's the first time the FreeBSD sort(1) man page mentioned that this
 syntax was deprecated?  Can we at least start from there?

The man page in 4.x notes that -k is an alternative rather than the
recommended syntax.  Moving something from being officially recommended
syntax in 4.x to dropping the syntax completely in 5.x is verging on
gratuitous breakage, and is going to confuse and piss off a lot of
users.  In fact, why does somebody not modify the man page for -stable
to note that it is now deprecated usage, and please use -k instead? 
Should this change even make it into 4.7?  After all, the sooner the
better, and if 5.0 is going to be released in 6 weeks, that's not much
warning.

I'm all for the making the change in a controlled manner, but let's not
lose sight of the fact that FreeBSD is supposedly a functional operating
system, not a dysfunctional one.  Tim Kientzle's suggestion is a good
compromise, and although it may cause some peculiar behaviour in
edge-case situations, it would be a lot better than the dropping the
syntax without warning from one major version to the next.

Nick
(off to fix some _POSIXLY_VERBOTEN scripts, grumble)




--- sort.1.orig Mon Sep 10 12:10:30 2001
+++ sort.1  Thu Sep 26 10:32:04 2002
 -5,7 +5,7 
 .SH SYNOPSIS
 .B sort
 [\-cmus] [\-t separator] [\-o output-file] [\-T tempdir] [\-bdfiMnr]
-[+POS1 [\-POS2]] [\-k POS1[,POS2]] [file...]
+[\-k POS1[,POS2]] [file...]
 .br
 .B sort
 {\-\-help,\-\-version}
 -150,15 +150,19 
 .I \-c
 option, check that no pair of consecutive lines compares equal.
 .TP
-.I +POS1 [\-POS2]
+.I \-k POS1[,POS2]
+An alternate syntax for specifying sorting keys.
 Specify a field within each line to use as a sorting key.  The field
 consists of the portion of the line starting at POS1 and up to (but
 not including) POS2 (or to the end of the line if POS2 is not given).
-The fields and character positions are numbered starting with 0.
+The fields and character positions are numbered starting with 1.
 .TP
-.I \-k POS1[,POS2]
+.I +POS1 [\-POS2]
 An alternate syntax for specifying sorting keys.
-The fields and character positions are numbered starting with 1.
+The fields and character positions are numbered starting with 0.
+This syntax is now officially deprecated because it conflicts with
+the POSIX 1003.2 standard.  The syntax will be dropped in a future
+release of FreeBSD.
 .PP
 A position has the form \fIf\fP.\fIc\fP, where \fIf\fP is the number
 of the field to use and \fIc\fP is the number of the first character



Re: Who broke sort(1) ?

2002-09-25 Thread Bob Willcox

Funny, this argument suddenly reminds me of the Hitch Hikers Guide to
the Galexy :-)

Bob

On Tue, Sep 24, 2002 at 05:01:29PM -0400, Garrett Wollman wrote:
 On Tue, 24 Sep 2002 13:30:11 -0700, Peter Wemm [EMAIL PROTECTED] said:
 
  Oh man, this is going to suck.  There are thousands and thousands of third
  party scripts that use +n syntax.
 
  I am most unhappy with this change. :-(
 
 The time to complain about it was back in 1992when the old syntax was
 labeled ``deprecated'' by P1003.2, or in 1999 when the revision cycle
 was just heating up.  Old deprecated features were automatically
 dropped leading up to the 2001 revision, unless someone could make a
 case for their retention.  That case wasn't made in the case of
 `sort', and as a result the Standard no longer permits the old syntax.
 It's not like people didn't have nine years' advance warning to fix
 their scripts.
 
 FreeBSD supported `-k' in 1.0; see
 
http://www.freebsd.org/cgi/cvsweb.cgi/src/gnu/usr.bin/sort/Attic/sort.c?rev=1.1content-type=text/x-cvsweb-markup.
 
 -GAWollman
 
 
 To Unsubscribe: send mail to [EMAIL PROTECTED]
 with unsubscribe freebsd-current in the body of the message

-- 
Bob WillcoxWe seem to have forgotten the simple truth that
[EMAIL PROTECTED]   reason is never perfect. Only non-sense attains
Austin, TX perfection.  -- Poul Henningsen [1894-1967]


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: Who broke sort(1) ?

2002-09-25 Thread Poul-Henning Kamp

In message [EMAIL PROTECTED], Bob Willcox writes:

Funny, this argument suddenly reminds me of the Hitch Hikers Guide to
the Galexy :-)

I've gone of the idea of progress, it's over rated.

:-)

-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
[EMAIL PROTECTED] | TCP/IP since RFC 956
FreeBSD committer   | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: Who broke sort(1) ?

2002-09-25 Thread Tim Kientzle

One possible solution to the sort problem:

* Continue to accept the old syntax for now,
   but add a warning message, something like:
   Warning: sort +N is deprecated, use -k instead.

* After a year, drop support for the
   old syntax.  After staring at warning
   messages for a year, few people will
   be able to claim ignorance.

The messages will serve both to advertise
the change and to flag those scripts that
rely on the old syntax.


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: Who broke sort(1) ?

2002-09-24 Thread Andrey A. Chernov

On Mon, Sep 23, 2002 at 12:29:35 +1000, Tim Robbins wrote:
 
 A workaround might be to #undef _POSIX2_VERSION after #include'ing unistd.h
 in posixver.c but I don't think that would be correct. It's probably better

Removing compatibility with +pos f.e. they just try to confirm POSIX, 
because +N can be filename.

 to either change all the scripts that use the obsolescent +pos -pos syntax
 to use the new -k syntax or to change _POSIX2_VERSION back to whatever it
 was before. I think the second is more realistic.

I think changing scripts to use -k syntax will be right solution.

-- 
Andrey A. Chernov
http://ache.pp.ru/

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: Who broke sort(1) ?

2002-09-24 Thread Peter Wemm

Tim Robbins wrote:
 On Sun, Sep 22, 2002 at 01:43:38PM -0700, Steve Kargl wrote:
 
  On Sun, Sep 22, 2002 at 10:17:41PM +0200, Poul-Henning Kamp wrote:
   
   flat# date | sort +5n
   sort: open failed: +5n: No such file or directory
   
   This breaks the build in libncurses...
   
  
  POSIX via wollman.
  
  See revision 1.58 of /usr/include/unistd.h, i.e.,
  
  /* Define the versions we target for compliance. */
  #define _POSIX_VERSION  200112L
  #define _POSIX2_VERSION 200112L
  
  
  See email in the last 24 hours from walt about 
  problems building libc and Tim Robbins response
  to the problem.
 
 I didn't read src/contrib/gnu-sort/lib/posixver.c carefully enough to
 notice that it uses the the _POSIX2_VERSION macro, I thought it only used
 the environment variable by that same name.
 
 A workaround might be to #undef _POSIX2_VERSION after #include'ing unistd.h
 in posixver.c but I don't think that would be correct. It's probably better
 to either change all the scripts that use the obsolescent +pos -pos syntax
 to use the new -k syntax or to change _POSIX2_VERSION back to whatever it
 was before. I think the second is more realistic.

Oh man, this is going to suck.  There are thousands and thousands of third
party scripts that use +n syntax.

I am most unhappy with this change. :-(

Cheers,
-Peter
--
Peter Wemm - [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]
All of this is for nothing if we don't go to the stars - JMS/B5


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: Who broke sort(1) ?

2002-09-24 Thread Bill Fenner


Here's my suggested fix:

stash% pwd
/usr/src/gnu/usr.bin/sort
stash% cvs diff -uN
cvs diff: Diffing .
Index: posixver.c
===
RCS file: posixver.c
diff -N posixver.c
--- /dev/null   1 Jan 1970 00:00:00 -
+++ posixver.c  24 Sep 2002 20:37:22 -
@@ -0,0 +1,8 @@
+/*
+ * Tell GNU sort(1) to implement the obsolete +1 -0 syntax even though
+ * it has been removed from the version of POSIX that the rest of
+ * the system conforms to.
+ */
+int posix2_version(void) {
+   return 0;
+}

If it's too confusing to have files with the same names in
/usr/src/gnu/usr.bin/sort and /usr/src/contrib/gnu-sort/lib this one
could be renamed (e.g. to posixver-notreally.c) with a corresponding
Makefile change.

I am in the middle of a buildworld with this change.

  Bill

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: Who broke sort(1) ?

2002-09-24 Thread Andrey A. Chernov

On Tue, Sep 24, 2002 at 13:30:11 -0700, Peter Wemm wrote:
 
 Oh man, this is going to suck.  There are thousands and thousands of third
 party scripts that use +n syntax.
 
 I am most unhappy with this change. :-(

It will be possible to have both variants, but +N is valid filename per 
POSIX, so obsoleted syntax can't be supported.

-- 
Andrey A. Chernov
http://ache.pp.ru/

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: Who broke sort(1) ?

2002-09-24 Thread Terry Lambert

Peter Wemm wrote:
 Oh man, this is going to suck.  There are thousands and thousands of third
 party scripts that use +n syntax.
 
 I am most unhappy with this change. :-(

I'll say it again: unconditionally complying POSIX is an impediment
to getting real work done.  8-(.

I would be very happy if a lot of the POSIX semantics could go live
in a user space library somewhere, and leave programmers alone.
Signals semantics and file locking alone are enough to justify that.

Yeah, it's nice to have a Big Red Switch(tm) that would turn off
all behaviour not mandated by some standard, so that you could
flip the siwtch, and *know* that the programs you write will run
anywhere the standard is implemented.  It's a good goal for a
platform, to let it act as a unified porting environment.  The
key thing here, though, is that it needs to be *a* swtich, and it
needs to be a *switch*.

For the particular case of sort, it would be nice if it did what
it was supposed to do, and got anal about POSIX _only_ if there
was an environment variable set.

Maybe there would be bonus points if the system itself could be
built with the switch flipped, but that's something that can be
done incrementally, later, by People Who Care(tm).

Until sh, make, tar, and so on also drop behaviours that are
not specified by POSIX, it's really silly to make sort drop them.


-- Terry

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: Who broke sort(1) ?

2002-09-24 Thread Andrey A. Chernov

On Tue, Sep 24, 2002 at 13:43:08 -0700, Bill Fenner wrote:
 
 Here's my suggested fix:

Please, no. They do the right thing. You can bypass it setting 
_POSIX2_VERSION=199209 in the environment.

-- 
Andrey A. Chernov
http://ache.pp.ru/

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: Who broke sort(1) ?

2002-09-24 Thread Bill Fenner


Please, no. They do the right thing.

I guess there are varying definitions of what the right thing is.
I don't think it's widely known that the +/- syntax was obsoleted.
I am vaguely a standards weenie and I didn't know.

  Bill

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: Who broke sort(1) ?

2002-09-24 Thread Garrett Wollman

On Tue, 24 Sep 2002 13:30:11 -0700, Peter Wemm [EMAIL PROTECTED] said:

 Oh man, this is going to suck.  There are thousands and thousands of third
 party scripts that use +n syntax.

 I am most unhappy with this change. :-(

The time to complain about it was back in 1992when the old syntax was
labeled ``deprecated'' by P1003.2, or in 1999 when the revision cycle
was just heating up.  Old deprecated features were automatically
dropped leading up to the 2001 revision, unless someone could make a
case for their retention.  That case wasn't made in the case of
`sort', and as a result the Standard no longer permits the old syntax.
It's not like people didn't have nine years' advance warning to fix
their scripts.

FreeBSD supported `-k' in 1.0; see
http://www.freebsd.org/cgi/cvsweb.cgi/src/gnu/usr.bin/sort/Attic/sort.c?rev=1.1content-type=text/x-cvsweb-markup.

-GAWollman


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: Who broke sort(1) ?

2002-09-24 Thread Bill Fenner


Until sh, make, tar, and so on also drop behaviours that are
not specified by POSIX, it's really silly to make sort drop them.

It's not that the +x/-y argument syntax is not specified - it's that
it's specifically disallowed.  (I disagree with that restriction, but
let's at least have the right argument.)

  Bill

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: Who broke sort(1) ?

2002-09-24 Thread Andrey A. Chernov

On Tue, Sep 24, 2002 at 13:59:02 -0700, Bill Fenner wrote:
 
 Please, no. They do the right thing.
 
 I guess there are varying definitions of what the right thing is.

I mean just:
1) We all agree targeting POSIX, so POSIX conformance is the right thing.
2) If we use _POSIX2_VERSION 2001* in our headers, we target this POSIX
level where +N is clearly dropped (and was as 'depricated' long time).

 I don't think it's widely known that the +/- syntax was obsoleted.

It was known about 10 years, but not widely.

-- 
Andrey A. Chernov
http://ache.pp.ru/

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: Who broke sort(1) ?

2002-09-24 Thread Bill Fenner


It's not like people didn't have nine years' advance warning to fix
their scripts.

When's the first time the FreeBSD sort(1) man page mentioned that this
syntax was deprecated?  Can we at least start from there?

  Bill

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: Who broke sort(1) ?

2002-09-24 Thread Peter Wemm

Garrett Wollman wrote:
 On Tue, 24 Sep 2002 13:30:11 -0700, Peter Wemm [EMAIL PROTECTED] said:
 
  Oh man, this is going to suck.  There are thousands and thousands of third
  party scripts that use +n syntax.
 
  I am most unhappy with this change. :-(
 
 The time to complain about it was back in 1992when the old syntax was
 labeled ``deprecated'' by P1003.2, or in 1999 when the revision cycle
 was just heating up.  Old deprecated features were automatically
 dropped leading up to the 2001 revision, unless someone could make a
 case for their retention.  That case wasn't made in the case of
 `sort', and as a result the Standard no longer permits the old syntax.
 It's not like people didn't have nine years' advance warning to fix
 their scripts.

Closed payware standards do not count as 'fair warning'.  I still have
never been able to see a posix standard.

Cheers,
-Peter
--
Peter Wemm - [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]
All of this is for nothing if we don't go to the stars - JMS/B5


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: Who broke sort(1) ?

2002-09-24 Thread Peter Wemm

Andrey A. Chernov wrote:
 On Tue, Sep 24, 2002 at 13:30:11 -0700, Peter Wemm wrote:
  
  Oh man, this is going to suck.  There are thousands and thousands of third
  party scripts that use +n syntax.
  
  I am most unhappy with this change. :-(
 
 It will be possible to have both variants, but +N is valid filename per 
 POSIX, so obsoleted syntax can't be supported.

Yes it can.  If anybody wants portability beyond FreeBSD, they'll be using
sort ./+N for their filenames.

How many successful widely distributed OS's are there that does not allow
sort +N as a numeric argument by default?  (I'm sure somebody can dig up
an obscure linux distribution or some microcontroller OS or something, I'm
talking about something on the scale of redhat or solaris or something)

Cheers,
-Peter
--
Peter Wemm - [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]
All of this is for nothing if we don't go to the stars - JMS/B5


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: Who broke sort(1) ?

2002-09-24 Thread Peter Wemm

Bill Fenner wrote:
 
 Here's my suggested fix:

 @@ -0,0 +1,8 @@
 +/*
 + * Tell GNU sort(1) to implement the obsolete +1 -0 syntax even though
 + * it has been removed from the version of POSIX that the rest of
 + * the system conforms to.
 + */
 +int posix2_version(void) {
 + return 0;
 +}

Try something like this:
#include stdlib.h
#include unistd.h
int
posix2_version(void)
{
if (getenv(POSIX_ME_HARDER) || getenv(POSIXLY_CORRECT))
return _POSIX2_VERSION;
else
return 0;
}

Cheers,
-Peter
--
Peter Wemm - [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]
All of this is for nothing if we don't go to the stars - JMS/B5


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: Who broke sort(1) ?

2002-09-24 Thread Andrey A. Chernov

On Tue, Sep 24, 2002 at 14:39:01 -0700, Peter Wemm wrote:
 Bill Fenner wrote:
  
  Here's my suggested fix:
  +}
 
 Try something like this:

If you want something like this, here is less broken way:

--- lib/posixver.c.bak  Fri Jun  7 11:24:45 2002
+++ lib/posixver.c  Wed Sep 25 01:42:01 2002
@@ -43,7 +43,7 @@
 int
 posix2_version (void)
 {
-  long int v = _POSIX2_VERSION;
+  long int v = 199209 /* XXX: _POSIX2_VERSION */;
   char const *s = getenv (_POSIX2_VERSION);
 
   if (s  *s)

-- 
Andrey A. Chernov
http://ache.pp.ru/

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: Who broke sort(1) ?

2002-09-24 Thread Garrett Wollman

On Tue, 24 Sep 2002 14:09:31 -0700, Bill Fenner [EMAIL PROTECTED] said:

 When's the first time the FreeBSD sort(1) man page mentioned that this
 syntax was deprecated?  Can we at least start from there?

It does not appear to have ever been properly documented.

I don't object to maintaining backwards compatibility for a few more
releases (even if the application writers are the ones at fault),
since many more people read the manual pages than read the Standard.
However, I would point out that this isn't the first time we broke a
traditional syntax in favor of reducing restrictions on argument
names: see the recent history of chown(8).

-GAWollman


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: Who broke sort(1) ?

2002-09-24 Thread Garrett Wollman

On Tue, 24 Sep 2002 14:26:43 -0700, Peter Wemm [EMAIL PROTECTED] said:

 Closed payware standards do not count as 'fair warning'.  I still have
 never been able to see a posix standard.

Go to a library.  Or go to http://www.opengroup.org/ and register for
free on-line access.

-GAWollman


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: Who broke sort(1) ?

2002-09-24 Thread Bill Fenner


I think a lot of people would be happier if we could maintain backwards
compatability (and document the fact that they're extremely obsolete)
for a few more releases.  Despite the fact that the main UNIX reference
that I use was published in 1984, I don't actually want everything to
stay the same forever.

  Bill

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: Who broke sort(1) ?

2002-09-24 Thread Garance A Drosihn

At 6:02 PM -0400 9/24/02, Garrett Wollman wrote:
On Tue, 24 Sep 2002, Bill Fenner [EMAIL PROTECTED] said:

   When's the first time the FreeBSD sort(1) man page mentioned that
   this syntax was deprecated?  Can we at least start from there?

It does not appear to have ever been properly documented.

I don't object to maintaining backwards compatibility for a few more
releases (even if the application writers are the ones at fault),
since many more people read the manual pages than read the Standard.
However, I would point out that this isn't the first time we broke a
traditional syntax in favor of reducing restrictions on argument
names: see the recent history of chown(8).

In the case of 'sort', I would rather see us ease into the change
a bit more.  We already have enough going on with 5.0-current that
we don't need the extra excitement of this particular change.  I
can readily live with the fact that 5.0-release will not be 100%
posix compliant.

I know I have all kinds of scripts squirreled away which have
'sort +n' commands in them, and I have zero real files that are
named +n.  This change gives me nothing but broken scripts, and
I would rather see us have an almost posix sort, and with the
option to set an environment variable to remove support for +N.
That way, the people who *want* to debug a bunch of scripts can
set that environment variable, instead of forcing the rest of us
to run around setting an environment variable to protect us from
broken scripts.

In some sense I don't mind the change, but I really think we are
now past the point where we can keep throwing incompatible changes
into 5.0-release.  We have enough broken ports on 5.0-current, we
do not need more incompatible changes to break even more ports to
give us even more work to do.

Just my 2 cents...

-- 
Garance Alistair Drosehn=   [EMAIL PROTECTED]
Senior Systems Programmer   or  [EMAIL PROTECTED]
Rensselaer Polytechnic Instituteor  [EMAIL PROTECTED]

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: Who broke sort(1) ?

2002-09-24 Thread Peter Wemm

Garrett Wollman wrote:
 On Tue, 24 Sep 2002 14:09:31 -0700, Bill Fenner [EMAIL PROTECTED] s
aid:
 
  When's the first time the FreeBSD sort(1) man page mentioned that this
  syntax was deprecated?  Can we at least start from there?
 
 It does not appear to have ever been properly documented.
 
 I don't object to maintaining backwards compatibility for a few more
 releases (even if the application writers are the ones at fault),
 since many more people read the manual pages than read the Standard.
 However, I would point out that this isn't the first time we broke a
 traditional syntax in favor of reducing restrictions on argument
 names: see the recent history of chown(8).

While this is true, consider that rev 1.1 of chown.8 says:

 COMPATIBILITY
 Previous versions of the chown utility used the dot (``.'') character to
 distinguish the group name.  This has been changed to be a colon (``:'')
 character so that user and group names may contain the dot character.

revision 1.1
date: 1994/05/26 05:22:22;  author: rgrimes;  state: Exp;

It's also true that this was widely known and the transition was mostly
orderly.  We didn't turn it off one night as a side effect of another
change that broke even our own world builds.

Cheers,
-Peter
--
Peter Wemm - [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]
All of this is for nothing if we don't go to the stars - JMS/B5


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: Who broke sort(1) ?

2002-09-24 Thread Peter Wemm

Garrett Wollman wrote:
 On Tue, 24 Sep 2002 14:26:43 -0700, Peter Wemm [EMAIL PROTECTED] said:
 
  Closed payware standards do not count as 'fair warning'.  I still have
  never been able to see a posix standard.
 
 Go to a library.  Or go to http://www.opengroup.org/ and register for
 free on-line access.

The 1992 version hasn't been available online since 1992.  I hadn't realized
that the opengroup and posix stuff had unified.  I'd always thought of
the opengroup stuff as SVID-on-steorids (System V Interface Definition, as
it was once called).

Is the posix 1992 version available?  The local library doesn't have
anything even remotely like this.

 -GAWollman
 

Cheers,
-Peter
--
Peter Wemm - [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]
All of this is for nothing if we don't go to the stars - JMS/B5


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: Who broke sort(1) ?

2002-09-24 Thread Mark Valentine

 From: [EMAIL PROTECTED] (Bill Fenner)
 Date: Tue 24 Sep, 2002
 Subject: Re: Who broke sort(1) ?

 When's the first time the FreeBSD sort(1) man page mentioned that this
 syntax was deprecated?  Can we at least start from there?

I echo this sentiment.  Ideally, two 4.x releases would document something
as deprecated before it actually broke in 5.0 (but preferably it still
wouldn't break by default).

Cheers,

Mark.

-- 
Mark Valentine, Thuvia Labs [EMAIL PROTECTED]   http://www.thuvia.co.uk
Tigers will do ANYTHING for a tuna fish sandwich.   Mark Valentine uses
We're kind of stupid that way.   *munch* *munch*and endorses FreeBSD
  -- http://www.calvinandhobbes.com  http://www.freebsd.org

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: Who broke sort(1) ?

2002-09-24 Thread Giorgos Keramidas

On 2002-09-24 13:30, Peter Wemm [EMAIL PROTECTED] wrote:
 Oh man, this is going to suck.  There are thousands and thousands of third
 party scripts that use +n syntax.

And ports.  Lots of them.  Dozens of them :(
I just noticed that textproc/ispell doesn't work anymore for me.

More will appear later, I'm sure.

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: Who broke sort(1) ?

2002-09-24 Thread Mark Valentine

 From: [EMAIL PROTECTED] (Garrett Wollman)
 Date: Tue 24 Sep, 2002
 Subject: Re: Who broke sort(1) ?

 I don't object to maintaining backwards compatibility for a few more
 releases (even if the application writers are the ones at fault),

Umm, their fault may simply have been that they wrote the code back when
it was correct and/or the only way...

The author may no longer even be around to maintain the product, even if
the product still exists.  That's what backwards compatibility is about.

I'm pretty sure Solaris will continue to support +POS in /usr/bin/sort
for years to come, even though it _is_ marked as (obsolete) in the manual
page.

Personally, I've never had reason to unwire it from my fingers.

I have less qualms about removing backward compatibility for behaviour
that was only ever accidental.

Cheers,

Mark.

-- 
Mark Valentine, Thuvia Labs [EMAIL PROTECTED]   http://www.thuvia.co.uk
Tigers will do ANYTHING for a tuna fish sandwich.   Mark Valentine uses
We're kind of stupid that way.   *munch* *munch*and endorses FreeBSD
  -- http://www.calvinandhobbes.com  http://www.freebsd.org

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: Who broke sort(1) ?

2002-09-24 Thread Mark Valentine

 From: [EMAIL PROTECTED] (Peter Wemm)
 Date: Tue 24 Sep, 2002
 Subject: Re: Who broke sort(1) ?

 How many successful widely distributed OS's are there that does not allow
 sort +N as a numeric argument by default?  (I'm sure somebody can dig up
 an obscure linux distribution or some microcontroller OS or something, I'm
 talking about something on the scale of redhat or solaris or something)

Ditto for expr -1 + 1...

Cheers,

Mark.

-- 
Mark Valentine, Thuvia Labs [EMAIL PROTECTED]   http://www.thuvia.co.uk
Tigers will do ANYTHING for a tuna fish sandwich.   Mark Valentine uses
We're kind of stupid that way.   *munch* *munch*and endorses FreeBSD
  -- http://www.calvinandhobbes.com  http://www.freebsd.org

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: Who broke sort(1) ?

2002-09-24 Thread Bruce Evans

On Tue, 24 Sep 2002, Peter Wemm wrote:

 Garrett Wollman wrote:
  On Tue, 24 Sep 2002 14:26:43 -0700, Peter Wemm [EMAIL PROTECTED] said:
 
   Closed payware standards do not count as 'fair warning'.  I still have
   never been able to see a posix standard.
 
  Go to a library.  Or go to http://www.opengroup.org/ and register for
  free on-line access.

 The 1992 version hasn't been available online since 1992.  I hadn't realized
 that the opengroup and posix stuff had unified.  I'd always thought of
 the opengroup stuff as SVID-on-steorids (System V Interface Definition, as
 it was once called).

 Is the posix 1992 version available?  The local library doesn't have
 anything even remotely like this.

A 1991 draft version is still available at:

http://www.funet.fi/pub/doc/posix/posix

Bruce


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: Who broke sort(1) ?

2002-09-24 Thread Mark Valentine

 From: [EMAIL PROTECTED] (Bruce Evans)
 Date: Wed 25 Sep, 2002
 Subject: Re: Who broke sort(1) ?

 On Tue, 24 Sep 2002, Peter Wemm wrote:
 
 A 1991 draft version is still available at:
 
 http://www.funet.fi/pub/doc/posix/posix

Nice directory listing.

s/http/ftp/ and s/www/ftp/ and I get another directory listing.

A further s/posix\/posix/posix/ and I get:

  ftp get README -
  remote: README
  227 Entering Passive Mode (193,166,3,2,200,254)
  150 Opening BINARY mode data connection for /pub/doc/posix/README (77 bytes).
  The file `index' contains a short summary of the contents of this directory.
  226 Transfer complete.
  77 bytes received in 0.24 seconds (0.31 KB/s)

But:

  -rw-r--r--   1 root  csc 107951 May 30  1992 index.tar.Z

I could try harder.  If it turns out to be legal, it might even be old
enough by now to be useful...  ;-)

Cheers,

Mark.

-- 
Mark Valentine, Thuvia Labs [EMAIL PROTECTED]   http://www.thuvia.co.uk
Tigers will do ANYTHING for a tuna fish sandwich.   Mark Valentine uses
We're kind of stupid that way.   *munch* *munch*and endorses FreeBSD
  -- http://www.calvinandhobbes.com  http://www.freebsd.org

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: Who broke sort(1) ?

2002-09-24 Thread Steve Kargl

On Wed, Sep 25, 2002 at 12:06:45AM +, attila! wrote:
 
 However, I do object to GNU's heavy handed removal of a
 flag which is in extensive use. I don't have a problem
 with the new syntax, but leave the old one intact
 
-k, --key=POS1[,POS2]
   start a key at POS1, end it at POS 2
 

GNU's heavy handed removal?  According to Bill Fenner
the removal is mandated by POSIX.

-- 
Steve

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Who broke sort(1) ?

2002-09-22 Thread Poul-Henning Kamp


flat# date | sort +5n
sort: open failed: +5n: No such file or directory

This breaks the build in libncurses...

-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
[EMAIL PROTECTED] | TCP/IP since RFC 956
FreeBSD committer   | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: Who broke sort(1) ?

2002-09-22 Thread Poul-Henning Kamp

In message [EMAIL PROTECTED], Poul-Henning Kamp writes:

flat# date | sort +5n
sort: open failed: +5n: No such file or directory

This breaks the build in libncurses...

Ok, nailed it down.

this commit, is the culprit.  I guess it changes the fts ABI in
some subtle way because backing the change to src/include/fts.h
out makes sort(1) work again.

I'll try if adding sort(1) to as a bootstrap-tool for buildworld
solves this...

Poul-Henning


wollman 2002/09/20 18:28:41 PDT

  Modified files:
bin/cp   cp.c 
bin/ls   ls.c 
include  fts.h 
lib/libc/gen fts.3 fts.c 
usr.bin/find find.c 
usr.sbin/ctm/ctm_dequeue ctm_dequeue.c 
usr.sbin/mtree   create.c 
usr.sbin/pkg_install/lib match.c 
  Log:
  Make the threatened fts(3) ABI fix.  FTSENT now avoids the use of the struct
  hack, thereby allowing future extensions to the structure (e.g., for extended
  attributes) without rebreaking the ABI.  FTSENT now contains a pointer to the
  parent stream, which fts_compar() can then take advantage of, avoiding the
  undefined behavior previously warned about.  As a consequence of this change,
  the prototype of the comparison function passed to fts_open() has changed
  to reflect the required amount of constness for its use.  All callers in the
  tree are updated to use the correct prototype.
  
  Comparison functions can now make use of the new parent pointer to access
  the new stream-specific private data pointer, which is intended to assist
  creation of reentrant library routines which use fts(3) internally.
  
  Not objected to in spirit by: -arch
  
  Revision  ChangesPath
  1.41  +2 -2  src/bin/cp/cp.c
  1.66  +2 -2  src/bin/ls/ls.c
  1.7   +10 -3 src/include/fts.h
  1.14  +41 -6 src/lib/libc/gen/fts.3
  1.21  +68 -14src/lib/libc/gen/fts.c
  1.15  +2 -2  src/usr.bin/find/find.c
  1.11  +3 -3  src/usr.sbin/ctm/ctm_dequeue/ctm_dequeue.c
  1.27  +2 -2  src/usr.sbin/mtree/create.c
  1.13  +2 -2  src/usr.sbin/pkg_install/lib/match.c


-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
[EMAIL PROTECTED] | TCP/IP since RFC 956
FreeBSD committer   | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: Who broke sort(1) ?

2002-09-22 Thread Steve Kargl

On Sun, Sep 22, 2002 at 10:17:41PM +0200, Poul-Henning Kamp wrote:
 
 flat# date | sort +5n
 sort: open failed: +5n: No such file or directory
 
 This breaks the build in libncurses...
 

POSIX via wollman.

See revision 1.58 of /usr/include/unistd.h, i.e.,

/* Define the versions we target for compliance. */
#define _POSIX_VERSION  200112L
#define _POSIX2_VERSION 200112L


See email in the last 24 hours from walt about 
problems building libc and Tim Robbins response
to the problem.

-- 
Steve

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: Who broke sort(1) ?

2002-09-22 Thread Tim Robbins

On Sun, Sep 22, 2002 at 01:43:38PM -0700, Steve Kargl wrote:

 On Sun, Sep 22, 2002 at 10:17:41PM +0200, Poul-Henning Kamp wrote:
  
  flat# date | sort +5n
  sort: open failed: +5n: No such file or directory
  
  This breaks the build in libncurses...
  
 
 POSIX via wollman.
 
 See revision 1.58 of /usr/include/unistd.h, i.e.,
 
 /* Define the versions we target for compliance. */
 #define _POSIX_VERSION  200112L
 #define _POSIX2_VERSION 200112L
 
 
 See email in the last 24 hours from walt about 
 problems building libc and Tim Robbins response
 to the problem.

I didn't read src/contrib/gnu-sort/lib/posixver.c carefully enough to
notice that it uses the the _POSIX2_VERSION macro, I thought it only used
the environment variable by that same name.

A workaround might be to #undef _POSIX2_VERSION after #include'ing unistd.h
in posixver.c but I don't think that would be correct. It's probably better
to either change all the scripts that use the obsolescent +pos -pos syntax
to use the new -k syntax or to change _POSIX2_VERSION back to whatever it
was before. I think the second is more realistic.


Tim

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: Who broke sort(1) ?

2002-09-22 Thread Mike Barcroft

Tim Robbins [EMAIL PROTECTED] writes:
 On Sun, Sep 22, 2002 at 01:43:38PM -0700, Steve Kargl wrote:
  On Sun, Sep 22, 2002 at 10:17:41PM +0200, Poul-Henning Kamp wrote:
   
   flat# date | sort +5n
   sort: open failed: +5n: No such file or directory
   
   This breaks the build in libncurses...
   
  
  POSIX via wollman.
  
  See revision 1.58 of /usr/include/unistd.h, i.e.,
  
  /* Define the versions we target for compliance. */
  #define _POSIX_VERSION  200112L
  #define _POSIX2_VERSION 200112L
  
  
  See email in the last 24 hours from walt about 
  problems building libc and Tim Robbins response
  to the problem.
 
 I didn't read src/contrib/gnu-sort/lib/posixver.c carefully enough to
 notice that it uses the the _POSIX2_VERSION macro, I thought it only used
 the environment variable by that same name.
 
 A workaround might be to #undef _POSIX2_VERSION after #include'ing unistd.h
 in posixver.c but I don't think that would be correct. It's probably better
 to either change all the scripts that use the obsolescent +pos -pos syntax
 to use the new -k syntax or to change _POSIX2_VERSION back to whatever it
 was before. I think the second is more realistic.

I think we'd really like to target POSIX 2001 for 5.0-RELEASE, so the
first solution would be best.  Temporarily backing out the updated
POSIX version bump might not be a bad idea if this is a task which
will take a while.

Best regards,
Mike Barcroft

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message