1
0
mirror of https://github.com/gryf/fs-uae-wrapper.git synced 2025-12-30 02:12:29 +01:00

Fixed deduction of archive name.

When in different directory, the archive name and config need to be
treated differently. This commit unify behavior for both cases.

Also, changing a bit logging format and added some more debugging
messages.
This commit is contained in:
2024-09-12 20:29:32 +02:00
parent 148d28dac2
commit 463f6ed705
2 changed files with 8 additions and 3 deletions

View File

@@ -42,6 +42,7 @@ class Base(object):
- run the emulation
- archive save state
"""
logging.debug("run")
if not self._validate_options():
return False
@@ -217,6 +218,7 @@ class Base(object):
if val.startswith('$CONFIG'):
abspath = utils.interpolate_variables(val, self.conf_file)
changed_options[key] = abspath
logging.info("%s: %s => %s", key, val, abspath)
continue
_val = os.path.abspath(val)
@@ -282,6 +284,7 @@ class ArchiveBase(Base):
def _extract(self):
"""Extract archive to temp dir"""
logging.debug("_extract")
title = self._get_title()
curdir = os.path.abspath('.')
@@ -291,6 +294,7 @@ class ArchiveBase(Base):
return result
def _validate_options(self):
logging.debug("_validate_options")
validation_result = super(ArchiveBase, self)._validate_options()
@@ -312,8 +316,8 @@ class ArchiveBase(Base):
Return full path to the archive name using configuration file
basename and appending one of the expected archive extensions.
"""
basename = os.path.splitext(self.conf_file)[0]
file_list = os.listdir('.')
basename = os.path.splitext(os.path.basename(self.conf_file))[0]
file_list = os.listdir(os.path.dirname(self.conf_file))
for fname in file_list:
for ext in ('.7z', '.lha', '.lzx', '.zip', '.rar', '.tar', '.tgz',
'.tar.gz', '.tar.bz2', '.tar.xz'):