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
diff --git a/scripts/transitive-deps.sh b/scripts/transitive-deps.sh
index 34e2ecf..23121c6 100755
--- a/scripts/transitive-deps.sh
+++ b/scripts/transitive-deps.sh
@@ -377,7 +377,9 @@
         depth=$(expr ${depth} + 1)
     fi
     ( # recalculate dependencies by combining unique inputs of new deps w. old
+        set +e
         sh -c "${filter}" < "${newDeps}" | cut -d\  -f3- | getDeps
+        set -e
         cat "${oldDeps}"
     ) | sort -u > "${allDeps}"
     # recalculate new dependencies as net additions to old dependencies
@@ -433,7 +435,9 @@
   || [ -n "${notices_out}" ]
 then
     readonly allProj="${tmpFiles}/projects"
+    set +e
     egrep -v '^out[/]' "${allDirs}" | getProjects > "${allProj}"
+    set -e
     if ${showProgress}; then
         echo $(wc -l < "${allProj}")" projects" >&2
     fi
@@ -450,7 +454,9 @@
   '')        : do nothing;;
   *)
     readonly allNotice="${tmpFiles}/notices"
+    set +e
     egrep '^1' "${allDeps}" | cut -d\  -f3- | egrep -v '^out/' > "${allNotice}"
+    set -e
     cat "${allProj}" | while read proj; do
         for f in LICENSE LICENCE NOTICE license.txt notice.txt; do
             if [ -f "${proj}/${f}" ]; then