From owner-freebsd-ports@FreeBSD.ORG Fri Mar 16 22:50:17 2012 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 656D21065675; Fri, 16 Mar 2012 22:50:17 +0000 (UTC) (envelope-from oleg.moskalenko@citrix.com) Received: from SMTP02.CITRIX.COM (smtp02.citrix.com [66.165.176.63]) by mx1.freebsd.org (Postfix) with ESMTP id F26D58FC0A; Fri, 16 Mar 2012 22:50:16 +0000 (UTC) X-IronPort-AV: E=Sophos;i="4.73,601,1325480400"; d="scan'208";a="186348349" Received: from sjcpmailmx01.citrite.net ([10.216.14.74]) by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5; 16 Mar 2012 18:50:09 -0400 Received: from SJCPMAILBOX01.citrite.net ([10.216.4.73]) by SJCPMAILMX01.citrite.net ([10.216.14.74]) with mapi; Fri, 16 Mar 2012 15:50:08 -0700 From: Oleg Moskalenko To: 'Lowell Gilbert' , "freebsd-ports@freebsd.org" Date: Fri, 16 Mar 2012 15:50:08 -0700 Thread-Topic: CFT: new BSD-licensed sort available Thread-Index: Ac0DxWHVmSNnWAK3QLWbmwoMshgz1wAAPU9g Message-ID: <031222CBCF33214AB2EB4ABA279428A30107B5E9D2AB@SJCPMAILBOX01.citrite.net> References: <4F60C059.7060904@FreeBSD.org> <44pqcd8yhd.fsf@lowell-desk.lan> <4462e46ul7.fsf@lowell-desk.lan> In-Reply-To: <4462e46ul7.fsf@lowell-desk.lan> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: Chris Rees , Gabor Kovesdan Subject: RE: CFT: new BSD-licensed sort available X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Mar 2012 22:50:17 -0000 Yes, indeed, there was an old sort syntax, where they supported it in a for= m "+POS1 -POS2". It is a non-POSIX obsolete syntax, so we did not implement= it in the new BSD sort. I can add it, if necessary. Regards, Oleg -----Original Message----- From: Lowell Gilbert [mailto:freebsd-ports-local@be-well.ilk.org]=20 Sent: Friday, March 16, 2012 3:37 PM To: freebsd-ports@freebsd.org Cc: Chris Rees; Gabor Kovesdan; Oleg Moskalenko Subject: Re: CFT: new BSD-licensed sort available Chris Rees writes: > On 15 March 2012 19:18, Lowell Gilbert > wrote: >> Gabor Kovesdan writes: >> >>> some time ago I started writing a BSDL sort variant from scratch since >>> the OpenBSD version did not support multibyte locales and was hard to >>> modify. The development was a bit stalled but recently, Oleg >>> Moskalenko showed interest in continuing >>> this version and he has made a very good job on this BSD sort >>> variant. Now it is compatible with the base version of GNU sort but >>> the performance in most cases (string sort and -n) is quite behind GNU >>> sort (although with -g it is about *4 times* faster). Oleg is still >>> working on optimizing the code and the long-term plan is to drop GNU >>> sort once this variant is good enough to replace it. For now, it is >>> only available in Ports Collection as textproc/bsdsort but if there is >>> no objection or any serious bug report I plan to add it to base >>> installed as bsdsort, being GNU sort still the default sort until it >>> proves that we can safely drop GNU sort. If you are interested in this >>> sort utility, could you please try the port and report us any issue >>> that you experience? >> >> portsdb(1) (from portupgrade) doesn't seem to like it; >> apparently it is missing a '-2' option, which I haven't >> tracked down yet... > > Fails with gnusort too anyway: > > [crees@pegasus]~% gsort -2 > gsort: invalid option -- '2' > Try `gsort --help' for more information. > [crees@pegasus]~% As it turns out, this *is* something that Gnu sort supports, although the documentation claims that the syntax is obsolete -- and doesn't document it very well. [5022] (lowell-desk) ~> printf "fee\nfie\nfoe\nfum\nfoo\nbaz" |gsort -t= 'a' +1 -2 fee fie foe foo fum baz [5022] (lowell-desk) ~>=20 It wouldn't be bad if BSD sort supported it, but it should definitely be fixed in the ports Makefile. I have submitted the fix in a PR: http://www.freebsd.org/cgi/query-pr.cgi?pr=3D166188 Personally, I'd don't see any reason for bsdsort to include this functionality...