代码拉取完成,页面将自动刷新
同步操作将从 oepkgs/oepkgs-management 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
import yaml
import time
import subprocess
count = 0
with open("path", "r") as f_path:
for line in f_path:
count += 1
print(count, line.strip())
add_branch = {'name': 'openEuler-22.03-LTS-SP2', 'type': 'protected', 'create_from': 'openEuler-22.03-LTS'}
with open(line.strip(), "r") as f_yaml_in:
data = yaml.safe_load(f_yaml_in)
if "sig-info.yaml" in line.strip():
continue
branches = data["branches"]
branch_list = []
for branch in data["branches"]:
branch_list.append(branch["name"])
if "openEuler-22.03-LTS" not in branch_list:
continue
if "openEuler-22.03-LTS-SP2" in branch_list:
continue
print(branch_list)
data["branches"].append(add_branch)
with open(line.strip(), "w") as f_yaml_out:
yaml.safe_dump(data, f_yaml_out, sort_keys=False)
if count % 100 == 0:
# 执行外部命令
process = subprocess.Popen(['sh', 'create_pr.sh'], stdout=subprocess.PIPE, text=True,
cwd="/home/wcy/oepkgs-management")
# 逐行读取输出
for output in process.stdout:
print(output.strip())
print(f"已读取{count}, 暂停60分钟。。。")
time.sleep(3600)
print("读取完毕")
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。