#!/bin/bash

# This script is used to generate uwb conuntry configuration file,
# and the PRODUCT_COPY_FILES list in uwb_calibration_country.mk based on uwb_country.conf
# Bug: 196073172, 233619860

count=1

LOCAL_PATH=device/google/felix/uwb

echo "# Copyright (C) 2023 The Android Open-Source Project"
echo "#"
echo "# Licensed under the Apache License, Version 2.0 (the \"License\");"
echo "# you may not use this file except in compliance with the License."
echo "# You may obtain a copy of the License at"
echo "#"
echo "#      http://www.apache.org/licenses/LICENSE-2.0"
echo "#"
echo "# Unless required by applicable law or agreed to in writing, software"
echo "# distributed under the License is distributed on an \"AS IS\" BASIS,"
echo "# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied."
echo "# See the License for the specific language governing permissions and"
echo "# limitations under the License."
echo ""
echo "# This file was autogenerated by country_conf_gen.sh"
echo ""
echo "ifneq (\$(LOCAL_PATH),$LOCAL_PATH)"
echo "  \$(error LOCAL_PATH in country_conf_gen.sh needs to be updated, and uwb_calibration_country.mk regenerated)"
echo "endif"
echo "diffs := \$(shell diff \$(LOCAL_PATH)/uwb_calibration_country.mk <($LOCAL_PATH/country_conf_gen.sh))"
echo "ifneq (\$(diffs),)"
echo "  \$(error $LOCAL_PATH/uwb_calibration_country.mk is not up to date, please run $LOCAL_PATH/country_conf_gen.sh > $LOCAL_PATH/uwb_calibration_country.mk)"
echo "endif"
echo ""
echo "PRODUCT_COPY_FILES += \\"
while read line ; do
    if [[ "$line" =~ ^"*" ]]; then
        header=${line:1}
    elif [[ "$line" =~ ^"\"" ]]; then
        #line=$(echo ${line/,} | tr -d "\"")
        country[count]=$(echo $line | cut -d ':' -f1 | tr -d "\"")
        code[count]=$(echo $line | cut -d ':' -f2 | tr -d "\"" | tr -d " ")
            if [ "$header" = "FCC" ]; then
                echo "    \$(LOCAL_PATH)/UWB-calibration-fcc.conf:\$(TARGET_COPY_OUT_VENDOR)/etc/uwb/UWB-calibration-${code[$count]}.conf \\"
            elif [ "$header" = "CE" ]; then
                echo "    \$(LOCAL_PATH)/UWB-calibration-ce.conf:\$(TARGET_COPY_OUT_VENDOR)/etc/uwb/UWB-calibration-${code[$count]}.conf \\"
            elif [ "$header" = "JP" ]; then
                echo "    \$(LOCAL_PATH)/UWB-calibration-jp.conf:\$(TARGET_COPY_OUT_VENDOR)/etc/uwb/UWB-calibration-${code[$count]}.conf \\"
            elif [ "$header" = "TW" ]; then
                echo "    \$(LOCAL_PATH)/UWB-calibration-tw.conf:\$(TARGET_COPY_OUT_VENDOR)/etc/uwb/UWB-calibration-${code[$count]}.conf \\"
            elif [ "$header" = "Restricted" ]; then
                echo "    \$(LOCAL_PATH)/UWB-calibration-restricted.conf:\$(TARGET_COPY_OUT_VENDOR)/etc/uwb/UWB-calibration-${code[$count]}.conf \\"
            fi
    fi
((count++))
done < $LOCAL_PATH/uwb_country.conf
