From 9b8abc1fcf5978caa12bfbeffbee3e01baab913d Mon Sep 17 00:00:00 2001 From: Michael Bestas Date: Tue, 27 Aug 2024 22:51:30 +0300 Subject: [PATCH] kane: Sync extract scripts with templates Change-Id: I98a36854c5a0c0390592911bb2558b34eff77efc --- extract-files.sh | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/extract-files.sh b/extract-files.sh index 86b3ec1..1991a2f 100755 --- a/extract-files.sh +++ b/extract-files.sh @@ -1,23 +1,34 @@ #!/bin/bash # -# Copyright (C) 2016 The CyanogenMod Project -# Copyright (C) 2017-2020 The LineageOS Project +# SPDX-FileCopyrightText: 2016 The CyanogenMod Project +# SPDX-FileCopyrightText: 2017-2024 The LineageOS Project # # SPDX-License-Identifier: Apache-2.0 # function blob_fixup() { case "${1}" in - # Missing libutils symbols - vendor/lib*/sensors.chub.so|vendor/lib*/hw/sensors.kane_sprout.so) - "${PATCHELF}" --replace-needed "libutils.so" "libutils-v32.so" "${2}" - ;; - # Remove libhidltransport/libhwbinder dependencies - vendor/lib*/libril_sitril.so) - "${PATCHELF}" --remove-needed "libhidltransport.so" "${2}" - "${PATCHELF}" --remove-needed "libhwbinder.so" "${2}" - ;; + # Missing libutils symbols + vendor/lib*/sensors.chub.so|vendor/lib*/hw/sensors.kane_sprout.so) + [ "$2" = "" ] && return 0 + "${PATCHELF}" --replace-needed "libutils.so" "libutils-v32.so" "${2}" + ;; + # Remove libhidltransport/libhwbinder dependencies + vendor/lib*/libril_sitril.so) + [ "$2" = "" ] && return 0 + "${PATCHELF}" --remove-needed "libhidltransport.so" "${2}" + "${PATCHELF}" --remove-needed "libhwbinder.so" "${2}" + ;; + *) + return 1 + ;; esac + + return 0 +} + +function blob_fixup_dry() { + blob_fixup "$1" "" } # If we're being sourced by the common script that we called, -- 2.20.1