代码拉取完成,页面将自动刷新
#!/usr/bin/python3
#OpenHarmony linux-5.10 patch
import os
patchlist = [
# '6',
# '11',
# '10',
# '17',
# '18',
# '28',
# '35',
# '40',
# '24',
# '45',
# '44',
# '48',
# '43',
# '52',
# '56',
# '49',
# '57',
# '55',
# '54',
# '64',
# '59',
# '67',
# '66',
# '58',
# '65',
# '68',
# '60',
# '62',
# '70',
# '72',
# '69',
# '73',
# '53',
# '77',
# '75',
# '76',
# '81',
# '82',
# '79',
# '84',
# '74',
# '87',
# '88',
# '91',
# '90',
# '92',
# '89',
# '98',
# '99',
# '95',
# '106',
# '112',
# '117',
# '128',
# '138',
'183',
'184',
'185',
'179',
'182',
'186',
'187',
'192',
'197',
'200',
'170',
'195',
'229',
'231',
'234',
'232'
]
#git fetch https://gitee.com/openharmony/kernel_linux_5.10.git pull/138/head:pr_138
#https://gitee.com/openharmony/kernel_linux_5.10/pulls/138.diff
basepath = '/home/diemit/OpenHarmony/device/board/raspberrypi/rpi4/patches/kernel-5.10'
baseurl = 'https://gitee.com/openharmony/kernel_linux_5.10/pulls'
os.popen(f'mkdir -p {basepath}')
os.chdir(basepath)
for patchid in patchlist:
filename = f'{basepath}/{patchid}.diff'
if not os.path.exists(filename):
print(f'{patchid}.patch 补丁文件不存在,下载补丁保存为{filename}')
result = os.popen(f'wget {baseurl}/{patchid}.diff')
for temp in result.readlines():
print(temp)
#git apply /home/diemit/OpenHarmony/device/rpifdn/patches/kernel-5.10/1.diff
#git apply --stat patchfile
#git apply --check patchfile
os.chdir('/home/diemit/OpenHarmony/kernel/linux/linux-rpi-5.10')
for patchid in patchlist:
patchfile = f'{basepath}/{patchid}.diff'
result = os.popen(f'git apply --check {patchfile}')
print(f'检查补丁{patchid} : git apply {patchfile}')
for temp in result.readlines():
print(temp)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。