networkupstools / nut-website

Network UPS Tools website and protocol library
6 stars 14 forks source link

BSD sort does not support same field specifiers as GNU sort #7

Closed clepple closed 9 years ago

clepple commented 10 years ago

I get the following error in OS X:

sort: stray character in field spec: invalid field specification `4.1,4.5rV'

The man page on FreeBSD also indicates that sort does not support dots in the field specification.

This is a pretty low-priority bug, but eventually I would like to add an autoconf test to see if "gsort" is installed.

clepple commented 10 years ago

@JeanPerriault I think checking for gsort in the configure script would be better (since that is what is used when 'sort' is invoked on Linux), and then sort would get replaced with @GSORT@ or whatever. However, when I mentioned via email that the website doesn't build on OS X, I wasn't thinking that it needed to be solved soon - we can build the website and documentation on Linux systems for now.

aquette commented 10 years ago

considering the context and limited impact, we could simply check for gsort first, and then sort.

--- a/configure.ac +++ b/configure.ac @@ -101,6 +101,7 @@ AC_PROG_CXX AC_PROG_INSTALL AC_PROG_EGREP AC_PATH_PROG(AR, ar) +AC_CHECK_PROGS(SORT, gsort sort) AC_CHECK_TOOL(RANLIB, ranlib, :) dnl Postpone call to AC_PROG_LIBTOOL to allow disabling static lib AC_C_BIGENDIAN

@JeanPerriault could you please test the above snippet? (apply using 'patch -p0 < /path/to/patch', from within the 'nut' (not -website) top-level source directory

@clepple btw, where / how do you exactly get this error?

clepple commented 10 years ago

@aquette when building the nut-website repository on OS X. At the moment, it does not show up in Buildbot because we are only building nut-website on Debian.

I would rather that we not apply that patch to the repository, since it just masks the problem.

clepple commented 10 years ago

The nut-upsdev list is really meant for this sort of discussion. We just use the Github issue tracker for tracking progress on fixing issues.

zykh commented 9 years ago

@clepple, does the following branch solve the problems and work on OS X? https://github.com/zykh/nut-website/tree/issue7

zykh commented 9 years ago

merged