Skip to content

Commit

Permalink
backend: Properly extract archive to prefix (bottlesdevs#2498)
Browse files Browse the repository at this point in the history
  • Loading branch information
dkeruza-neo authored Jan 9, 2023
1 parent 8ccc0cb commit 976a2e5
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions bottles/backend/managers/dependency.py
Original file line number Diff line number Diff line change
Expand Up @@ -502,10 +502,14 @@ def __step_archive_extract(self, step: dict):

os.makedirs(archive_path)
try:
patoolib.extract_archive(
os.path.join(Paths.temp, file),
outdir=archive_path
)
ext_path = patoolib.extract_archive(os.path.join(Paths.temp, file), outdir=archive_path)
ext_file = ext_path + '/' + os.path.basename(ext_path)
if os.path.exists(archive_path):
if os.path.isfile(ext_file):
patoolib.extract_archive(
ext_file,
outdir=ext_path + '/'
)
except:
return False
return True
Expand Down Expand Up @@ -553,6 +557,9 @@ def __step_copy_dll(self, config: dict, step: dict):
try:
if "*" in step.get('file_name'):
files = glob(f"{path}/{step.get('file_name')}")
if not files:
logging.info(f"File(s) not found in {path}")
return False
for fg in files:
_name = fg.split("/")[-1]
_path = os.path.join(path, _name)
Expand Down

0 comments on commit 976a2e5

Please sign in to comment.