Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fix patool double extracting when not needed #2591

Merged
merged 5 commits into from
Jan 22, 2023

Conversation

Kinsteen
Copy link
Contributor

@Kinsteen Kinsteen commented Jan 20, 2023

Description

Workaround to fix #2582. Patoolib should maybe be updated to a Git version, as the last release was in 2016.
Upstream issue: wummel/patool#94
Seems to be fixed in the Git version of patool.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes.
Provide instructions so we can reproduce.

  • locally, with both d3dx9.tar.xz and cjkfonts.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 20, 2023

Pylint result on modfied files:
************* Module bottles.backend.managers.dependency
bottles/backend/managers/dependency.py:99:12: W0105: String statement has no effect (pointless-string-statement)
bottles/backend/managers/dependency.py:119:12: W0105: String statement has no effect (pointless-string-statement)
bottles/backend/managers/dependency.py:130:12: W0105: String statement has no effect (pointless-string-statement)
bottles/backend/managers/dependency.py:144:12: W0105: String statement has no effect (pointless-string-statement)
bottles/backend/managers/dependency.py:160:12: W0105: String statement has no effect (pointless-string-statement)
bottles/backend/managers/dependency.py:177:12: W0105: String statement has no effect (pointless-string-statement)
bottles/backend/managers/dependency.py:449:12: C0103: Variable name "d" doesn't conform to snake_case naming style (invalid-name)
bottles/backend/managers/dependency.py:515:15: W0703: Catching too general exception Exception (broad-except)
bottles/backend/managers/dependency.py:515:8: C0103: Variable name "e" doesn't conform to snake_case naming style (invalid-name)
bottles/backend/managers/dependency.py:592:15: W0703: Catching too general exception Exception (broad-except)
bottles/backend/managers/dependency.py:566:20: C0103: Variable name "fg" doesn't conform to snake_case naming style (invalid-name)
bottles/backend/managers/dependency.py:592:8: C0103: Variable name "e" doesn't conform to snake_case naming style (invalid-name)
bottles/backend/managers/dependency.py:691:8: C0103: Variable name "rk" doesn't conform to snake_case naming style (invalid-name)
bottles/backend/managers/dependency.py:698:8: C0103: Variable name "rk" doesn't conform to snake_case naming style (invalid-name)

@dkeruza-neo
Copy link
Contributor

@Kinsteen Dammit, I just submitted a similar patch. But I also added info to the log for better debugging later.

@Kinsteen Kinsteen merged commit e247add into bottlesdevs:main Jan 22, 2023
@Kinsteen Kinsteen deleted the fix-patool branch January 22, 2023 09:22
Comment on lines +511 to +514
patoolib.extract_archive(os.path.join(Paths.temp, file), outdir=archive_path)
if archive_path.endswith(".tar"):
tar_path = os.path.join(archive_path, os.path.basename(archive_path))
patoolib.extract_archive(tar_path, outdir=archive_path)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to have broken d3dx9 dependency installation. The file d3dx9.tar.xz is extracted into the directory temp/d3dx9.tar/d3dx9 and nothing else need to be done (see the url definitions in d3dcompiler_47.yml). Previously there was a if os.path.isfile(ext_file) condition to avoid the second extracting, but now it is attempted anyways and gives an error temp/d3dx9.tar/d3dx9.tar was not found.

@otuva
Copy link

otuva commented Feb 23, 2023

Yeah I'm experiencing the d3dx9 one too.

File "/app/share/bottles/bottles/backend/managers/dependency.py", line 514, in __step_archive_extract
	    patoolib.extract_archive(tar_path, outdir=archive_path)
	  File "/app/lib/python3.10/site-packages/patoolib/__init__.py", line 681, in extract_archive
	    util.check_existing_filename(archive)
	  File "/app/lib/python3.10/site-packages/patoolib/util.py", line 398, in check_existing_filename
	    raise PatoolError("file `%s' was not found" % filename)
	patoolib.util.PatoolError: file `/home/tfp/.var/app/com.usebottles.bottles/data/bottles/temp/d3dx9.tar/d3dx9.tar' was not found

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: cjkfonts cannot installed.
5 participants