Re: CFT: new BSD-licensed sort available

2012-03-18 Thread Eitan Adler
On Wed, Mar 14, 2012 at 11:59 AM, Gabor Kovesdan ga...@freebsd.org wrote:
 Hi Folks,
 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
 oleg.moskale...@citrix.com showed interest in continuing this version and
 he has made a very good job on this BSD sort variant.
...
  If you are
 interested in this sort utility, could you please try the port and report us
 any issue that you experience?
Is there a public repository?

-- 
Eitan Adler
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: CFT: new BSD-licensed sort available

2012-03-18 Thread Gabor Kovesdan

On 2012.03.14. 19:01, Mark Felder wrote:
Would it be appropriate to perhaps have a port option to 
OVERWRITE_BASE and then people could just install that port, build 
world and kernel... build a ton of ports. See if anything that might 
possibly use it breaks? 
Yes, I'm working on the update and it will have that option. Thanks for 
your comment.


Gabor
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: CFT: new BSD-licensed sort available

2012-03-18 Thread Gabor Kovesdan

On 2012.03.14. 22:10, Adrian Chadd wrote:

So you could intall gnusort, bsdsort, and then some config file would
determine which was used.

'sort' would then be a symlink to said magic program, that'd look at
its argv[0], look at the contents of that file, and exec() the right
one.
I prefer simplicity. And GNU sort should go as soon as BSD sort is good 
enough to replace it. If you check the wiki, we have set a goal for 
10.X, which is the GPL-free base system. I think it is possible and I 
hope we can achieve it.


Gabor
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: CFT: new BSD-licensed sort available

2012-03-17 Thread Baptiste Daroussin
On Fri, Mar 16, 2012 at 09:08:52PM -0700, Doug Barton wrote:
 On 03/16/2012 18:47, Eric van Gyzen wrote:
  On 03/16/2012 08:25 PM, Doug Barton wrote:
  On 03/14/2012 15:14, Jonathan Anderson wrote:
  In fact, the runtime behaviour of the Debian alternatives system is
  simpler than that:
  http://segfault.in/2010/04/using-the-debian-alternatives-system/
  [...]
  This sounds like a good solution to more than one problem. Does anyone
  know why they indirect through 2 sets of symlinks? That article doesn't
  touch on the why? only the what.
  
  Do you mean, why do they do
  /usr/bin/vim - /etc/alternatives/vim - /usr/bin/vim.gtk
  instead of
  /usr/bin/vim - /usr/bin/vim.gtk
  ?
  
  Someone's choice of a vi-like editor would be considered configuration,
  so it belongs in /etc.
 
 If that's the *only* reason then it seems to me that it would be better
 solved by being able to express that in a config file in /usr/local/etc
 which the alternate-updater script takes into account. But I need to
 install debian for other reasons anyway, so I'll look at this in more
 detail. Thanks.
 

As I already said I started working on something equivalent for freebsd:
http://people.freebsd.org/~bapt/alternative.txt but never found time to finish.

Why to symlink, this is 1/ because it concerns user/admin configuration, 2 it
allows to change it even with your /usr/local/bin mounted RO.

regards,
Bapt


pgpD1c7e1QceU.pgp
Description: PGP signature


Re: CFT: new BSD-licensed sort available

2012-03-17 Thread Doug Barton
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

On 03/17/2012 03:27, Baptiste Daroussin wrote:

 Why to symlink, this is 1/ because it concerns user/admin
 configuration,

I get that, but why is a conf file not the right answer? We could even
put the conf file in /etc if we decide that this is a feature that
should be in the base. Having 2 symlinks just seems like overkill.

 2 it allows to change it even with your /usr/local/bin mounted RO.

I don't understand this bit, sorry. Aren't we talking about symlinks
in / and /usr pointing to alternate versions in either /, /usr, or
/usr/local? I don't see how anything would need to be written in
/usr/local with either 1 symlink or 2.


Doug

- -- 

This .signature sanitized for your protection
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.18 (FreeBSD)

iQEcBAEBCAAGBQJPZR+GAAoJEFzGhvEaGryER/sH/A8nuMDQ18cmm1OkboCn1ZKY
DFb8THBfCwiXlpN7VYqz6YaYwumIooTO6108sKPbBoC3UPE7sZN7F9ENFbihkYrg
Gq3YPhn6h6Wkvt61s+2Om/fkJEUQvy0u+9WMJE5YExBKpeIBMSxkhmTj9B7WKfS5
hONNUVWww4pSvBF4eMCTf41mtI54jlsOrPZYJofTMvOc26T8qLlzgJEPLp+uAlOx
/92rRcKklIkLokUzWzFO/XdnmzqkpeLw0Oo46iIWer/4uFUzQl5+WcJ+kDwykRzB
l2Oai0X5IOA/YKuEsToVvLOydBpZ2uBqgfSEe5Hzn2P0Vts/i5ckVHqFN5txPkw=
=Jvry
-END PGP SIGNATURE-
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: CFT: new BSD-licensed sort available

2012-03-17 Thread Adrian Chadd
I can imagine a netboot'ed system where the config in /etc/alternates/
is different for individual hosts, which have a shared root.

That way you can have two netbooted hosts with a shared read-only
rootfs, but a ramdisk /etc, with the locally configured mailer,
alternates, etc.


Adrian
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: CFT: new BSD-licensed sort available

2012-03-17 Thread Doug Barton
On 03/17/2012 17:08, Adrian Chadd wrote:
 I can imagine a netboot'ed system where the config in /etc/alternates/
 is different for individual hosts, which have a shared root.
 
 That way you can have two netbooted hosts with a shared read-only
 rootfs, but a ramdisk /etc, with the locally configured mailer,
 alternates, etc.

Sure, and in that situation the conf file in /etc would still work just
as well.

I should point out that I'm imagining a conf file *plus* an rc.d script
to enforce it ... likely just calling update-alternatives (or whatever
we decide to call it).


Doug

-- 

This .signature sanitized for your protection
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: CFT: new BSD-licensed sort available

2012-03-17 Thread Adrian Chadd
On 17 March 2012 17:15, Doug Barton do...@freebsd.org wrote:

 Sure, and in that situation the conf file in /etc would still work just
 as well.

How will the conf file work? If there's a program like what
mailer.conf uses, sure. If the symlink is directly from sort to
/usr/bin/bsdsort, no so much.
The shared root filesystem is readonly, so the netbooted/VM host can't
change it.


Adrian
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: CFT: new BSD-licensed sort available

2012-03-16 Thread Doug Barton
On 03/14/2012 15:14, Jonathan Anderson wrote:
 In fact, the runtime behaviour of the Debian alternatives system is simpler 
 than that:
 http://segfault.in/2010/04/using-the-debian-alternatives-system/
 
 The custom Perl script with a config file is used to set up symlinks, which 
 at runtime are... well, just symlinks. For instance, /usr/bin/vim is a 
 symlink to /etc/alternatives/vim, which is itself a symlink to a binary like 
 vim.gtk (example shamelessly stolen from the linked page, since I no longer 
 have any Debian boxes to check for myself on :). No magic binaries or argv[0] 
 fu.

This sounds like a good solution to more than one problem. Does anyone
know why they indirect through 2 sets of symlinks? That article doesn't
touch on the why? only the what.


Doug

-- 

This .signature sanitized for your protection
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: CFT: new BSD-licensed sort available

2012-03-16 Thread Eric van Gyzen

On 03/16/2012 08:25 PM, Doug Barton wrote:

On 03/14/2012 15:14, Jonathan Anderson wrote:

In fact, the runtime behaviour of the Debian alternatives system is simpler 
than that:
http://segfault.in/2010/04/using-the-debian-alternatives-system/

[...]

This sounds like a good solution to more than one problem. Does anyone
know why they indirect through 2 sets of symlinks? That article doesn't
touch on the why? only the what.


Do you mean, why do they do
/usr/bin/vim - /etc/alternatives/vim - /usr/bin/vim.gtk
instead of
/usr/bin/vim - /usr/bin/vim.gtk
?

Someone's choice of a vi-like editor would be considered configuration, 
so it belongs in /etc.


I agree, it does sound like a good solution.  As simple as possible, but 
no less.  ;)


Eric
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: CFT: new BSD-licensed sort available

2012-03-16 Thread Doug Barton
On 03/16/2012 18:47, Eric van Gyzen wrote:
 On 03/16/2012 08:25 PM, Doug Barton wrote:
 On 03/14/2012 15:14, Jonathan Anderson wrote:
 In fact, the runtime behaviour of the Debian alternatives system is
 simpler than that:
 http://segfault.in/2010/04/using-the-debian-alternatives-system/
 [...]
 This sounds like a good solution to more than one problem. Does anyone
 know why they indirect through 2 sets of symlinks? That article doesn't
 touch on the why? only the what.
 
 Do you mean, why do they do
 /usr/bin/vim - /etc/alternatives/vim - /usr/bin/vim.gtk
 instead of
 /usr/bin/vim - /usr/bin/vim.gtk
 ?
 
 Someone's choice of a vi-like editor would be considered configuration,
 so it belongs in /etc.

If that's the *only* reason then it seems to me that it would be better
solved by being able to express that in a config file in /usr/local/etc
which the alternate-updater script takes into account. But I need to
install debian for other reasons anyway, so I'll look at this in more
detail. Thanks.

-- 

This .signature sanitized for your protection
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: CFT: new BSD-licensed sort available

2012-03-15 Thread Kazuaki ODA

(12/03/15 0:59), Gabor Kovesdan wrote:

Hi Folks,

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
oleg.moskale...@citrix.com 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?

Thanks in advance,
Gabor
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


bsdsort is one of my long awaiting ports.  Because GNU sort has a 
numeric sort bug in some multi-byte locales.  For example,


ls -l /usr/bin | env LANG=en_US.UTF-8 sort -n -k 5
(we expect the result is sorted by file size.)

shows invalid result.

bsdsort does not has such a bug, so I hope our base system will include 
bsdsort in the near future.


Thanks.
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: CFT: new BSD-licensed sort available

2012-03-15 Thread Adrian Chadd
On 14 March 2012 19:32, Mark Felder f...@feld.me wrote:

 I've seen several discussions on the bsd lists with everyone against the
 debian alternatives way. I don't know the history but I don't think it has
 much support. I assume it has to do with binaries passing through /etc via
 symlinks. I don't personally have much of an opinion on this.

Ah! It's mailer - /etc/mail/mailer.conf . I almost would like this to
be more generic.

But sure, you could just come up with a config file method that
regenerates a bunch of symlinks in /usr and such. It doesn't have to
go through /etc/.

Anyway, it's just an idea. It'd be nice to have bsdsort in the default
build, called 'bsdsort'.


Adrian
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: CFT: new BSD-licensed sort available

2012-03-14 Thread Mark Felder
Would it be appropriate to perhaps have a port option to OVERWRITE_BASE  
and then people could just install that port, build world and kernel...  
build a ton of ports. See if anything that might possibly use it breaks?

___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: CFT: new BSD-licensed sort available

2012-03-14 Thread Adrian Chadd
On 14 March 2012 08:59, Gabor Kovesdan ga...@freebsd.org wrote:

 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
 oleg.moskale...@citrix.com 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?

Hi,

This makes me think of the whole debian-y way of replacing the mailer
programs using some magic alias program.

So you could intall gnusort, bsdsort, and then some config file would
determine which was used.

'sort' would then be a symlink to said magic program, that'd look at
its argv[0], look at the contents of that file, and exec() the right
one.

Would that be helpful herE?



Adrian
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: CFT: new BSD-licensed sort available

2012-03-14 Thread Adrian Chadd
I must be thinking of our mailer trick then?

I know i've seen it somewhere before.

Alternatives sounds fun though?



ADrian
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: CFT: new BSD-licensed sort available

2012-03-14 Thread Mark Felder
On Wed, 14 Mar 2012 20:26:23 -0500, Adrian Chadd adr...@freebsd.org  
wrote:



I must be thinking of our mailer trick then?

I know i've seen it somewhere before.

Alternatives sounds fun though?



I've seen several discussions on the bsd lists with everyone against the  
debian alternatives way. I don't know the history but I don't think it has  
much support. I assume it has to do with binaries passing through /etc via  
symlinks. I don't personally have much of an opinion on this.

___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: CFT: new BSD-licensed sort available

2012-03-14 Thread Jonathan Anderson
On 14 Mar 2012, at 21:10, Adrian Chadd wrote:
 Hi,
 
 This makes me think of the whole debian-y way of replacing the mailer
 programs using some magic alias program.
 
 So you could intall gnusort, bsdsort, and then some config file would
 determine which was used.
 
 'sort' would then be a symlink to said magic program, that'd look at
 its argv[0], look at the contents of that file, and exec() the right
 one.

In fact, the runtime behaviour of the Debian alternatives system is simpler 
than that:
http://segfault.in/2010/04/using-the-debian-alternatives-system/

The custom Perl script with a config file is used to set up symlinks, which at 
runtime are... well, just symlinks. For instance, /usr/bin/vim is a symlink to 
/etc/alternatives/vim, which is itself a symlink to a binary like vim.gtk 
(example shamelessly stolen from the linked page, since I no longer have any 
Debian boxes to check for myself on :). No magic binaries or argv[0] fu.

In one way, it's an elegant solution. On the other, it's a classic example of 
Wheeler's Law in action. :)


Jon
--
Jonathan Anderson

Research Student, Security Group
Computer Laboratory
University of Cambridge

+44 (1223) 763747
jonathan.ander...@cl.cam.ac.uk___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


RE: CFT: new BSD-licensed sort available

2012-03-14 Thread Oleg Moskalenko
This is true, debians do the symlinks trick.

In Ubuntu :

/usr/bin/java - /etc/alternatives/java
/etc/alternatives/java - /usr/lib/jvm/java-6-openjdk/jre/bin/java

Oleg

From: Jonathan Anderson [mailto:jonathan.ander...@cl.cam.ac.uk]
Sent: Wednesday, March 14, 2012 3:14 PM
To: Adrian Chadd
Cc: Gabor Kovesdan; freebsd-current@freebsd.org; Oleg Moskalenko; 
freebsd-po...@freebsd.org
Subject: Re: CFT: new BSD-licensed sort available

On 14 Mar 2012, at 21:10, Adrian Chadd wrote:
Hi,

This makes me think of the whole debian-y way of replacing the mailer
programs using some magic alias program.

So you could intall gnusort, bsdsort, and then some config file would
determine which was used.

'sort' would then be a symlink to said magic program, that'd look at
its argv[0], look at the contents of that file, and exec() the right
one.

In fact, the runtime behaviour of the Debian alternatives system is simpler 
than that:
http://segfault.in/2010/04/using-the-debian-alternatives-system/

The custom Perl script with a config file is used to set up symlinks, which at 
runtime are... well, just symlinks. For instance, /usr/bin/vim is a symlink to 
/etc/alternatives/vim, which is itself a symlink to a binary like vim.gtk 
(example shamelessly stolen from the linked page, since I no longer have any 
Debian boxes to check for myself on :). No magic binaries or argv[0] fu.

In one way, it's an elegant solution. On the other, it's a classic example of 
Wheeler's Law in action. :)


Jon
--
Jonathan Anderson

Research Student, Security Group
Computer Laboratory
University of Cambridge

+44 (1223) 763747
jonathan.ander...@cl.cam.ac.ukmailto:jonathan.ander...@cl.cam.ac.uk
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org