From 11972fd43164415c60a98dd3c0a351decc5a6196 Mon Sep 17 00:00:00 2001 From: Paul Duffin Date: Wed, 14 Apr 2021 14:09:04 +0100 Subject: Generalize tools/hiddenapi/checksorted_sha.sh Stops it being specific to frameworks/base. This change works because $2 is $(REPO_ROOT) and $(REPO_ROOT)/frameworks/base is the same as $PWD when this script is used in the frameworks/base repo. Also removes boot/ from the path that identifies hidden API flag files. This keeps the directory structure needed in the repositories into which hidden API flag files will be moved simple by removing the need to have a boot/ directory. The hiddenapi/ directory is required as the files need their own separate OWNERS file. A follow up change will move this file into tools/platform-compat to allow it to be used by other repos. Bug: 177892522 Test: try and upload changes to hiddenapi flag files Change-Id: Ifb3690e7c596249fda84eff82f5a53f0b1b6f991 --- tools/hiddenapi/checksorted_sha.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/hiddenapi/checksorted_sha.sh b/tools/hiddenapi/checksorted_sha.sh index 451fed6be353..72fb86737488 100755 --- a/tools/hiddenapi/checksorted_sha.sh +++ b/tools/hiddenapi/checksorted_sha.sh @@ -1,10 +1,10 @@ #!/bin/bash set -e LOCAL_DIR="$( dirname ${BASH_SOURCE} )" -git show --name-only --pretty=format: $1 | grep "boot/hiddenapi/hiddenapi-.*txt" | while read file; do +git show --name-only --pretty=format: $1 | grep "hiddenapi/hiddenapi-.*txt" | while read file; do 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[33m${LOCAL_DIR}/sort_api.sh $2/frameworks/base/$file\e[0m" + echo -e "\e[33m${LOCAL_DIR}/sort_api.sh $PWD/$file\e[0m" exit 1 } done -- cgit v1.2.3-59-g8ed1b