[Nagiosplug-devel] doc/makefile

Ton Voon ton.voon at altinity.com
Thu Feb 8 09:07:14 CET 2007


Hi Thomas,

On 8 Feb 2007, at 05:10, Thomas Guyot-Sionnest wrote:

> Looking at an error message, I realized that in doc/makefile there's
> some shell code that seems useless... It's:
>
>   if [[ -e developer-guidelines/developer-guidelines.html ]] ; then \
>     mv developer-guidelines/developer-guidelines.html . ;\
>     rm -f developer-guidelines ;\
>   fi
>

I think I put this in. The reason is that the docbook generation  
sometimes (*) creates lots of sections under developer-guidelines/,  
rather than putting the *.html in the current directory. This is just  
to move it up a level.

* IIRC, this is on the sourceforge server where I have a script to  
checkout the latest CVS code and run docbook before publishing on  
http://nagiosplug.sourceforge.net/developer-guidelines.html.

The better fix is to tell docbook not to do that, but I couldn't work  
out how.

> [[ is BASH syntax. Since it's getting run by /bin/sh, and on my system
> (latest Ubuntu) /bin/sh is the BSD SHell, [[ return an error. I don't
> see any reason to use [[ instead of [. The other weird thing there  
> is the:
>
>     rm -f developer-guidelines
>
> Since developer-guidelines is supposed to be a directory it doesn't
> remove it and print an error instead. I'm not sure if other UNIX
> implementations of rm would remove it, but since /bin/sh needs to  
> be GNU
> BASH it would be odd that the rest even runs on a non-GNU system :/
>
> Should I fix that code or remove it? On my system it's creating the  
> html
> file in the same directory; I'm wondering if it's different on other
> systems...

Shell compatible [ is fine. Yes, fixing the rm would be good too.

Ton

http://www.altinity.com
T: +44 (0)870 787 9243
F: +44 (0)845 280 1725
Skype: tonvoon






More information about the Devel mailing list