Commit 46ece655 authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Updated update_license script

parent cefde14a
Loading
Loading
Loading
Loading
+20 −13
Original line number Diff line number Diff line
#!/bin/bash
# Copyright 2022-2024 ETSI SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/)
# Copyright 2022-2025 ETSI SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -27,14 +27,14 @@ FILE_PATH_SKIPPED = 'out-skipped.txt'
FILE_PATH_NO_HEADER  = 'out-no-header.txt'
FILE_PATH_UPDATED    = 'out-updated.txt'

STR_NEW_COPYRIGHT = 'Copyright 2022-2024 ETSI SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/)'
STR_NEW_COPYRIGHT = 'Copyright 2022-2025 ETSI SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/)'

RE_OLD_COPYRIGHTS = [
    r'Copyright\ 2021\-2023\ H2020\ TeraFlow\ \(https\:\/\/www\.teraflow\-h2020\.eu\/\)',
    r'Copyright\ 2022\-2023\ ETSI\ TeraFlowSDN\ \-\ TFS\ OSG\ \(https\:\/\/tfs\.etsi\.org\/\)',
    r'Copyright\ 2022\-2024\ ETSI\ TeraFlowSDN\ \-\ TFS\ OSG\ \(https\:\/\/tfs\.etsi\.org\/\)',
    r'Copyright\ 2022\-2024\ ETSI\ TeraFlowSDN\ \-\ TFS\ OSG\/SDG\ \(https\:\/\/tfs\.etsi\.org\/\)',
    r'Copyright\ 2022\-2024\ ETSI\ OSG\/SDG\ TeraFlowSDN\ \(TFS\)\ \(https\:\/\/tfs\.etsi\.org\/\)',
    r'Copyright\ 2021\-202[0-9]\ H2020\ TeraFlow\ \(https\:\/\/www\.teraflow\-h2020\.eu\/\)',
    r'Copyright\ 2022\-202[0-9]\ ETSI\ TeraFlowSDN\ \-\ TFS\ OSG\ \(https\:\/\/tfs\.etsi\.org\/\)',
    r'Copyright\ 2022\-202[0-9]\ ETSI\ TeraFlowSDN\ \-\ TFS\ OSG\/SDG\ \(https\:\/\/tfs\.etsi\.org\/\)',
    r'Copyright\ 2022\-202[0-9]\ ETSI\ OSG\/SDG\ TeraFlowSDN\ \(TFS\)\ \(https\:\/\/tfs\.etsi\.org\/\)',
    r'Copyright\ 2022\-202[0-4]\ ETSI\ SDG\ TeraFlowSDN\ \(TFS\)\ \(https\:\/\/tfs\.etsi\.org\/\)',
]
RE_OLD_COPYRIGHTS = [
    (re.compile(r'.*{}.*'.format(re_old_copyright)), re.compile(re_old_copyright))
@@ -57,8 +57,6 @@ def skip_file(file_path : str) -> bool:
    if file_path.endswith('.jar'): return True
    if file_path.endswith('.onnx'): return True
    if file_path.endswith('/tstat'): return True
    if file_path.endswith('/.gitignore'): return True
    if file_path.endswith('/.gitkeep'): return True
    if file_path.endswith('/coverage/.coverage'): return True
    if file_path.endswith('/grpc/grpcurl/grpcurl'): return True
    if file_path.endswith('/probe/probe-tfs/target/x86_64-unknown-linux-musl/release/tfsagent'): return True
@@ -70,6 +68,7 @@ def skip_file(file_path : str) -> bool:
    if '/hackfest/netconf-oc/openconfig/' in file_path: return True
    if '/hackfest/tapi/server/tapi_server/' in file_path: return True
    if '/hackfest/kafka/kafka_2.13-2.8.0/' in file_path: return True
    if '/hackfest5/clab-hackfest5/' in file_path: return True
    if '/.git/' in file_path: return True
    if '/.vscode/' in file_path: return True
    if '/.pytest_cache/' in file_path: return True
@@ -81,16 +80,24 @@ def skip_file(file_path : str) -> bool:
        file_name = file_path_parts[-1]
        return file_name in {'LICENSE', 'VERSION'}
    if '/device/service/drivers/gnmi_openconfig/git/' in file_path: return True
    if '/device/service/drivers/gnmi_openconfig/gnmi/gnmi' in file_path: return True
    if '/device/service/drivers/gnmi_openconfig/gnmi/Acknowledgement.txt' in file_path: return True
    if '/device/service/drivers/openconfig/templates/' in file_path:
        if file_path.endswith('.xml'): return True
        file_path_parts = file_path.split('/')
        file_name = file_path_parts[-1]
        if file_name.startswith('openconfig_') and file_name.endswith('.py'): return True
        return False
    if '/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/' in file_path: return True
    if '/nbi/service/rest_server/nbi_plugins/ietf_network_slice/bindings/' in file_path: return True
    if '/nbi/service/rest_server/nbi_plugins/ietf_l3vpn/yang/' in file_path: return True
    if '/nbi/service/rest_server/nbi_plugins/ietf_network/yang/' in file_path: return True
    if '/device/service/drivers/smartnic/' in file_path:
        if file_path.startswith('openconfig-'): return True
        if file_path.startswith('ietf-'): return True
        if file_path.endswith('references_probes_libraries.txt'): return True
        return False
    if '/nbi/service/ietf_network/bindings/' in file_path: return True
    if '/nbi/service/ietf_network_slice/bindings/' in file_path: return True
    if '/nbi/service/ietf_l3vpn/yang/' in file_path: return True
    if '/nbi/service/ietf_network/yang/' in file_path: return True
    if '/tests/tools/mock_qkd_nodes/yang/' in file_path: return True
    if '/ztp/target/' in file_path: return True
    if '/policy/target/' in file_path: return True
    if '/dlt/gateway/_legacy' in file_path: return True