proton: Handle corrupted prefixes a little better
This commit is contained in:
parent
ad90a3686e
commit
414cffdfaf
1 changed files with 30 additions and 18 deletions
12
proton
12
proton
|
@ -60,6 +60,13 @@ def upgrade_pfx(old_ver):
|
|||
if old_ver is None:
|
||||
return
|
||||
|
||||
if not '-' in old_ver:
|
||||
#How can this happen??
|
||||
log("Prefix has an invalid version?! You may want to back up user files and delete this prefix.")
|
||||
#If it does, just let the Wine upgrade happen and hope it works...
|
||||
return
|
||||
|
||||
try:
|
||||
old_proton_ver, old_prefix_ver = old_ver.split('-')
|
||||
old_proton_maj, old_proton_min = old_proton_ver.split('.')
|
||||
new_proton_ver, new_prefix_ver = CURRENT_PREFIX_VERSION.split('-')
|
||||
|
@ -82,6 +89,11 @@ def upgrade_pfx(old_ver):
|
|||
shutil.rmtree(prefix)
|
||||
return
|
||||
|
||||
except ValueError:
|
||||
log("Prefix has an invalid version?! You may want to back up user files and delete this prefix.")
|
||||
#Just let the Wine upgrade happen and hope it works...
|
||||
return
|
||||
|
||||
def run_wine(args):
|
||||
subprocess.call(args, env=env, stderr=lfile)
|
||||
|
||||
|
|
Loading…
Reference in a new issue