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

Allow unrar to overwrite files #512

Closed
wants to merge 3 commits into from
Closed

Allow unrar to overwrite files #512

wants to merge 3 commits into from

Conversation

cookie99999
Copy link
Contributor

On systems without the appropriate 7zip functionality, corrupt files will be created in the working directory, causing unrar to fail as its default behavior is to disallow overwriting files with the same names. Fixes #489

On systems without the appropriate 7zip functionality, corrupt files will be created in the working directory, causing unrar to fail as its default behavior is to disallow overwriting files with the same names.
Recommend to install p7zip-rar on Debian based systems, as it is needed to properly decompress rar files (As explained under "supported formats" on https://packages.debian.org/sid/p7zip-full).
@darodi
Copy link
Collaborator

darodi commented May 13, 2023

@cookie99999

What linux distribution are you using?
On ubuntu, I get this:

# unrar x -y -o+ -x__MACOSX -x.DS_Store -xthumbs.db -xThumbs.db test.rar
unrar: invalid option -- 'y'
Try `unrar --help' or `unrar --usage' for more information.
# unrar --help
Usage: unrar [OPTION...] ARCHIVE [FILE...] [DESTINATION]
Extract files from rar archives.

  -x, --extract              Extract files from archive (default)
  -t, --list                 List files in archive
  -f, --force                Overwrite files when extracting
      --extract-newer        Only extract newer files from the archive
      --extract-no-paths     Don't create directories while extracting
  -p, --password             Decrypt archive using a password
  -?, --help                 Give this help list
      --usage                Give a short usage message
  -V, --version              Print program version

We should maybe revert #370 instead

@cookie99999
Copy link
Contributor Author

I am using Debian 11 (stable). Strangely enough I get the same output as you when trying to use unrar manually, but it works from within the program.
p7zip-rar works fine, so for Debian based systems you don't need unrar as a fallback, however it seems other distros might not have an equivalent package.

@darodi
Copy link
Collaborator

darodi commented May 13, 2023

@cookie99999

I'm not sure this is needed. The recommended package for linux installation is flatpak and its 7z version manages rar files.
Could you give me an example of problem to test your PR?

On fedora, 7z gives an error (nothing is unrared) and then falls back to unrar.

@darodi
Copy link
Collaborator

darodi commented May 13, 2023

@cookie99999
Copy link
Contributor Author

cookie99999 commented May 13, 2023

I described the problem in my comment on #489 . The unrar fallback is not necessary on Debian based systems, you just have to install p7zip-rar. I was running from source, not using flatpak.
A better solution than my PR would probably be to merge #515 instead, but if 7z fails, advise the user to check if p7zip-rar is installed.

@darodi
Copy link
Collaborator

darodi commented May 13, 2023

thanks, I added your readme changes to #515

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.

Windows cannot convert cbr in version 5.6.1
2 participants