mirror of
https://gitee.com/gfdgd-xi/deep-wine-runner
synced 2025-05-16 21:19:54 +08:00
修复不存在TMPDIR/tmp文件夹时无法打开程序的问题
This commit is contained in:
parent
f79bac9d6c
commit
1ec62bbf86
@ -727,7 +727,9 @@ Description: {e3_text.text()}
|
|||||||
################
|
################
|
||||||
if not self.build:
|
if not self.build:
|
||||||
self.label.emit("正在构建 deb 包……")
|
self.label.emit("正在构建 deb 包……")
|
||||||
|
print(os.path.exists(wine[wineVersion.currentText()]))
|
||||||
if (os.path.exists(wine[wineVersion.currentText()])):
|
if (os.path.exists(wine[wineVersion.currentText()])):
|
||||||
|
print("bash -c 'dpkg-deb -Z xz -z 9 -b \"{}\" \"{}\"'".format(debPackagePath, e12_text.text()))
|
||||||
self.run_command("bash -c 'dpkg-deb -Z xz -z 9 -b \"{}\" \"{}\"'".format(debPackagePath, e12_text.text()))
|
self.run_command("bash -c 'dpkg-deb -Z xz -z 9 -b \"{}\" \"{}\"'".format(debPackagePath, e12_text.text()))
|
||||||
else:
|
else:
|
||||||
self.run_command("bash -c 'dpkg-deb -Z xz -z 0 -b \"{}\" \"{}\"'".format(debPackagePath, e12_text.text()))
|
self.run_command("bash -c 'dpkg-deb -Z xz -z 0 -b \"{}\" \"{}\"'".format(debPackagePath, e12_text.text()))
|
||||||
@ -736,7 +738,7 @@ Description: {e3_text.text()}
|
|||||||
################
|
################
|
||||||
if not self.build:
|
if not self.build:
|
||||||
self.label.emit("正在删除临时文件……")
|
self.label.emit("正在删除临时文件……")
|
||||||
self.run_command(f"rm -rfv '{debPackagePath}'")
|
self.run_command(f"rm -rf '{debPackagePath}'")
|
||||||
################
|
################
|
||||||
# 完成构建
|
# 完成构建
|
||||||
################
|
################
|
||||||
@ -772,20 +774,26 @@ def getFileFolderSize(fileOrFolderPath):
|
|||||||
totalSize = 0
|
totalSize = 0
|
||||||
if not os.path.exists(fileOrFolderPath):
|
if not os.path.exists(fileOrFolderPath):
|
||||||
return totalSize
|
return totalSize
|
||||||
|
# 排除链接导致层数过多的问题
|
||||||
|
if (os.path.islink(fileOrFolderPath)):
|
||||||
|
return totalSize
|
||||||
if os.path.isfile(fileOrFolderPath):
|
if os.path.isfile(fileOrFolderPath):
|
||||||
totalSize = os.path.getsize(fileOrFolderPath) # 5041481
|
totalSize = os.path.getsize(fileOrFolderPath) # 5041481
|
||||||
return totalSize
|
return totalSize
|
||||||
if os.path.isdir(fileOrFolderPath):
|
try:
|
||||||
with os.scandir(fileOrFolderPath) as dirEntryList:
|
if os.path.isdir(fileOrFolderPath):
|
||||||
for curSubEntry in dirEntryList:
|
with os.scandir(fileOrFolderPath) as dirEntryList:
|
||||||
curSubEntryFullPath = os.path.join(fileOrFolderPath, curSubEntry.name)
|
for curSubEntry in dirEntryList:
|
||||||
if curSubEntry.is_dir():
|
curSubEntryFullPath = os.path.join(fileOrFolderPath, curSubEntry.name)
|
||||||
curSubFolderSize = getFileFolderSize(curSubEntryFullPath) # 5800007
|
if curSubEntry.is_dir():
|
||||||
totalSize += curSubFolderSize
|
curSubFolderSize = getFileFolderSize(curSubEntryFullPath) # 5800007
|
||||||
elif curSubEntry.is_file():
|
totalSize += curSubFolderSize
|
||||||
curSubFileSize = os.path.getsize(curSubEntryFullPath) # 1891
|
elif curSubEntry.is_file():
|
||||||
totalSize += curSubFileSize
|
curSubFileSize = os.path.getsize(curSubEntryFullPath) # 1891
|
||||||
return totalSize
|
totalSize += curSubFileSize
|
||||||
|
return totalSize
|
||||||
|
except:
|
||||||
|
return totalSize
|
||||||
|
|
||||||
# 显示“提示”窗口
|
# 显示“提示”窗口
|
||||||
def helps():
|
def helps():
|
||||||
|
@ -8,6 +8,9 @@ if (TMPDIR == None):
|
|||||||
TMPDIR = ""
|
TMPDIR = ""
|
||||||
PIDFILE = TMPDIR + '/tmp/deepin-wine-runner.pid'
|
PIDFILE = TMPDIR + '/tmp/deepin-wine-runner.pid'
|
||||||
|
|
||||||
|
if (not os.path.exists(TMPDIR + "/tmp")):
|
||||||
|
os.makedirs(TMPDIR + "/tmp")
|
||||||
|
|
||||||
#程序结束时清理pid
|
#程序结束时清理pid
|
||||||
@atexit.register
|
@atexit.register
|
||||||
def remove_pid():
|
def remove_pid():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user