Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6be0fdde authored by Mathew Inwood's avatar Mathew Inwood
Browse files

Don't fail if there are no comments.

Grep exits with non-zero if it find no matches. But it doesn't matter in
this case, so just carry on.

Test: frameworks/base/tools/hiddenapi/sort_api.sh \
Test:    frameworks/base/config/hiddenapi-light-greylist.txt
Change-Id: I7c219ee617f7dfa3cff5232ab979cc4ba38ebbfd
parent 53f6d1b0
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -12,8 +12,8 @@ readarray A < "$source_list"
# Sort
# Sort
IFS=$'\n'
IFS=$'\n'
# Stash away comments
# Stash away comments
C=( $(grep -E '^#' <<< "${A[*]}") )
C=( $(grep -E '^#' <<< "${A[*]}" || :) )
A=( $(grep -v -E '^#' <<< "${A[*]}") )
A=( $(grep -v -E '^#' <<< "${A[*]}" || :) )
# Sort entries
# Sort entries
A=( $(LC_COLLATE=C sort -f <<< "${A[*]}") )
A=( $(LC_COLLATE=C sort -f <<< "${A[*]}") )
A=( $(uniq <<< "${A[*]}") )
A=( $(uniq <<< "${A[*]}") )