sabrina: Sync extract scripts with templates
authorMichael Bestas <mkbestas@lineageos.org>
Tue, 27 Aug 2024 19:51:30 +0000 (22:51 +0300)
committerNolen Johnson <johnsonnolen@gmail.com>
Thu, 5 Sep 2024 05:21:10 +0000 (01:21 -0400)
Change-Id: I98a36854c5a0c0390592911bb2558b34eff77efc

extract-files.sh
setup-makefiles.sh

index 7a04680bc170fb795e1d5a93ec23c143bb1badbb..859e9240d19df4ec4b3c644022660b5dd8533b4c 100755 (executable)
@@ -1,7 +1,7 @@
 #!/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
 #
@@ -10,9 +10,19 @@ function blob_fixup() {
     case "${1}" in
         # Use generic Light HAL context for led_control_service
         vendor/etc/init/led_control_service.rc)
+            [ "$2" = "" ] && return 0
             sed -i "8d" "${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,
index d542dbe81a7e8a8d8e8b648289b1c7d94593182d..55d7d659912dc521cf2e768dfb1fa1408c8ae462 100755 (executable)
@@ -1,11 +1,17 @@
 #!/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
 #
 
+# If we're being sourced by the common script that we called,
+# stop right here. No need to go down the rabbit hole.
+if [ "${BASH_SOURCE[0]}" != "${0}" ]; then
+    return
+fi
+
 set -e
 
 export DEVICE=sabrina