Skip to content

Commit

Permalink
scripts/manifest_from_host.sh: write errors to stderr
Browse files Browse the repository at this point in the history
manifest_from_host.sh currently writes error messages (e.g., that the
"lddtree" command is not installed) to the stdout. But users of this
script - like our Lua makefile - redirect this output, so the user
doesn't see this error. Let's move these errors to stderr, so they will
be visible instead of having "scripts/build" silently fail.

Signed-off-by: Nadav Har'El <[email protected]>
Message-Id: <[email protected]>
  • Loading branch information
nyh authored and wkozaczuk committed Sep 28, 2019
1 parent 3e658b8 commit f0344a9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions scripts/manifest_from_host.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ find_library()
local count=$(ldconfig -p | grep -P "$pattern" | grep 'x86-64' | wc -l)

if [[ $count == 0 ]]; then
echo "Could not find any so file matching $pattern"
echo "Could not find any so file matching $pattern" >&2
return -1
elif [[ $count > 1 ]]; then
echo 'Found more than one alternative:'
echo 'Found more than one alternative:' >&2
ldconfig -p | grep -P "$pattern"
return -1
else
Expand Down Expand Up @@ -115,7 +115,7 @@ shift $((OPTIND - 1))

LDDTREE_INSTALLED=$(command -v lddtree)
if [ -z "$LDDTREE_INSTALLED" ]; then
echo "Please install lddtree which is part of pax-utils package"
echo "Please install lddtree which is part of pax-utils package" >&2
exit 1
fi

Expand Down Expand Up @@ -161,7 +161,7 @@ if [[ -f $NAME_OR_PATH ]]; then
REAL_PATH=$(realpath $NAME_OR_PATH)
output_manifest "$REAL_PATH"
else
echo "The $NAME_OR_PATH is not ELF"
echo "The $NAME_OR_PATH is not ELF" >&2
exit 1
fi
else
Expand All @@ -181,7 +181,7 @@ else
FULL_PATH=$(realpath $APP_PATH)
detect_elf $FULL_PATH
if [[ $FILE_TYPE == "NON_ELF" ]]; then
echo "The file $FULL_PATH is not an ELF"
echo "The file $FULL_PATH is not an ELF" >&2
exit 1
else
echo "# $LONG_NAME" | tee $OUTPUT
Expand All @@ -192,7 +192,7 @@ else
fi
fi
else
echo "Failed to find '$NAME_OR_PATH'!"
echo "Failed to find '$NAME_OR_PATH'!" >&2
exit 1
fi
fi
Expand Down

0 comments on commit f0344a9

Please sign in to comment.