From 39c4d07cb09b912105ed765ba6118c56f35367a2 Mon Sep 17 00:00:00 2001 From: limingkang Date: Tue, 21 Mar 2023 17:10:22 +0800 Subject: [PATCH] =?UTF-8?q?=E5=91=8A=E8=AD=A6=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: limingkang Change-Id: I663e8f0435587e1ce6ac4f33c3016e8228526dd6 --- tools/deps_guard/deps_guard.py | 17 ++++++++++++++- tools/deps_guard/elf_file_mgr/__init__.py | 17 ++++++++++++++- tools/deps_guard/elf_file_mgr/elf_file.py | 17 ++++++++++++++- tools/deps_guard/elf_file_mgr/elf_file_mgr.py | 17 ++++++++++++++- tools/deps_guard/elf_file_mgr/elf_walker.py | 19 +++++++++++++++-- tools/deps_guard/elf_file_mgr/hdi/__init__.py | 17 ++++++++++++++- .../deps_guard/elf_file_mgr/hdi/hdi_parser.py | 21 ++++++++++++++++--- .../elf_file_mgr/innerapi/__init__.py | 17 ++++++++++++++- .../elf_file_mgr/innerapi/innerapi.py | 17 ++++++++++++++- .../elf_file_mgr/module_info/__init__.py | 17 ++++++++++++++- .../module_info/compile_info_loader.py | 17 ++++++++++++++- tools/deps_guard/elf_file_mgr/sa/__init__.py | 17 ++++++++++++++- tools/deps_guard/elf_file_mgr/sa/sa.py | 17 ++++++++++++++- tools/deps_guard/elf_file_mgr/utils.py | 17 ++++++++++++++- tools/deps_guard/rules_checker/__init__.py | 17 ++++++++++++++- tools/deps_guard/rules_checker/base_rule.py | 17 ++++++++++++++- tools/deps_guard/rules_checker/chipsetsdk.py | 17 ++++++++++++++- tools/deps_guard/rules_checker/hdi_rule.py | 17 ++++++++++++++- tools/deps_guard/rules_checker/napi_rule.py | 17 ++++++++++++++- tools/deps_guard/rules_checker/sa_rule.py | 17 ++++++++++++++- 20 files changed, 323 insertions(+), 23 deletions(-) diff --git a/tools/deps_guard/deps_guard.py b/tools/deps_guard/deps_guard.py index 74f8dd1..fbd7e02 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 fcb0354..2e5ffc5 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 1fc9a1d..be0d90e 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 87caf5d..a1961a9 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 bf8a7db..a68c442 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 2154b7d..da63c65 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 35e2f1b..539b5a1 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 78622a6..830c6f4 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 aa4709e..a774a38 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 5614bdd..4ac1347 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 ee300fe..d1682f8 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 4a613e3..4d2d1e4 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 99351be..0665fbf 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 43300d2..bd9649c 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 f50d0e4..7537a0b 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 bd62cfb..1db222e 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 7d753af..fa097a3 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 ae27e59..e428273 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 96911d0..a0f77ac 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 e756c8f..39450dd 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 -- Gitee