On Jan 16, 2015, at 01:16, Jeff King wrote:

Subject: [PATCH] t/lib-httpd: switch SANITY check for NOT_ROOT
[...]
We implement NOT_ROOT by checking `id -u`, which is in POSIX
and seems to be available even on MSYS.  Note that we cannot
just call this "ROOT" and ask for "!ROOT". The possible
outcomes are:

 1. we know we are root

 2. we know we are not root

 3. we could not tell, because `id` was not available

We should conservatively treat (3) as "does not have the
prerequisite", which means that a naive negation would not
work.
[...]
+
+test_lazy_prereq NOT_ROOT '
+       uid=$(id -u) &&
+       test "$uid" != 0
+'

That looks good to me and worked as expected when I tried it.

-Kyle

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to