openubmc-bingo 0.6.54__py3-none-any.whl → 0.6.56__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of openubmc-bingo might be problematic. Click here for more details.
- bmcgo/__init__.py +1 -1
- bmcgo/bmcgo_config.py +16 -0
- bmcgo/cli/cli.py +14 -0
- bmcgo/functional/upgrade.py +6 -6
- bmcgo/utils/install_manager.py +2 -2
- bmcgo/utils/installations/base_installer.py +10 -27
- bmcgo/utils/mapping_config_patch.py +1 -1
- {openubmc_bingo-0.6.54.dist-info → openubmc_bingo-0.6.56.dist-info}/METADATA +1 -1
- {openubmc_bingo-0.6.54.dist-info → openubmc_bingo-0.6.56.dist-info}/RECORD +12 -12
- {openubmc_bingo-0.6.54.dist-info → openubmc_bingo-0.6.56.dist-info}/WHEEL +0 -0
- {openubmc_bingo-0.6.54.dist-info → openubmc_bingo-0.6.56.dist-info}/entry_points.txt +0 -0
- {openubmc_bingo-0.6.54.dist-info → openubmc_bingo-0.6.56.dist-info}/top_level.txt +0 -0
bmcgo/__init__.py
CHANGED
bmcgo/bmcgo_config.py
CHANGED
|
@@ -140,6 +140,7 @@ class BmcgoConfig(object):
|
|
|
140
140
|
|
|
141
141
|
def _bmcgo_config_init(self):
|
|
142
142
|
"""配置初始化"""
|
|
143
|
+
self.bingo_version_range = None
|
|
143
144
|
cwd = self.cwd
|
|
144
145
|
if os.path.isfile("frame.py"):
|
|
145
146
|
self.manifest = BmcgoManifest(os.path.realpath(os.path.join(cwd, "..")), None)
|
|
@@ -185,6 +186,9 @@ class BmcgoConfig(object):
|
|
|
185
186
|
self.component = BmcgoComp(folder, conf)
|
|
186
187
|
except (NoSectionError, NoOptionError):
|
|
187
188
|
log.debug("不是一个合法的组件仓,尝试查找mds/service.json")
|
|
189
|
+
|
|
190
|
+
#检查是否需要升级
|
|
191
|
+
self._bingo_version_check(conf)
|
|
188
192
|
|
|
189
193
|
self._bmcgo_signature_config_load(conf)
|
|
190
194
|
|
|
@@ -194,6 +198,18 @@ class BmcgoConfig(object):
|
|
|
194
198
|
return
|
|
195
199
|
|
|
196
200
|
cwd = os.path.dirname(cwd)
|
|
201
|
+
|
|
202
|
+
def _bingo_version_check(self, conf: configparser.ConfigParser):
|
|
203
|
+
try:
|
|
204
|
+
version_range = conf.get("bingo", "version")
|
|
205
|
+
except Exception as e:
|
|
206
|
+
version_range = ""
|
|
207
|
+
version_range_str = version_range.strip("[").rstrip("]")
|
|
208
|
+
import semver
|
|
209
|
+
if semver.satisfies(__version__, version_range_str):
|
|
210
|
+
return
|
|
211
|
+
else:
|
|
212
|
+
self.bingo_version_range = version_range_str.replace(" ", ",")
|
|
197
213
|
|
|
198
214
|
def _bmcgo_config_load(self):
|
|
199
215
|
"""读取配置"""
|
bmcgo/cli/cli.py
CHANGED
|
@@ -40,6 +40,7 @@ from bmcgo.bmcgo_config import BmcgoConfig
|
|
|
40
40
|
from bmcgo.utils.tools import Tools
|
|
41
41
|
from bmcgo.utils.config import Config
|
|
42
42
|
|
|
43
|
+
|
|
43
44
|
cwd = os.getcwd()
|
|
44
45
|
tools = Tools()
|
|
45
46
|
log = tools.log
|
|
@@ -265,6 +266,12 @@ class Command(object):
|
|
|
265
266
|
if command in ["-h", "--help"]:
|
|
266
267
|
self._show_help()
|
|
267
268
|
return 0
|
|
269
|
+
#检查是否需要升级
|
|
270
|
+
if self.bconfig.bingo_version_range:
|
|
271
|
+
result_code = self.bingo_upgrade()
|
|
272
|
+
if result_code == 0:
|
|
273
|
+
log.info("自动升级完成,请重新运行命令")
|
|
274
|
+
return result_code
|
|
268
275
|
valid_command = self._find_real_command(command)
|
|
269
276
|
# 命令参数
|
|
270
277
|
command_args = args[0][1:]
|
|
@@ -316,6 +323,13 @@ class Command(object):
|
|
|
316
323
|
if studio_version:
|
|
317
324
|
log.info("bmc-studio 版本为: %s", studio_version)
|
|
318
325
|
|
|
326
|
+
def bingo_upgrade(self):
|
|
327
|
+
version_range = self.bconfig.bingo_version_range.replace(",", " ")
|
|
328
|
+
log.info(f"检测到当前版本:{client_version}与约束版本{version_range}不匹配,将自动升级,完成后请重新运行")
|
|
329
|
+
from bmcgo.functional.upgrade import BmcgoCommand as upcommand
|
|
330
|
+
cmd = upcommand(self.bconfig, (["-v", f"bingo{self.bconfig.bingo_version_range}", "-f"]))
|
|
331
|
+
return cmd.run()
|
|
332
|
+
|
|
319
333
|
def conan_init(self):
|
|
320
334
|
if misc.conan_v2():
|
|
321
335
|
tools.run_command("conan profile detect --force")
|
bmcgo/functional/upgrade.py
CHANGED
|
@@ -43,8 +43,7 @@ bingo 升级工具
|
|
|
43
43
|
|
|
44
44
|
class BmcgoCommand:
|
|
45
45
|
VERSION_PATTERN = re.compile(
|
|
46
|
-
r"^([a-zA-Z0-
|
|
47
|
-
rf"{install_consts.INSTALL_LATEST})$"
|
|
46
|
+
r"^([a-zA-Z0-9._-]+)((?:>=|<=|>|<|=)\s*[\s\S]+)"
|
|
48
47
|
)
|
|
49
48
|
|
|
50
49
|
def __init__(self, bconfig: BmcgoConfig, *args):
|
|
@@ -73,7 +72,7 @@ class BmcgoCommand:
|
|
|
73
72
|
help="列出可安装版本"
|
|
74
73
|
)
|
|
75
74
|
|
|
76
|
-
args, _ = parser.parse_known_args()
|
|
75
|
+
args, _ = parser.parse_known_args(*args)
|
|
77
76
|
|
|
78
77
|
self.version = args.version
|
|
79
78
|
self.force = args.force
|
|
@@ -83,8 +82,9 @@ class BmcgoCommand:
|
|
|
83
82
|
self.plugin_path = Path(bconfig.bmcgo_config_list.get(misc.CUSTOM_PLUGINS, misc.DEFAULT_PLUGINS_PATH))
|
|
84
83
|
|
|
85
84
|
def run(self):
|
|
86
|
-
app,
|
|
87
|
-
|
|
85
|
+
app, version_range = self._parse_version()
|
|
86
|
+
version_range = version_range.replace(",", " ")
|
|
87
|
+
self.installer.init(app, version_range, self.plugin_path)
|
|
88
88
|
|
|
89
89
|
if self.list:
|
|
90
90
|
self._list_all_versions()
|
|
@@ -105,4 +105,4 @@ class BmcgoCommand:
|
|
|
105
105
|
if match:
|
|
106
106
|
return match.groups()
|
|
107
107
|
self.version = install_consts.INSTALL_DEFAULT
|
|
108
|
-
return
|
|
108
|
+
return install_consts.INSTALL_ALL, install_consts.INSTALL_LATEST
|
bmcgo/utils/install_manager.py
CHANGED
|
@@ -38,7 +38,7 @@ class InstallManager:
|
|
|
38
38
|
def custom_install_plan_path(self):
|
|
39
39
|
return self._custom_path / install_consts.PLUGIN_INSTALL_PLAN_PATH
|
|
40
40
|
|
|
41
|
-
def init(self, app_name,
|
|
41
|
+
def init(self, app_name, version_range, custom_path):
|
|
42
42
|
self._set_custom_path(custom_path)
|
|
43
43
|
|
|
44
44
|
if app_name == install_consts.INSTALL_ALL:
|
|
@@ -54,7 +54,7 @@ class InstallManager:
|
|
|
54
54
|
if not inst_type:
|
|
55
55
|
raise ValueError(f"未配置 {wname}/{install_consts.PLAN_STEPS}/{install_consts.PLAN_INSTALL_TYPE}")
|
|
56
56
|
inst = BaseInstaller.get_installer(inst_type)
|
|
57
|
-
inst.init(plan,
|
|
57
|
+
inst.init(plan, version_range)
|
|
58
58
|
self._installers.setdefault(wname, []).append(inst)
|
|
59
59
|
|
|
60
60
|
def show_versions(self):
|
|
@@ -86,11 +86,11 @@ class BaseInstaller(abc.ABC):
|
|
|
86
86
|
raise ValueError(f"未定义的安装方法:{installer_type}")
|
|
87
87
|
return installer_cls()
|
|
88
88
|
|
|
89
|
-
def init(self, plan,
|
|
89
|
+
def init(self, plan, version_range):
|
|
90
90
|
self.parse_plan(plan)
|
|
91
91
|
|
|
92
92
|
versions = self.get_versions()
|
|
93
|
-
self.resolve_constraint(versions,
|
|
93
|
+
self.resolve_constraint(versions, version_range)
|
|
94
94
|
|
|
95
95
|
self.get_current_version()
|
|
96
96
|
|
|
@@ -113,39 +113,22 @@ class BaseInstaller(abc.ABC):
|
|
|
113
113
|
return
|
|
114
114
|
self.parse_custom_plan(plan)
|
|
115
115
|
|
|
116
|
-
def resolve_constraint(self, versions,
|
|
116
|
+
def resolve_constraint(self, versions, version_range):
|
|
117
117
|
if not versions:
|
|
118
118
|
self.warning("当前没有可下载版本!")
|
|
119
119
|
return
|
|
120
120
|
|
|
121
|
-
if
|
|
121
|
+
if install_consts.INSTALL_LATEST in version_range or not version_range:
|
|
122
122
|
self._target_ver = versions[0]
|
|
123
123
|
return
|
|
124
|
-
|
|
125
|
-
|
|
124
|
+
|
|
125
|
+
import semver
|
|
126
126
|
for avl_ver in versions:
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
self._target_ver = v.origin
|
|
130
|
-
break
|
|
131
|
-
elif opt == "<=" and v <= pkg_ver:
|
|
132
|
-
self._target_ver = v.origin
|
|
133
|
-
break
|
|
134
|
-
elif opt == "!=" and v != pkg_ver:
|
|
135
|
-
self._target_ver = v.origin
|
|
127
|
+
if semver.satisfies(avl_ver, version_range):
|
|
128
|
+
self._target_ver = avl_ver
|
|
136
129
|
break
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
break
|
|
140
|
-
elif opt == ">" and v > pkg_ver:
|
|
141
|
-
self._target_ver = v.origin
|
|
142
|
-
break
|
|
143
|
-
elif opt == "=" and v == pkg_ver:
|
|
144
|
-
self._target_ver = v.origin
|
|
145
|
-
break
|
|
146
|
-
else:
|
|
147
|
-
self.warning(f"没有找到匹配的版本:{self._pkg_name}{opt}{ver}")
|
|
148
|
-
return
|
|
130
|
+
if not self._target_ver:
|
|
131
|
+
raise ValueError(f"没有找到匹配的版本:{self._pkg_name}{version_range}")
|
|
149
132
|
|
|
150
133
|
def info(self, msg):
|
|
151
134
|
self.logger and self.logger.info(f"[{self.type_name}] {msg}")
|
|
@@ -128,7 +128,7 @@ def rename_json_prop(obj, array, depth, new_key):
|
|
|
128
128
|
elif isinstance(obj, list) and array[depth] < len(obj):
|
|
129
129
|
node = obj[array[depth]]
|
|
130
130
|
if node is not None:
|
|
131
|
-
|
|
131
|
+
rename_json_prop(node, array, depth + 1, new_key)
|
|
132
132
|
|
|
133
133
|
|
|
134
134
|
class MappingConfigPatch(Task):
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
bmcgo/__init__.py,sha256=
|
|
1
|
+
bmcgo/__init__.py,sha256=4Mshf52SWtmdzhgKt9Lt69SpDg27Ekv5S-DZowXUOd0,562
|
|
2
2
|
bmcgo/bmcgo.py,sha256=uD4TsfjrFB5aQPIS6WRUVc9ShXX-dSImY9ezkB13g1w,685
|
|
3
|
-
bmcgo/bmcgo_config.py,sha256=-
|
|
3
|
+
bmcgo/bmcgo_config.py,sha256=-KYhC3jNqWkCWu6YkyxDZlyC3floXIHaibGpmyB6YWQ,11873
|
|
4
4
|
bmcgo/errors.py,sha256=QW1ndrJcJ2Ws7riOznPKVvZsNlrYk73eZol7w8gJTPU,3076
|
|
5
5
|
bmcgo/frame.py,sha256=xv-9d8KN98ivmZQe-k_QQn_miPjELSNwkkVtOt95J1Y,10680
|
|
6
6
|
bmcgo/logger.py,sha256=rcMqJnyQ5Ag3k04KLEskrG8ZJ508OOU_JH4fMFiGOqQ,6644
|
|
7
7
|
bmcgo/misc.py,sha256=w0vzsD7uzrsxTly5Y1viLgYTKHhLP4sxa499XwbqHnU,6986
|
|
8
8
|
bmcgo/worker.py,sha256=OXz5Gam3pmZjgQeoGJrYy73ZrQszCOxk9X19nbeBI_A,15710
|
|
9
9
|
bmcgo/cli/__init__.py,sha256=BDXz8BcSlCkfo5UYt6j2rm89-HiYA1ZzfpFhy99MH-0,538
|
|
10
|
-
bmcgo/cli/cli.py,sha256=
|
|
10
|
+
bmcgo/cli/cli.py,sha256=O4FHWNLUyqNjs0BoD3aYzPyi3L3mCg7rsIL0mP7_x0U,27748
|
|
11
11
|
bmcgo/cli/config.conan2.yaml,sha256=SAtM_6_qOjZbkgUT5fzWbhbq4aWCayqE8o4xJ2vBRww,261
|
|
12
12
|
bmcgo/cli/config.yaml,sha256=tbnFhz2TTrl2-ALpHHujbXB1ymZpjGC4f0zTfqfUZfM,194
|
|
13
13
|
bmcgo/codegen/__init__.py,sha256=eplRBfR_obzVWMQtIeX1RRq6DOEezBx_l1EqcZYLRPM,775
|
|
@@ -209,7 +209,7 @@ bmcgo/functional/maintain.py,sha256=lUn0BtMKMqYKm56aYhvuvnzj47p4BinwVCRuNZ2c1P0,
|
|
|
209
209
|
bmcgo/functional/new.py,sha256=g7J4qLRTi4F9N6wlKHOVgJJwDmUFiWZbxO1PeGIWqTE,6171
|
|
210
210
|
bmcgo/functional/schema_valid.py,sha256=WI7_NOJqU8wFC51bgiU9G7HJTYnxnMyzxH-L6jn339A,3924
|
|
211
211
|
bmcgo/functional/simple_sign.py,sha256=AstEnGzcTIxAYs5U9G82JDXj7CnfhN9LyYcnkpGEH2Y,4086
|
|
212
|
-
bmcgo/functional/upgrade.py,sha256=
|
|
212
|
+
bmcgo/functional/upgrade.py,sha256=y5smvMoKlfdnNjMtfImS9VW_p8rGhZctkzUkT7tymQU,3180
|
|
213
213
|
bmcgo/ipmigen/__init__.py,sha256=xrppKUuQkt1jTqnr6gHWiWeEyUMFJeiZxcA7Hx9XXUo,789
|
|
214
214
|
bmcgo/ipmigen/ctype_defination.py,sha256=PmkKRWTvmVQsZ-njio16ayXpsyFhC6le9Tu0baWU-xw,3179
|
|
215
215
|
bmcgo/ipmigen/ipmigen.py,sha256=SZWoylTM-Tp4KSOQyfHidMjhhIzp4WIa40oxcrFfKB8,14506
|
|
@@ -247,15 +247,15 @@ bmcgo/utils/component_post.py,sha256=rTSMv36geI6rbm6ZFQenZfG0mn1nVPpdJqn7g8bYtKA
|
|
|
247
247
|
bmcgo/utils/component_version_check.py,sha256=ukc-H-A4ljkOShzVtkYWL0oTIYwxgDIZtP-fPqqHnRY,6274
|
|
248
248
|
bmcgo/utils/config.py,sha256=rXk3_UbweJSdDcj8ISgXKJHcjg9erGSPjf9BJ1nODTo,51077
|
|
249
249
|
bmcgo/utils/fetch_component_code.py,sha256=WtPJ5h1nM87X6RicrAhMOJzOzh9A0jD3CbjPc4A-REo,11280
|
|
250
|
-
bmcgo/utils/install_manager.py,sha256=
|
|
250
|
+
bmcgo/utils/install_manager.py,sha256=Ag7tcTbhBfc6aTe5FOiET-8koq8_iY38Sozmi3dquio,4919
|
|
251
251
|
bmcgo/utils/json_validator.py,sha256=_k5wU78wfYGrzvSDaqOEtT4otgKUjquVhZNpVf2PW_c,7524
|
|
252
|
-
bmcgo/utils/mapping_config_patch.py,sha256=
|
|
252
|
+
bmcgo/utils/mapping_config_patch.py,sha256=rfCfeiEU3WAEMDuUxLDARNjne3pWtK0Bxga3dQrEWoM,16827
|
|
253
253
|
bmcgo/utils/merge_csr.py,sha256=JNxHCfW1au84WQshdz0aQy8wMTEOHonjQT3s6LjlZN4,4580
|
|
254
254
|
bmcgo/utils/perf_analysis.py,sha256=fh6lV9AAKVhpPkGPwAJ8EWfGfUoHjqGYQxrvc32Xiac,4767
|
|
255
255
|
bmcgo/utils/tools.py,sha256=MmFWnfL1ahRReBb7QaHjLNH3731IXDiBBRiOk9CPsQE,33152
|
|
256
256
|
bmcgo/utils/installations/README.md,sha256=hKXnFYmeHEuROFMFE-vzlGLSHg71bei5ZYwyYZphWNk,2
|
|
257
257
|
bmcgo/utils/installations/__init__.py,sha256=BDXz8BcSlCkfo5UYt6j2rm89-HiYA1ZzfpFhy99MH-0,538
|
|
258
|
-
bmcgo/utils/installations/base_installer.py,sha256=
|
|
258
|
+
bmcgo/utils/installations/base_installer.py,sha256=4lhOiMOmWMeS1yXGYFe_rz5KdVIevPB8isAMiurA_Yo,5339
|
|
259
259
|
bmcgo/utils/installations/install_consts.py,sha256=QrRYfjw-rkwRllXDvC-pqoAH3Ii_tXsj590gzYxnAFA,1104
|
|
260
260
|
bmcgo/utils/installations/install_workflow.py,sha256=wT6lTE_s-NZP8LSZR1xlu4dXTtPTEai1dsq3D5-kLzE,3162
|
|
261
261
|
bmcgo/utils/installations/version_util.py,sha256=dOwvLZ7iOmnzSeyD6_pRm7NS7I13Um5mSD_y0dVyO6M,3212
|
|
@@ -264,8 +264,8 @@ bmcgo/utils/installations/install_plans/qemu.yml,sha256=lT7aKag60QUH6hTGFKa3hGRq
|
|
|
264
264
|
bmcgo/utils/installations/install_plans/studio.yml,sha256=APR3GM-3Q11LFfe8vh7t3LztDn4LLEpNHRUNjkaVekA,143
|
|
265
265
|
bmcgo/utils/installations/installers/apt_installer.py,sha256=nPaCb4cobSi9InN_aHsEPtQ0k4FgsCUWE5_VgBPvcRE,3769
|
|
266
266
|
bmcgo/utils/installations/installers/pip_installer.py,sha256=dDdios1EQ7fzt90r02pZeoM3jCmjslLzkSvzd2hgRVM,3241
|
|
267
|
-
openubmc_bingo-0.6.
|
|
268
|
-
openubmc_bingo-0.6.
|
|
269
|
-
openubmc_bingo-0.6.
|
|
270
|
-
openubmc_bingo-0.6.
|
|
271
|
-
openubmc_bingo-0.6.
|
|
267
|
+
openubmc_bingo-0.6.56.dist-info/METADATA,sha256=FsYAKF-gDqsrbYX9nlQDxvQOogKlT2xQ8yUoz64O874,1010
|
|
268
|
+
openubmc_bingo-0.6.56.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
|
269
|
+
openubmc_bingo-0.6.56.dist-info/entry_points.txt,sha256=UUoUP-vAWTgg9vEYbRwYqOBHgpRtkngdzMPb-ocz90g,42
|
|
270
|
+
openubmc_bingo-0.6.56.dist-info/top_level.txt,sha256=9AcvCAt1nZcOgMsGt6T07mg2Bgtdet-3mHTwg91axgI,6
|
|
271
|
+
openubmc_bingo-0.6.56.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|