diff options
author | 2025-03-23 21:04:49 -0700 | |
---|---|---|
committer | 2025-03-23 21:04:49 -0700 | |
commit | d298ef2241159e0dc8fdbd421ac9c3f999381e8b (patch) | |
tree | 3bc9cdd317fb61561ef9f388e754bf5cbbbe50c6 /scripts | |
parent | 716fc3438bce5e2018b47cf906195b4f9aecea5c (diff) | |
parent | 95f1b12c713c8a6ca10204bc2e9bb6a458d7eee9 (diff) |
Merge "Remove host script(list_image)" into main am: 95f1b12c71
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3545643
Change-Id: I3c05e2c386e572664ec69d63862d3762a1b12205
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/Android.bp | 5 | ||||
-rwxr-xr-x | scripts/list_image.sh | 51 |
2 files changed, 0 insertions, 56 deletions
diff --git a/scripts/Android.bp b/scripts/Android.bp index c0e13d52f..b6cac32f3 100644 --- a/scripts/Android.bp +++ b/scripts/Android.bp @@ -254,11 +254,6 @@ python_binary_host { ], } -sh_binary_host { - name: "list_image", - src: "list_image.sh", -} - filegroup { name: "rustfmt.toml", srcs: ["rustfmt.toml"], diff --git a/scripts/list_image.sh b/scripts/list_image.sh deleted file mode 100755 index 0542fa610..000000000 --- a/scripts/list_image.sh +++ /dev/null @@ -1,51 +0,0 @@ -#! /bin/bash - -# Recursively list Android image directory. -set -eu -set -o pipefail - -function die() { format=$1; shift; printf "$format\n" "$@"; exit 1; } - -# Figure out the filer utility. -declare filer= -[[ -z "${ANDROID_HOST_OUT:-}" ]] || filer=${ANDROID_HOST_OUT}/bin/debugfs_static -if [[ "${1:-}" =~ --debugfs_path=(.*) ]]; then - filer=${BASH_REMATCH[1]} - shift -fi -if [[ -z "${filer:-}" ]]; then - maybefiler="$(dirname $0)/debugfs_static" - [[ ! -x "$maybefiler" ]] || filer="$maybefiler" -fi - -(( $# >0 )) || die "%s [--debugfs_path=<path>] IMAGE" "$0" - -[[ -n "${filer:-}" ]] || die "cannot locate 'debugfs' executable: \ ---debugfs_path= is missing, ANDROID_HOST_OUT is not set, \ -and 'debugfs_static' is not colocated with this script" -declare -r image="$1" - -function dolevel() { - printf "%s/\n" "$1" - # Each line of the file output consists of 6 fields separated with '/'. - # The second one contains the file's attributes, and the fifth its name. - $filer -R "ls -l -p $1" "$image" 2>/dev/null |\ - sed -nr 's|^/.*/(.*)/.*/.*/(.+)/.*/$|\2 \1|p' | LANG=C sort | \ - while read name attr; do - [[ "$name" != '.' && "$name" != '..' ]] || continue - path="$1/$name" - # If the second char of the attributes is '4', it is a directory. - if [[ $attr =~ ^.4 ]]; then - dolevel "$path" - else - printf "%s\n" "$path" - fi - done -} - -# The filer always prints its version on stderr, so we are going -# to redirect it to the bit bucket. On the other hand, the filer's -# return code on error is still 0. Let's run it once to without -# redirecting stderr to see that there is at least one entry. -$filer -R "ls -l -p" "$image" | grep -q -m1 -P '^/.*/.*/.*/.*/.+/.*/$' -dolevel . |