Portable way to achieve 'ls -v' ?

View: New views
2 Messages — Rating Filter:   Alert me  

Portable way to achieve 'ls -v' ?

by Bugzilla from rhys.ulerich@gmail.com :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi all,

Any suggestions for how to achieve sort-by-version in a portable way?
'ls -v' does exactly what I need, but doesn't look to be a standard
argument.

- Rhys


_______________________________________________
Autoconf mailing list
Autoconf@...
http://lists.gnu.org/mailman/listinfo/autoconf

Re: Portable way to achieve 'ls -v' ?

by Ralf Wildenhues :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello Rhys,

* Rhys Ulerich wrote on Sat, Sep 26, 2009 at 08:33:34PM CEST:
> Any suggestions for how to achieve sort-by-version in a portable way?
> 'ls -v' does exactly what I need, but doesn't look to be a standard
> argument.

Recent Autoconf has m4_version_compare for a comparison at autoconf run
time, and AS_VERSION_COMPARE for one at configure run time.  gnulib has
a module strverscmp for C comparison code.

IIRC there were slight, probably unintended differences in the
comparison algorithms; or at least, some bugs have been fixed in the not
too distant past.

HTH.

Cheers,
Ralf


_______________________________________________
Autoconf mailing list
Autoconf@...
http://lists.gnu.org/mailman/listinfo/autoconf