diff --git a/scripts/update_license_headers.py b/scripts/update_license_headers.py index 3332a13d26212738fbdc36b18b58b38e445faee3..ae4dad716842dec309786d9bed81483a4e6cdcc2 100644 --- a/scripts/update_license_headers.py +++ b/scripts/update_license_headers.py @@ -1,5 +1,5 @@ #!/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