[aiaiai PATCH v3 10/12] aiaiai: use AI_PATH to specify addition postfix PATH

Artem Bityutskiy dedekind1 at gmail.com
Fri Feb 7 02:59:05 PST 2014

On Fri, 2014-02-07 at 12:36 +0200, Artem Bityutskiy wrote:
> From: Jacob Keller <jacob.e.keller at intel.com>
> This patch adds the use of $AI_PATH in order to enable adding postfix
> path information to where programs will be located. This can be useful
> if you need to enable extra portions of path, or move some things to
> different search order in your PATH. I use it to add the correct
> binaries for the smatch program.
> Signed-off-by: Jacob Keller <jacob.e.keller at intel.com>

Do I understand the problem this patch solves correctly: want to run one
of the Aiaiai scripts with PATH which is different to your system PATH.
But you do not want to change your system PATH.

For example, you do not want to add smatch to your system path, but want
it to be in PATH of Aiaiai scripts.

Is this right?

Why can't you just do

PATH=/path/to/smatch aiaiai-email-test-patchset

(or any other aiaiai script) ? 

This will not modify PATH of the caller, but aiaiai and all its children
will see the modified path.

Just to demonstrate.

$ VAR=/home
$ # Just print VAR from a sub-shell and a sub-sub-shell
$ sh -c 'echo script: $VAR; dash -c "echo inner script: $VAR"'
script: /home
inner script: /home
$ # Now run the sub-shell with modified VAR
$ VAR=/smatch:$VAR sh -c 'echo script: $VAR; dash -c "echo inner script: $VAR"'
script: /smatch:/home
inner script: /smatch:/home

You can use PATH instead of var.

Would this work for you? To me it looks better than a special "AI_PATH"
environment variable.

Best Regards,
Artem Bityutskiy

More information about the aiaiai mailing list