generic/setup.sh: Make env hooks POSIX-compliant.

Unfortunately, when calling the list (or better: the space-separated
string of strings) of env hooks we'll separate by IFS as well, so env
hooks containing a space in the name won't work properly.

As we do not have any env hooks that have a space in their name, I think
this is not a problem.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Replace all bashisms involving envHooks+=(...).

Use the newly introduced addEnvHooks and addCrossEnvHooks functions in
the generic builder, which are not bash-specific anymore.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
generic/setup.sh: Remove bashisms in runHook().

The use of "type -t" isn't POSIX-compliant and -t will be passed as a
name to the type builtin. We now also allow to run several hooks in turn
if more than one hook is passed.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
generic/setup.sh: Replace \033 with real ESC char.

It's a non-printable character and probably will lead to a lot of
weirdnes if the file is shown by cat, but there is no better way to get
rid of the "echo -e" bashism without involving a lot of workarounds that
will also slow down execution.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
generic/setup.sh: Don't do assigments with export.

Another bashism, which fortunately is quite easy to fix.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>