Fix bug caused by set -e
Empty results cause grep/egrep to return a non-zero status. Bug: 145347092 Bug: 141258651 Bug: 69058154 Bug: 143285996 Test: manual run for notice files Change-Id: I25d54ae307b97a07a98e99c54f283437718fe657
This commit is contained in:
@@ -377,7 +377,9 @@ while [ $(wc -l < "${newDeps}") -gt 0 ]; do
|
|||||||
depth=$(expr ${depth} + 1)
|
depth=$(expr ${depth} + 1)
|
||||||
fi
|
fi
|
||||||
( # recalculate dependencies by combining unique inputs of new deps w. old
|
( # recalculate dependencies by combining unique inputs of new deps w. old
|
||||||
|
set +e
|
||||||
sh -c "${filter}" < "${newDeps}" | cut -d\ -f3- | getDeps
|
sh -c "${filter}" < "${newDeps}" | cut -d\ -f3- | getDeps
|
||||||
|
set -e
|
||||||
cat "${oldDeps}"
|
cat "${oldDeps}"
|
||||||
) | sort -u > "${allDeps}"
|
) | sort -u > "${allDeps}"
|
||||||
# recalculate new dependencies as net additions to old dependencies
|
# recalculate new dependencies as net additions to old dependencies
|
||||||
@@ -433,7 +435,9 @@ if [ -n "${projects_out}" ] \
|
|||||||
|| [ -n "${notices_out}" ]
|
|| [ -n "${notices_out}" ]
|
||||||
then
|
then
|
||||||
readonly allProj="${tmpFiles}/projects"
|
readonly allProj="${tmpFiles}/projects"
|
||||||
|
set +e
|
||||||
egrep -v '^out[/]' "${allDirs}" | getProjects > "${allProj}"
|
egrep -v '^out[/]' "${allDirs}" | getProjects > "${allProj}"
|
||||||
|
set -e
|
||||||
if ${showProgress}; then
|
if ${showProgress}; then
|
||||||
echo $(wc -l < "${allProj}")" projects" >&2
|
echo $(wc -l < "${allProj}")" projects" >&2
|
||||||
fi
|
fi
|
||||||
@@ -450,7 +454,9 @@ case "${notices_out}" in
|
|||||||
'') : do nothing;;
|
'') : do nothing;;
|
||||||
*)
|
*)
|
||||||
readonly allNotice="${tmpFiles}/notices"
|
readonly allNotice="${tmpFiles}/notices"
|
||||||
|
set +e
|
||||||
egrep '^1' "${allDeps}" | cut -d\ -f3- | egrep -v '^out/' > "${allNotice}"
|
egrep '^1' "${allDeps}" | cut -d\ -f3- | egrep -v '^out/' > "${allNotice}"
|
||||||
|
set -e
|
||||||
cat "${allProj}" | while read proj; do
|
cat "${allProj}" | while read proj; do
|
||||||
for f in LICENSE LICENCE NOTICE license.txt notice.txt; do
|
for f in LICENSE LICENCE NOTICE license.txt notice.txt; do
|
||||||
if [ -f "${proj}/${f}" ]; then
|
if [ -f "${proj}/${f}" ]; then
|
||||||
|
Reference in New Issue
Block a user