How do I use and update Gnulib?
Gnulib provides replacement implementations of functions that are
not available on all (Unix-like) operating systems. In order to sync with the
latest Gnulib code, starting from the directory above your
monitoring-plugins
repository, do something like:
$ git clone git://git.savannah.gnu.org/gnulib.git
$ cd gnulib
$ GNULIB_HEAD=$(git rev-parse --short HEAD)
$ cd ../monitoring-plugins
$ ../gnulib/gnulib-tool --update
$ find build-aux gl -name '*~' -o -name '.gitignore' | xargs rm
$ git status
$ git add build-aux gl
$ git commit -m "Sync with the latest Gnulib code ($GNULIB_HEAD)"
In order to make a given function available via Gnulib (on systems which don't
provide that function), the corresponding module must be imported
using gnulib-tool
, e.g. (in order to add the strcase
module):
$ cd monitoring-plugins
$ git log -1 --format='%s' --grep='^Sync with the latest Gnulib code'
$ (cd ../gnulib && git checkout <REF>) # where <REF> is the one from above
$ ../gnulib/gnulib-tool --no-vc-files --add strcase
$ find gl -name '*~' | xargs rm
$ git status
$ git add gl
# At this point you can build and add any auto-generated file in gl/ to .gitignore
$ git add .gitignore
$ git commit -m 'Add Gnulib module "strcase"'