Bug 1438 - Scripts check availability of commands with which, but does not redirect failed tries which is confusing
Summary: Scripts check availability of commands with which, but does not redirect fail...
Status: RESOLVED FIXED
Alias: None
Product: Meta-yocto
Classification: Build System, Metadata & Runtime
Component: meta-yocto (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Medium normal
Target Milestone: 1.1
Assignee: Richard Purdie
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2011-09-01 13:52 UTC by Andreas Nilsson
Modified: 2011-09-02 06:22 UTC (History)
3 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: ---


Attachments
Redirect failed output from which. (4.73 KB, patch)
2011-09-01 13:52 UTC, Andreas Nilsson
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.