mirror of
https://gitee.com/gfdgd-xi/deep-wine-runner
synced 2025-06-03 21:59:51 +08:00
调整打包器包名识别机制
This commit is contained in:
parent
1825136eac
commit
e28dc5927e
26
ShellList/turn-all-to-amd64-arm64-deb.py
Executable file
26
ShellList/turn-all-to-amd64-arm64-deb.py
Executable file
@ -0,0 +1,26 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
|
||||||
|
def ReadTXT(path):
|
||||||
|
with open(path, "r") as file:
|
||||||
|
thing = file.read()
|
||||||
|
return thing
|
||||||
|
|
||||||
|
def WriteTXT(path, data):
|
||||||
|
with open(path, "w") as file:
|
||||||
|
file.write(data)
|
||||||
|
|
||||||
|
debList = sys.argv[1:]
|
||||||
|
for i in debList:
|
||||||
|
# 解包
|
||||||
|
os.system("rm -rf /tmp/change-old-to-new")
|
||||||
|
os.system(f"dpkg -x '{i}' /tmp/change-old-to-new")
|
||||||
|
os.system(f"dpkg -e '{i}' /tmp/change-old-to-new/DEBIAN")
|
||||||
|
info = ReadTXT("/tmp/change-old-to-new/DEBIAN/control").replace(": all", ": amd64")
|
||||||
|
WriteTXT("/tmp/change-old-to-new/DEBIAN/control", info)
|
||||||
|
os.system(f"dpkg-deb -Z xz -z 0 -b /tmp/change-old-to-new '{os.path.basename(i).replace('_all', '_amd64')}'")
|
||||||
|
info = ReadTXT("/tmp/change-old-to-new/DEBIAN/control").replace(": amd64", ": arm64")
|
||||||
|
WriteTXT("/tmp/change-old-to-new/DEBIAN/control", info)
|
||||||
|
os.system(f"dpkg-deb -Z xz -z 0 -b /tmp/change-old-to-new '{os.path.basename(i).replace('_all', '_arm64')}'")
|
||||||
|
# 检查是否能正常安装
|
@ -501,7 +501,21 @@ class RunThread(QtCore.QThread):
|
|||||||
if len(k[1]) < miniLenge:
|
if len(k[1]) < miniLenge:
|
||||||
rightLnk = k
|
rightLnk = k
|
||||||
miniLenge = len(rightLnk[1])
|
miniLenge = len(rightLnk[1])
|
||||||
debPackageName = "com." + xpinyin.Pinyin().get_pinyin(os.path.splitext(os.path.basename(rightLnk[0]))[0].replace(" ", "")).lower().replace("--", "-").replace(" ", "").replace("_", "-").replace("-", ".") + ".spark"
|
replacePackageMap = {
|
||||||
|
" ": "",
|
||||||
|
"--": "-",
|
||||||
|
"_": "-",
|
||||||
|
"-": ".",
|
||||||
|
"(": "",
|
||||||
|
")": "",
|
||||||
|
"&": "",
|
||||||
|
"*": "",
|
||||||
|
"..": "."
|
||||||
|
}
|
||||||
|
pkgNameTemp = xpinyin.Pinyin().get_pinyin(os.path.splitext(os.path.basename(rightLnk[0]))[0].replace(" ", "")).lower()
|
||||||
|
for i in replacePackageMap.keys():
|
||||||
|
pkgNameTemp = pkgNameTemp.replace(i, replacePackageMap[i])
|
||||||
|
debPackageName = "com." + pkgNameTemp + ".spark"
|
||||||
programIconPath = f"/opt/apps/{debPackageName}/entries/icons/hicolor/scalable/apps/{debPackageName}.png"
|
programIconPath = f"/opt/apps/{debPackageName}/entries/icons/hicolor/scalable/apps/{debPackageName}.png"
|
||||||
bottlePackagePath = f"{debBuildPath}/opt/apps/{debPackageName}/files/files.7z"
|
bottlePackagePath = f"{debBuildPath}/opt/apps/{debPackageName}/files/files.7z"
|
||||||
self.RunCommand(f"mkdir -pv '{debBuildPath}/opt/apps/{debPackageName}/entries/icons/hicolor/scalable/apps/'")
|
self.RunCommand(f"mkdir -pv '{debBuildPath}/opt/apps/{debPackageName}/entries/icons/hicolor/scalable/apps/'")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user