diff options
author | Michael Bestas <mkbestas@lineageos.org> | 2020-12-19 03:50:32 +0200 |
---|---|---|
committer | Bruno Martins <bgcngm@gmail.com> | 2020-12-28 10:14:46 +0000 |
commit | 8e4a039f119e721b919c6cfbf937fce4aaa7b1ed (patch) | |
tree | df140b1ba0a88fae9dc5e3f946131a187c03355d /extract_utils.sh | |
parent | ab77884b8ee81b765726b152a51a81fb0569cfaf (diff) |
Remove copyright headers from automatically generated files
It doesn't make sense to place a copyright header in
automatically generated makefiles, plus this is a grey
area since we are extracting proprietary OEM files.
Let's be safe and replace the Apache 2.0 header with
a warning regarding manual modification of the makefiles.
Change-Id: I7cafd3f0def33efff96af60280646c44c1ba9a53
Diffstat (limited to 'extract_utils.sh')
-rw-r--r-- | extract_utils.sh | 75 |
1 files changed, 6 insertions, 69 deletions
diff --git a/extract_utils.sh b/extract_utils.sh index 2924ddd..26f1ea5 100644 --- a/extract_utils.sh +++ b/extract_utils.sh @@ -920,7 +920,7 @@ function write_product_packages() { # # $1: file which will be written to # -# writes out the copyright header with the current year. +# writes out the warning message regarding manual file modifications. # note that this is not an append operation, and should # be executed first! # @@ -929,42 +929,12 @@ function write_blueprint_header() { rm $1 fi - YEAR=$(date +"%Y") - [ "$COMMON" -eq 1 ] && local DEVICE="$DEVICE_COMMON" - printf "/**\n" > $1 - NUM_REGEX='^[0-9]+$' - if [[ ! $INITIAL_COPYRIGHT_YEAR =~ $NUM_REGEX ]] || [ $INITIAL_COPYRIGHT_YEAR -lt 2019 ]; then - BLUEPRINT_INITIAL_COPYRIGHT_YEAR=2019 - else - BLUEPRINT_INITIAL_COPYRIGHT_YEAR=$INITIAL_COPYRIGHT_YEAR - fi - - if [ $BLUEPRINT_INITIAL_COPYRIGHT_YEAR -eq $YEAR ]; then - printf " * Copyright (C) $YEAR The LineageOS Project\n" >> $1 - elif [ $BLUEPRINT_INITIAL_COPYRIGHT_YEAR -le 2019 ]; then - printf " * Copyright (C) 2019-$YEAR The LineageOS Project\n" >> $1 - else - printf " * Copyright (C) $BLUEPRINT_INITIAL_COPYRIGHT_YEAR-$YEAR The LineageOS Project\n" >> $1 - fi - cat << EOF >> $1 - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is generated by device/$VENDOR/$DEVICE/setup-makefiles.sh - */ +// Automatically generated file. DO NOT MODIFY +// +// This file is generated by device/$VENDOR/$DEVICE/setup-makefiles.sh EOF } @@ -974,7 +944,7 @@ EOF # # $1: file which will be written to # -# writes out the copyright header with the current year. +# writes out the warning message regarding manual file modifications. # note that this is not an append operation, and should # be executed first! # @@ -983,44 +953,11 @@ function write_makefile_header() { rm $1 fi - YEAR=$(date +"%Y") - [ "$COMMON" -eq 1 ] && local DEVICE="$DEVICE_COMMON" - NUM_REGEX='^[0-9]+$' - if [[ $INITIAL_COPYRIGHT_YEAR =~ $NUM_REGEX ]] && [ $INITIAL_COPYRIGHT_YEAR -le $YEAR ]; then - if [ $INITIAL_COPYRIGHT_YEAR -lt 2016 ]; then - printf "# Copyright (C) $INITIAL_COPYRIGHT_YEAR-2016 The CyanogenMod Project\n" > $1 - elif [ $INITIAL_COPYRIGHT_YEAR -eq 2016 ]; then - printf "# Copyright (C) 2016 The CyanogenMod Project\n" > $1 - fi - if [ $YEAR -eq 2017 ]; then - printf "# Copyright (C) 2017 The LineageOS Project\n" >> $1 - elif [ $INITIAL_COPYRIGHT_YEAR -eq $YEAR ]; then - printf "# Copyright (C) $YEAR The LineageOS Project\n" >> $1 - elif [ $INITIAL_COPYRIGHT_YEAR -le 2017 ]; then - printf "# Copyright (C) 2017-$YEAR The LineageOS Project\n" >> $1 - else - printf "# Copyright (C) $INITIAL_COPYRIGHT_YEAR-$YEAR The LineageOS Project\n" >> $1 - fi - else - printf "# Copyright (C) $YEAR The LineageOS Project\n" > $1 - fi - cat << EOF >> $1 +# Automatically generated file. DO NOT MODIFY # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - # This file is generated by device/$VENDOR/$DEVICE/setup-makefiles.sh EOF |