新增转包功能

This commit is contained in:
gfdgd xi 2024-02-02 09:23:42 +08:00
parent 1092c2ac2c
commit 44c7d4fe3b
4 changed files with 48 additions and 5 deletions

View File

@ -36,3 +36,21 @@ if terminal == "":
app = QtWidgets.QApplication(sys.argv)
QtWidgets.QMessageBox.critical(None, "错误", "无法识别到以下的任意一个终端\n" + " ".join(terminalList))
exit()
# 转包
class TurnDeb():
debPath = ""
def __init__(self, debPath):
self.debPath = debPath
def ToRpm(self):
if os.system("which alien"):
raise NameError("无法找到 alien 命令,请先安装 alien")
if os.system("which fakeroot"):
raise NameError("无法找到 fakeroot 命令,请先安装 fakeroot")
os.system(f"fakeroot alien -r '{self.debPath}' -c")
def ToTarZst(self):
if os.system("debtap"):
raise NameError("无法找到 debtap 命令,请先安装 debtap")
os.system(f"debtap -Q '{self.debPath}'")

View File

@ -8,8 +8,8 @@ Certainty: possible
Check: binaries
Type: binary, udeb
Priority: optional
Depends: python3, python3-pil, libc6, python3-pil.imagetk, python3-pyquery, aria2, curl, unrar | unrar-free , unzip, python3-requests, python3-pyqt5, python3-psutil, deepin-terminal | mate-terminal | gnome-terminal | xfce4-terminal, python3-dbus, python3-pip, p7zip-full, sudo, python3-pyperclip, bubblewrap, zenity, tree, dpkg
Recommends: winbind, wimtools, python3-pyqt5.qtwebengine, binfmt-support, libc6:i386, libc6:armhf, libwine, qemu-system | qemu-full
Depends: python3, python3-pil, libc6, python3-pil.imagetk, python3-pyquery, aria2, curl, unrar | unrar-free , unzip, python3-requests, python3-pyqt5, python3-psutil, deepin-terminal | mate-terminal | gnome-terminal | xfce4-terminal, python3-dbus, python3-pip, p7zip-full, sudo, python3-pyperclip, bubblewrap, zenity, tree, dpkg, fakeroot
Recommends: winbind, wimtools, python3-pyqt5.qtwebengine, binfmt-support, libc6:i386, libc6:armhf, libwine, qemu-system, qemu-full, alien
Section: utils
Conflicts: spark.deepin-venturi-setter, spark-deepin-wine5-application-packer, spark-deepin-wine-runner-52
Replaces: spark.deepin-venturi-setter, spark-deepin-wine5-application-packer, spark-deepin-wine-runner-52

View File

@ -26,6 +26,7 @@ import PyQt5.QtCore as QtCore
import PyQt5.QtWidgets as QtWidgets
from trans import *
from DefaultSetting import *
from Model import *
#################
# 程序所需事件
@ -279,9 +280,9 @@ def make_deb(build=False):
if QtWidgets.QMessageBox.warning(window, "警告", "输入的路径似乎是在容器的用户目录内,打包后可能会出现找不到 exe 的情况,是否继续?", QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No) == QtWidgets.QMessageBox.No:
disabled_or_NORMAL_all(True)
return
if i[0][:2].lower() == "c:" and not os.path.exists("{}/drive_c/{}".format(
if i[0].text()[:2].lower() == "c:" and not os.path.exists("{}/drive_c/{}".format(
e6_text.text(),
i[0][3:].replace("\\", '/'))):
i[0].text()[3:].replace("\\", '/'))):
if QtWidgets.QMessageBox.warning(window, "警告", "输入的路径似乎在 Wine 容器不存在(如果只是大小写错误导致的误判,请忽略)\n是否继续打包?", QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No) == QtWidgets.QMessageBox.No:
disabled_or_NORMAL_all(True)
return
@ -2221,6 +2222,23 @@ def LockBottleName():
def get_now_lang()->"获取当前语言":
return os.getenv('LANG')
def ToRpm():
if os.system("which alien"):
QtWidgets.QMessageBox.critical(window, "错误", "无法找到 alien 命令,请先安装 alien")
return
if os.system("which fakeroot"):
QtWidgets.QMessageBox.critical(window, "错误", "无法找到 fakeroot 命令,请先安装 fakeroot")
return
os.system(f"cd '{os.path.dirname(e12_text.text())}' ; fakeroot alien -r '{e12_text.text()}' -c")
QtWidgets.QMessageBox.information(window, "提示", "打包完成!")
def ToTarZst():
if os.system("debtap"):
QtWidgets.QMessageBox.critical(window, "错误", "无法找到 debtap 命令,请先安装 debtap")
return
os.system(f"debtap -Q '{e12_text.text()}'")
QtWidgets.QMessageBox.information(window, "提示", "打包完成!")
bottleNameLock = False
###############
# 程序信息
@ -2494,6 +2512,13 @@ uosPackingTools.triggered.connect(lambda: threading.Thread(target=os.system, arg
sparkStoreWebsite.triggered.connect(lambda: webbrowser.open_new_tab("https://spark-app.store/"))
wineDepend.addAction(sparkStoreWebsite)
wineDepend.addAction(uosPackingTools)
turnDebToOther = menu.addMenu("转换安装包格式")
toRpm = QtWidgets.QAction("转 rpm")
toTarZst = QtWidgets.QAction("转 tar.zst")
toRpm.triggered.connect(ToRpm)
toTarZst.triggered.connect(ToTarZst)
turnDebToOther.addAction(toRpm)
turnDebToOther.addAction(toTarZst)
programmenu.addAction(openFile)
programmenu.addAction(saveFile)
#programmenu.addSeparator()

View File

@ -1,5 +1,5 @@
{
"Version": "3.6.1",
"Version": "3.7.0",
"Time": "未知",
"Thank": [
"感谢 @ёжезийлёзйз 进行 Loongarch 架构的测试(旧世界,远程)",