Bug 1438

Summary: Scripts check availability of commands with which, but does not redirect failed tries which is confusing
Product: [Build System, Metadata & Runtime] Meta-yocto Reporter: Andreas Nilsson <andrnils>
Component: meta-yoctoAssignee: Richard Purdie <richard.purdie>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: poky.bs.watcher, poky.watcher, sgw
Version: unspecified   
Target Milestone: 1.1   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---
Attachments:
Description Flags
Redirect failed output from which. none

Description Andreas Nilsson 2011-09-01 13:52:50 UTC
Created attachment 222 [details]
Redirect failed output from which.

For example ifconfig is  being searched for with which:

IFCONFIG=`which ifconfig`
if [ -z "$IFCONFIG" ]; then
        # Is it ever anywhere else?
        IFCONFIG=/sbin/ifconfig
fi

so the output

which: no ifconfig in ${PATH}

is very confusing as it is found correctly by the next lines.

The attached patch adds a 2>/dev/null to the which invocations. It does not however do any error checking, which probably should be done.