[Cook] Cook find-command fails if a directory in the path is not readable

Susanne Oberhauser froh at SuSE.de
Wed Jun 15 18:11:25 EST 2005


Maybe I stated my question too complicated.

is find_command supposed to fail (return "") if a component in $PATH
is not accessible?

The $SHELL will skip inaccessible path components as if they were not
present, while cook find_command will fail.

The find_command documentation doesn't say anything about corner
cases:

       8.23  find_command

       This  function  requires  at  least  one argument, being the
       names of commands to search for  in  $PATH.   The  resulting
       word  list  contains  either "" (false) or a fully qualified
       path name for each command given.

       8.23.1  Example
       Some systems require ranlib(1) to be run  on  archives,  and
       some do not.  Here is a simple way to test:
            ranlib = [find_command ranlib];

            %.a: [%_obj]
                    set unlink
            {
                    ar qc [target] [%_obj];
                    if [ranlib] then
                            [ranlib] [target];
            }

Any hints appreciated


Susanne

-- 
Susanne Oberhauser           +49-911-74053-574     SUSE LINUX GmbH
Novell Developer Services   developer.novell.com   Maxfeldstraße 5
Linux Engineering               www.suse.de        90409 Nürnberg



More information about the Cook-users mailing list