ib / xarchiver

(continuation of the Xfce master branch)
GNU General Public License v2.0
170 stars 40 forks source link

RAR not supported on Fedora with #177

Closed etiennemlb closed 1 year ago

etiennemlb commented 1 year ago

In #117 I erroneously mentioned that XArchiver rejected opening a RAR archive with its extension renamed to .cbr (a EBook format).

It turns out that the main issue seems to come from Fedora 38's p7zip-plugins package which provides a 7z binary not supporting RAR anymore. As per man 7z(1), RAR (it was removed due a non-free license).

I am using 7z version 16.02 and here are some strace logs.

$ strace -f -- xarchiver test.rar 2>&1 | grep exec 
execve("/usr/bin/xarchiver", ["xarchiver", "test.rar"], 0x7ffe160b7d38 /* 57 vars */) = 0
[pid 12601] execve("/usr/bin/zstd", ["/usr/bin/zstd", "-h"], 0x7ffcc3fb9b50 /* 57 vars */ <unfinished ...>
[pid 12601] <... execve resumed>)       = 0
[pid 12604] execve("/usr/bin/7z", ["/usr/bin/7z", "-trar", "l", "-slt", "/home/XXX/Downloads/trash/tes"...], 0x7ffcc3fb9b50 /* 57 vars */ <unfinished ...>
[pid 12604] <... execve resumed>)       = 0
[pid 12604] read(3, "#!/usr/bin/sh\n\"/usr/libexec/p7zi"..., 80) = 43
[pid 12604] read(255, "#!/usr/bin/sh\n\"/usr/libexec/p7zi"..., 43) = 43
[pid 12605] execve("/usr/libexec/p7zip/7z", ["/usr/libexec/p7zip/7z", "-trar", "l", "-slt", "/home/XXX/Downloads/trash/tes"...], 0x55ffa12c9a40 /* 56 vars */) = 0
[pid 12605] openat(AT_FDCWD, "/usr/libexec/p7zip/7z.so", O_RDONLY|O_CLOEXEC) = 3
[pid 12605] openat(AT_FDCWD, "/usr/libexec/p7zip/Codecs", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or directory)
[pid 12605] openat(AT_FDCWD, "/usr/libexec/p7zip/Codecs", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or directory)
[pid 12605] openat(AT_FDCWD, "/usr/libexec/p7zip/Formats", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or directory)
[pid 12605] openat(AT_FDCWD, "/usr/libexec/p7zip/Formats", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or directory)
[pid 12606] execve("/usr/bin/7z", ["/usr/bin/7z", "-trar", "l", "/home/XXX/Downloads/trash/tes"...], 0x7ffcc3fb9b50 /* 57 vars */ <unfinished ...>
[pid 12606] <... execve resumed>)       = 0
[pid 12606] read(4, "#!/usr/bin/sh\n\"/usr/libexec/p7zi"..., 80) = 43
[pid 12606] read(255, "#!/usr/bin/sh\n\"/usr/libexec/p7zi"..., 43) = 43
[pid 12607] execve("/usr/libexec/p7zip/7z", ["/usr/libexec/p7zip/7z", "-trar", "l", "/home/XXX/Downloads/trash/tes"...], 0x558fd391ea40 /* 56 vars */ <unfinished ...>
[pid 12607] <... execve resumed>)       = 0
[pid 12607] openat(AT_FDCWD, "/usr/libexec/p7zip/7z.so", O_RDONLY|O_CLOEXEC <unfinished ...>
[pid 12607] openat(AT_FDCWD, "/usr/libexec/p7zip/Codecs", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY <unfinished ...>
[pid 12607] openat(AT_FDCWD, "/usr/libexec/p7zip/Codecs", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY <unfinished ...>
[pid 12607] openat(AT_FDCWD, "/usr/libexec/p7zip/Formats", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY <unfinished ...>
[pid 12607] openat(AT_FDCWD, "/usr/libexec/p7zip/Formats", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or directory)
$ 7z -trar l -slt test.rar 

7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21
p7zip Version 16.02 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,64 bits,XXX Intel(R) Core(TM) XXXX,ASM,AES-NI)

ERROR:
Unsupported archive type

Which tools, still available on Fedora, can be used to produce and ingest RAR archives and is it already supported by XArchiver.

ib commented 1 year ago

I don't know about Fedora, but there are Linux console versions (binaries and source) available directly from 7-zip.org and the UnRAR source from rarlab.com.

p7zip is IMO outdated and obsolete.

BTW, the missing MIME type support to be able to open it from a file manager will be added as soon as I find time.

etiennemlb commented 1 year ago

@ib I may have missed something, but AFAIK, XArchiver does deduce correctly that the .cbr file is a RAR file.

etiennemlb commented 1 year ago

There, it calls 7z as it should, assuming it supports RAR

$ strace -f -- xarchiver test.cbr 2>&1 | grep exec 
execve("/usr/bin/xarchiver", ["xarchiver", "test.cbr"], 0x7ffc6a7d3618 /* 57 vars */) = 0
[pid 13525] execve("/usr/bin/zstd", ["/usr/bin/zstd", "-h"], 0x7ffc12d94070 /* 57 vars */ <unfinished ...>
[pid 13525] <... execve resumed>)       = 0
[pid 13528] execve("/usr/bin/7z", ["/usr/bin/7z", "-trar", "l", "-slt", "/home/XXX/Downloads/trash/tes"...], 0x7ffc12d94070 /* 57 vars */ <unfinished ...>
[pid 13528] <... execve resumed>)       = 0
[pid 13528] read(3, "#!/usr/bin/sh\n\"/usr/libexec/p7zi"..., 80) = 43
[pid 13528] read(255, "#!/usr/bin/sh\n\"/usr/libexec/p7zi"..., 43) = 43
[pid 13529] execve("/usr/libexec/p7zip/7z", ["/usr/libexec/p7zip/7z", "-trar", "l", "-slt", "/home/XXX/Downloads/trash/tes"...], 0x557ab7fcfa30 /* 56 vars */) = 0
[pid 13529] openat(AT_FDCWD, "/usr/libexec/p7zip/7z.so", O_RDONLY|O_CLOEXEC) = 3
[pid 13529] openat(AT_FDCWD, "/usr/libexec/p7zip/Codecs", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or directory)
[pid 13529] openat(AT_FDCWD, "/usr/libexec/p7zip/Codecs", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or directory)
[pid 13529] openat(AT_FDCWD, "/usr/libexec/p7zip/Formats", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or directory)
[pid 13529] openat(AT_FDCWD, "/usr/libexec/p7zip/Formats", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or directory)
[pid 13530] execve("/usr/bin/7z", ["/usr/bin/7z", "-trar", "l", "/home/XXX/Downloads/trash/tes"...], 0x7ffc12d94070 /* 57 vars */ <unfinished ...>
[pid 13530] <... execve resumed>)       = 0
[pid 13530] read(4, "#!/usr/bin/sh\n\"/usr/libexec/p7zi"..., 80) = 43
[pid 13530] read(255, "#!/usr/bin/sh\n\"/usr/libexec/p7zi"..., 43) = 43
[pid 13531] execve("/usr/libexec/p7zip/7z", ["/usr/libexec/p7zip/7z", "-trar", "l", "/home/XXX/Downloads/trash/tes"...], 0x561e12effa30 /* 56 vars */ <unfinished ...>
[pid 13531] <... execve resumed>)       = 0
ib commented 1 year ago

Yes, but you can't open .cbr with your file manager, but you can open .cbz this way.

sharkcz commented 1 year ago

tools for RAR support live at https://rpmfusion.org/

ib commented 1 year ago

Extension cbr and all other comic book file extensions are now associated with xarchiver (in master).