调整打包器包名识别机制

This commit is contained in:
2024-05-07 22:03:56 +08:00
parent 1825136eac
commit e28dc5927e
2 changed files with 41 additions and 1 deletions

View File

@@ -501,7 +501,21 @@ class RunThread(QtCore.QThread):
if len(k[1]) < miniLenge:
rightLnk = k
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"
bottlePackagePath = f"{debBuildPath}/opt/apps/{debPackageName}/files/files.7z"
self.RunCommand(f"mkdir -pv '{debBuildPath}/opt/apps/{debPackageName}/entries/icons/hicolor/scalable/apps/'")