diff --git a/tools/deps_guard/deps_guard.py b/tools/deps_guard/deps_guard.py index 74f8dd118b1d191d1df3f0c10b954d189d015dd4..fbd7e023394982ea40b9d713d0ed19bb376bb05f 100755 --- a/tools/deps_guard/deps_guard.py +++ b/tools/deps_guard/deps_guard.py @@ -1,6 +1,21 @@ -#! /usr/bin/env python +#!/usr/bin/env python #coding=utf-8 +# +# Copyright (c) 2022 Huawei Device Co., Ltd. +# 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. +# + from elf_file_mgr import ElfFileMgr def __createArgParser(): diff --git a/tools/deps_guard/elf_file_mgr/__init__.py b/tools/deps_guard/elf_file_mgr/__init__.py index fcb0354315e85cd841ec675707be4680b0972338..2e5ffc59155ccf4fdef80a5ae1d278492cbb4b79 100755 --- a/tools/deps_guard/elf_file_mgr/__init__.py +++ b/tools/deps_guard/elf_file_mgr/__init__.py @@ -1,6 +1,21 @@ -#! /usr/bin/env python +#!/usr/bin/env python #coding=utf-8 +# +# Copyright (c) 2023 Huawei Device Co., Ltd. +# 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. +# + from .elf_walker import ELFWalker from .elf_file_mgr import ElfFileMgr diff --git a/tools/deps_guard/elf_file_mgr/elf_file.py b/tools/deps_guard/elf_file_mgr/elf_file.py index 1fc9a1daffd2f06ae0809887d38753af83b40175..be0d90e63e4b13f2fe7ab5f7088ce2258589f217 100755 --- a/tools/deps_guard/elf_file_mgr/elf_file.py +++ b/tools/deps_guard/elf_file_mgr/elf_file.py @@ -1,6 +1,21 @@ -#! /usr/bin/env python +#!/usr/bin/env python #coding=utf-8 +# +# Copyright (c) 2022 Huawei Device Co., Ltd. +# 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. +# + import os from stat import * diff --git a/tools/deps_guard/elf_file_mgr/elf_file_mgr.py b/tools/deps_guard/elf_file_mgr/elf_file_mgr.py index 87caf5d21c63ec412d20dd5383f1d8d1614a1e56..a1961a919cc183887dd21b9c9c4fbb9b4ab5e7a4 100755 --- a/tools/deps_guard/elf_file_mgr/elf_file_mgr.py +++ b/tools/deps_guard/elf_file_mgr/elf_file_mgr.py @@ -1,6 +1,21 @@ -#! /usr/bin/env python +#!/usr/bin/env python #coding=utf-8 +# +# Copyright (c) 2022 Huawei Device Co., Ltd. +# 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. +# + import string import sys import os diff --git a/tools/deps_guard/elf_file_mgr/elf_walker.py b/tools/deps_guard/elf_file_mgr/elf_walker.py index bf8a7db825ac81704e500091e4f5e0261ec9faf8..a68c44256f5729eeb22acfd04a8de6f852ebf915 100755 --- a/tools/deps_guard/elf_file_mgr/elf_walker.py +++ b/tools/deps_guard/elf_file_mgr/elf_walker.py @@ -1,6 +1,21 @@ -#! /usr/bin/env python +#!/usr/bin/env python #coding=utf-8 +# +# Copyright (c) 2022 Huawei Device Co., Ltd. +# 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. +# + import string import json import sys @@ -61,4 +76,4 @@ if __name__ == '__main__': for f in elfFiles.get_elf_files(): print(f) for src, target in elfFiles.get_link_file_map().items(): - print(src + " -> " + target) + print('{} -> {}'.format(str, target)) diff --git a/tools/deps_guard/elf_file_mgr/hdi/__init__.py b/tools/deps_guard/elf_file_mgr/hdi/__init__.py index 2154b7dfca327ef50d3c2a874d145ec953159510..da63c6501577a4579e3dfc49c92d43561b283dcd 100755 --- a/tools/deps_guard/elf_file_mgr/hdi/__init__.py +++ b/tools/deps_guard/elf_file_mgr/hdi/__init__.py @@ -1,4 +1,19 @@ -#! /usr/bin/env python +#!/usr/bin/env python #coding=utf-8 +# +# Copyright (c) 2023 Huawei Device Co., Ltd. +# 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. +# + from .hdi_parser import HdiParser diff --git a/tools/deps_guard/elf_file_mgr/hdi/hdi_parser.py b/tools/deps_guard/elf_file_mgr/hdi/hdi_parser.py index 35e2f1beea9bf82934a8d5446323cc5684b836f4..539b5a16590f10c86652059628719c280fe7be82 100755 --- a/tools/deps_guard/elf_file_mgr/hdi/hdi_parser.py +++ b/tools/deps_guard/elf_file_mgr/hdi/hdi_parser.py @@ -1,7 +1,23 @@ -#! /usr/bin/env python +#!/usr/bin/env python #coding=utf-8 +# +# Copyright (c) 2022 Huawei Device Co., Ltd. +# 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. +# + import os +import subprocess class HdiParser(object): @staticmethod @@ -10,8 +26,7 @@ class HdiParser(object): hdi_tool = os.path.join(product_out_path, "obj/drivers/hdf_core/framework/tools/hc-gen/hc-gen") hcs_file = os.path.join(product_out_path, "packages/phone/vendor/etc/hdfconfig/hdf_default.hcb") out_file = os.path.join(product_out_path, "device_info.hcs") - os.system('%s -d "%s" -o "%s"' % (hdi_tool, hcs_file, out_file)) - + subprocess.Popen('%s -d "%s" -o "%s"' % (hdi_tool, hcs_file, out_file), shell=True).wait() try: with open(out_file) as f: lines = f.readlines() diff --git a/tools/deps_guard/elf_file_mgr/innerapi/__init__.py b/tools/deps_guard/elf_file_mgr/innerapi/__init__.py index 78622a6e242f08a2b9d9173bacb2ff100cfd6dda..830c6f4b3b7a1b8ff636d95b30c14b9b7596045f 100755 --- a/tools/deps_guard/elf_file_mgr/innerapi/__init__.py +++ b/tools/deps_guard/elf_file_mgr/innerapi/__init__.py @@ -1,4 +1,19 @@ -#! /usr/bin/env python +#!/usr/bin/env python #coding=utf-8 +# +# Copyright (c) 2022 Huawei Device Co., Ltd. +# 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. +# + from .innerapi import InnerAPILoader diff --git a/tools/deps_guard/elf_file_mgr/innerapi/innerapi.py b/tools/deps_guard/elf_file_mgr/innerapi/innerapi.py index aa4709e52e5e1e63359acc43cb1d18eebdf70082..a774a386917979292351731fd8b1daa31c02dd42 100755 --- a/tools/deps_guard/elf_file_mgr/innerapi/innerapi.py +++ b/tools/deps_guard/elf_file_mgr/innerapi/innerapi.py @@ -1,6 +1,21 @@ -#! /usr/bin/env python +#!/usr/bin/env python #coding=utf-8 +# +# Copyright (c) 2022 Huawei Device Co., Ltd. +# 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. +# + import os import json diff --git a/tools/deps_guard/elf_file_mgr/module_info/__init__.py b/tools/deps_guard/elf_file_mgr/module_info/__init__.py index 5614bdd5879fa925f07e16d2a2d4bf3fe74c36e8..4ac134703ce7def7de5d11be93e28f4c76cb049b 100755 --- a/tools/deps_guard/elf_file_mgr/module_info/__init__.py +++ b/tools/deps_guard/elf_file_mgr/module_info/__init__.py @@ -1,4 +1,19 @@ -#! /usr/bin/env python +#!/usr/bin/env python #coding=utf-8 +# +# Copyright (c) 2023 Huawei Device Co., Ltd. +# 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. +# + from .compile_info_loader import CompileInfoLoader diff --git a/tools/deps_guard/elf_file_mgr/module_info/compile_info_loader.py b/tools/deps_guard/elf_file_mgr/module_info/compile_info_loader.py index ee300fefb11b0c924bb2e984be5fa4e55316fbf1..d1682f89e808f29a07f48faf4c1cf23a1d07736b 100755 --- a/tools/deps_guard/elf_file_mgr/module_info/compile_info_loader.py +++ b/tools/deps_guard/elf_file_mgr/module_info/compile_info_loader.py @@ -1,6 +1,21 @@ -#! /usr/bin/env python +#!/usr/bin/env python #coding=utf-8 +# +# Copyright (c) 2022 Huawei Device Co., Ltd. +# 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. +# + import os import json diff --git a/tools/deps_guard/elf_file_mgr/sa/__init__.py b/tools/deps_guard/elf_file_mgr/sa/__init__.py index 4a613e318f7268489b9b8442f0c2fe927915f140..4d2d1e45b31fd48946082cf38c49675fa52061fd 100755 --- a/tools/deps_guard/elf_file_mgr/sa/__init__.py +++ b/tools/deps_guard/elf_file_mgr/sa/__init__.py @@ -1,4 +1,19 @@ -#! /usr/bin/env python +#!/usr/bin/env python #coding=utf-8 +# +# Copyright (c) 2022 Huawei Device Co., Ltd. +# 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. +# + from .sa import SAParser diff --git a/tools/deps_guard/elf_file_mgr/sa/sa.py b/tools/deps_guard/elf_file_mgr/sa/sa.py index 99351be279855e3da628733120208fec2c09f5f6..0665fbfb68b7096c04e7374f02818620303c7f8e 100755 --- a/tools/deps_guard/elf_file_mgr/sa/sa.py +++ b/tools/deps_guard/elf_file_mgr/sa/sa.py @@ -1,6 +1,21 @@ -#! /usr/bin/env python +#!/usr/bin/env python #coding=utf-8 +# +# Copyright (c) 2022 Huawei Device Co., Ltd. +# 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. +# + import string import json import sys diff --git a/tools/deps_guard/elf_file_mgr/utils.py b/tools/deps_guard/elf_file_mgr/utils.py index 43300d20cc65d566bcfb92afac089e9b0b1ac546..bd9649ce9678c742c9ad4bfb77bf593d25f89917 100755 --- a/tools/deps_guard/elf_file_mgr/utils.py +++ b/tools/deps_guard/elf_file_mgr/utils.py @@ -1,6 +1,21 @@ -#! /usr/bin/env python +#!/usr/bin/env python #coding=utf-8 +# +# Copyright (c) 2022 Huawei Device Co., Ltd. +# 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. +# + import os import sys import string diff --git a/tools/deps_guard/rules_checker/__init__.py b/tools/deps_guard/rules_checker/__init__.py index f50d0e4dec17099070c8d3df4efd0ae21cfaaa63..7537a0be8d150023a719403982a0673c68c97772 100755 --- a/tools/deps_guard/rules_checker/__init__.py +++ b/tools/deps_guard/rules_checker/__init__.py @@ -1,6 +1,21 @@ -#! /usr/bin/env python +#!/usr/bin/env python #coding=utf-8 +# +# Copyright (c) 2022 Huawei Device Co., Ltd. +# 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. +# + from .napi_rule import NapiRule from .sa_rule import SaRule from .hdi_rule import HdiRule diff --git a/tools/deps_guard/rules_checker/base_rule.py b/tools/deps_guard/rules_checker/base_rule.py index bd62cfb07ca75de2ad9ccf7e3363b57dca966f72..1db222e59d601554c4099164c51a02d2d10e29fd 100755 --- a/tools/deps_guard/rules_checker/base_rule.py +++ b/tools/deps_guard/rules_checker/base_rule.py @@ -1,6 +1,21 @@ -#! /usr/bin/env python +#!/usr/bin/env python #coding=utf-8 +# +# Copyright (c) 2022 Huawei Device Co., Ltd. +# 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. +# + import os import json diff --git a/tools/deps_guard/rules_checker/chipsetsdk.py b/tools/deps_guard/rules_checker/chipsetsdk.py index 7d753afada4dae927cad94f8923966aff183abfb..fa097a3d97387cc599958ee2afaa79ab07b1ff34 100755 --- a/tools/deps_guard/rules_checker/chipsetsdk.py +++ b/tools/deps_guard/rules_checker/chipsetsdk.py @@ -1,6 +1,21 @@ -#! /usr/bin/env python +#!/usr/bin/env python #coding=utf-8 +# +# Copyright (c) 2022 Huawei Device Co., Ltd. +# 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. +# + import os import json diff --git a/tools/deps_guard/rules_checker/hdi_rule.py b/tools/deps_guard/rules_checker/hdi_rule.py index ae27e590503d559ddf573158ec7842494dd4b781..e428273a77fce79c0d5284be566e5333373754fc 100755 --- a/tools/deps_guard/rules_checker/hdi_rule.py +++ b/tools/deps_guard/rules_checker/hdi_rule.py @@ -1,6 +1,21 @@ -#! /usr/bin/env python +#!/usr/bin/env python #coding=utf-8 +# +# Copyright (c) 2022 Huawei Device Co., Ltd. +# 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. +# + import json from .base_rule import BaseRule diff --git a/tools/deps_guard/rules_checker/napi_rule.py b/tools/deps_guard/rules_checker/napi_rule.py index 96911d0e534955acaf888e0b76d1549e0e19f17d..a0f77acfeaf93f51770de61938651e858716034f 100755 --- a/tools/deps_guard/rules_checker/napi_rule.py +++ b/tools/deps_guard/rules_checker/napi_rule.py @@ -1,6 +1,21 @@ -#! /usr/bin/env python +#!/usr/bin/env python #coding=utf-8 +# +# Copyright (c) 2022 Huawei Device Co., Ltd. +# 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. +# + import json from .base_rule import BaseRule diff --git a/tools/deps_guard/rules_checker/sa_rule.py b/tools/deps_guard/rules_checker/sa_rule.py index e756c8f20a6dcdb0f5ca6ac838d0a2f54e2f80af..39450dd036b91379c61502ab9b21915934858f57 100755 --- a/tools/deps_guard/rules_checker/sa_rule.py +++ b/tools/deps_guard/rules_checker/sa_rule.py @@ -1,6 +1,21 @@ -#! /usr/bin/env python +#!/usr/bin/env python #coding=utf-8 +# +# Copyright (c) 2022 Huawei Device Co., Ltd. +# 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. +# + import json from .base_rule import BaseRule