diff --git a/src/report/__init__.py b/src/report/__init__.py new file mode 100755 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/utils/depparse.py b/src/utils/depparse.py index e19852a9635ecfc724f9e9b1d05489aa5b762230..f32b29ecb9fcb0120c4b8c2ad1d5ac251c0cc6fb 100755 --- a/src/utils/depparse.py +++ b/src/utils/depparse.py @@ -13,6 +13,7 @@ # ********************************************************************************** """ import copy +import json from collections import defaultdict import hawkey @@ -118,3 +119,32 @@ class ISODepParse(DepParse): deps_by_dict[tmp_k] = tmp_v return deps_by_dict + +class RepoDepParse(DepParse): + """ + 仓库软件包依赖解析模块 + """ + def __init__(self): + pass + + def _load_data(self): + """ + 加载仓库配置数据 + Returns: + res (list): 仓库配置数据 + """ + with open('/opt/kyclassifier/src/data/repos_data.json','r') as f: + res = json.load(f) + return res + + def _get_all_pkgs(self): + """ + 解析仓库中所有软件包名集合 + Returns: + res_set (set): 仓库中所有软件包名集合 + """ + if isinstance(self.dep_dict,dict): + res_set = set(self.dep_dict.keys()) + else: + res_set = set() + return res_set