Hello Julien, Julien Cristau [2010-03-14 12:04 +0100]: > > + - Use shell built in "type" instead of external "which" to test for > > + programs. > > There's no guarantee that /bin/sh has a 'type' built-in, as far as I can > tell from SUSv3 and policy). I'd suggest command -v, but apparently > posh doesn't like that either, so I don't know.
Hm, it's present in dash and bash, anyway. But if you like command -V better, I'm fine with that. > > + - 30x11-common_xresources: Swap the order of tests to keep the most > > + unlikely (like "~/.Xresources exists") outside, to avoid running the > > + other tests (like "xrdb exists") on systems which don't use > > Xresources. > > + > > I'm not sure about this one. x11-common installs a file in > /etc/X11/Xresources, so you'll end up looking for xrdb on pretty much > every system regardless. Right, it's a minor case, if someone decides to remove /etc/X11/Xresources/x11-common. But I still think it's a tad less likely to be true than the existence of xrdb. > And then the reordering means you're looking for it twice (granted, > with 'type' the shell can cache the result of the first lookup, but > still). Hm, I don't understand? The second type is only done if [ -f "$USRRESOURCES" ], and ~/.Xresources should exist pretty seldomly these days? Thanks, Martin -- Martin Pitt | http://www.piware.de Ubuntu Developer (www.ubuntu.com) | Debian Developer (www.debian.org)
signature.asc
Description: Digital signature