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
This commit is contained in:
committed by
Bruno Martins
parent
ab77884b8e
commit
8e4a039f11
@@ -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
|
||||
|
||||
@@ -21,8 +21,6 @@ set -e
|
||||
DEVICE=*** FILL IN DEVICE ****
|
||||
VENDOR=*** FILL IN VENDOR ****
|
||||
|
||||
INITIAL_COPYRIGHT_YEAR=**** FILL IN COPYRIGHT YEAR ****
|
||||
|
||||
# Load extract_utils and do some sanity checks
|
||||
MY_DIR="${BASH_SOURCE%/*}"
|
||||
if [[ ! -d "$MY_DIR" ]]; then MY_DIR="$PWD"; fi
|
||||
@@ -39,7 +37,7 @@ fi
|
||||
# Initialize the helper
|
||||
setup_vendor "$DEVICE" "$VENDOR" "$ANDROID_ROOT"
|
||||
|
||||
# Copyright headers and guards
|
||||
# Warning headers and guards
|
||||
write_headers
|
||||
|
||||
write_makefiles "$MY_DIR"/proprietary-files.txt
|
||||
|
||||
Reference in New Issue
Block a user