Merge "Update hiddenapi preupload checks to handle new location" am: ca0501d1b8 am: 0c71f7c0a4

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1668445

Change-Id: I6758e71132e51521c7fa47eb614ae5eebef861f4
This commit is contained in:
Paul Duffin
2021-04-08 22:11:36 +00:00
committed by Automerger Merge Worker
2 changed files with 2 additions and 2 deletions

View File

@@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
set -e set -e
LOCAL_DIR="$( dirname ${BASH_SOURCE} )" LOCAL_DIR="$( dirname ${BASH_SOURCE} )"
git show --name-only --pretty=format: $1 | grep "config/hiddenapi-.*txt" | while read file; do git show --name-only --pretty=format: $1 | grep "boot/hiddenapi/hiddenapi-.*txt" | while read file; do
diff <(git show $1:$file) <(git show $1:$file | $LOCAL_DIR/sort_api.sh ) || { diff <(git show $1:$file) <(git show $1:$file | $LOCAL_DIR/sort_api.sh ) || {
echo -e "\e[1m\e[31m$file $1 is not sorted or contains duplicates. To sort it correctly:\e[0m" echo -e "\e[1m\e[31m$file $1 is not sorted or contains duplicates. To sort it correctly:\e[0m"
echo -e "\e[33m${LOCAL_DIR}/sort_api.sh $2/frameworks/base/$file\e[0m" echo -e "\e[33m${LOCAL_DIR}/sort_api.sh $2/frameworks/base/$file\e[0m"

View File

@@ -48,7 +48,7 @@ SHA=$1
PACKAGES=$(for t in $TEAMS; do echo $(eval echo \${${t}_PACKAGES}); done) PACKAGES=$(for t in $TEAMS; do echo $(eval echo \${${t}_PACKAGES}); done)
RE=$(echo ${PACKAGES} | sed "s/ /|/g") RE=$(echo ${PACKAGES} | sed "s/ /|/g")
EXIT_CODE=0 EXIT_CODE=0
for file in $(git show --name-only --pretty=format: $SHA | grep "config/hiddenapi-.*txt"); do for file in $(git show --name-only --pretty=format: $SHA | grep "boot/hiddenapi/hiddenapi-.*txt"); do
ENTRIES=$(grep -E "^\+L(${RE})/" <(git diff ${SHA}~1 ${SHA} $file) | sed "s|^\+||" || echo) ENTRIES=$(grep -E "^\+L(${RE})/" <(git diff ${SHA}~1 ${SHA} $file) | sed "s|^\+||" || echo)
if [[ -n "${ENTRIES}" ]]; then if [[ -n "${ENTRIES}" ]]; then
echo -e "\e[1m\e[31m$file $SHA contains the following entries\e[0m" echo -e "\e[1m\e[31m$file $SHA contains the following entries\e[0m"