diff --git a/sort-blobs-list.sh b/sort-blobs-list.sh new file mode 100755 index 0000000..f5b6529 --- /dev/null +++ b/sort-blobs-list.sh @@ -0,0 +1,28 @@ +#!/bin/bash +# +# SPDX-FileCopyrightText: 2024 The LineageOS Project +# SPDX-License-Identifier: Apache-2.0 +# + +set -e + +# List of files to sort +PROPRIETARY_FILES_TXT=( + "proprietary-files.txt" +) + +# Load sort-blobs-list.py and do some sanity checks +MY_DIR="${BASH_SOURCE%/*}" +if [[ ! -d "${MY_DIR}" ]]; then MY_DIR="${PWD}"; fi + +ANDROID_ROOT="${MY_DIR}/../../.." + +HELPER="${ANDROID_ROOT}/tools/extract-utils/sort-blobs-list.py" +if [ ! -f "${HELPER}" ]; then + echo "Unable to find helper script at ${HELPER}" + exit 1 +fi + +# Call the helper to sort the list +# Add --dir-first to give priority to directories and subdirectories +"${HELPER}" --dir-first "${PROPRIETARY_FILES_TXT[@]}"