Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/distro_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
elif [ "$ID" = "arch" ]; then
pacman -Syu --noconfirm curl docker git bash base-devel
elif [ "$ID" = "fedora" ]; then
dnf install -y curl docker git bash gcc make openssl-devel bzip2-devel libffi-devel zlib-devel xz-devel tk-devel gdbm-devel readline-devel sqlite-devel python3-libdnf5
dnf install -y curl docker git bash gcc make patch p7zip p7zip-plugins openssl-devel bzip2-devel libffi-devel zlib-devel xz-devel tk-devel gdbm-devel readline-devel sqlite-devel python3-libdnf5
elif [ "$ID" = "gentoo" ]; then
echo "media-libs/libglvnd X" >> /etc/portage/package.use/libglvnd
emerge-webrsync
Expand Down
6 changes: 5 additions & 1 deletion bbot/core/helpers/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1333,7 +1333,11 @@ def which(*executables, path=None):
for e in executables:
location = shutil.which(e, path=path)
if location:
return location
# Resolve directory symlinks but preserve the binary name.
# This fixes native 7zip on Fedora where /usr/sbin -> bin symlink
# causes codec loading to fail when invoked as /usr/sbin/7z.
resolved_dir = os.path.realpath(os.path.dirname(location))
return os.path.join(resolved_dir, os.path.basename(location))


def search_dict_by_key(key, d):
Expand Down
8 changes: 4 additions & 4 deletions bbot/modules/internal/unarchive.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ class unarchive(BaseInternalModule):
async def setup(self):
self.ignore_compressions = ["application/java-archive", "application/vnd.android.package-archive"]
self.compression_methods = {
"zip": ["7z", "x", '-p""', "-aoa", "{filename}", "-o{extract_dir}/"],
"zip": ["7z", "x", "-aoa", "{filename}", "-o{extract_dir}/"],
"bzip2": ["tar", "--overwrite", "-xvjf", "{filename}", "-C", "{extract_dir}/"],
"xz": ["tar", "--overwrite", "-xvJf", "{filename}", "-C", "{extract_dir}/"],
"7z": ["7z", "x", '-p""', "-aoa", "{filename}", "-o{extract_dir}/"],
# "rar": ["7z", "x", '-p""', "-aoa", "{filename}", "-o{extract_dir}/"],
# "lzma": ["7z", "x", '-p""', "-aoa", "{filename}", "-o{extract_dir}/"],
"7z": ["7z", "x", "-aoa", "{filename}", "-o{extract_dir}/"],
# "rar": ["7z", "x", "-aoa", "{filename}", "-o{extract_dir}/"],
# "lzma": ["7z", "x", "-aoa", "{filename}", "-o{extract_dir}/"],
"tar": ["tar", "--overwrite", "-xvf", "{filename}", "-C", "{extract_dir}/"],
"gzip": ["tar", "--overwrite", "-xvzf", "{filename}", "-C", "{extract_dir}/"],
}
Expand Down
6 changes: 3 additions & 3 deletions bbot/test/test_step_2/module_tests/test_module_unarchive.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ async def setup_after_prep(self, module_test):
tar_file = temp_path / "test.tar"
tgz_file = temp_path / "test.tgz"
commands = [
("7z", "a", '-p""', "-aoa", f"{zip_file}", f"{text_file}"),
("7z", "a", '-p""', "-aoa", f"{zip_zip_file}", f"{zip_file}"),
("7z", "a", "-aoa", f"{zip_file}", f"{text_file}"),
("7z", "a", "-aoa", f"{zip_zip_file}", f"{zip_file}"),
("tar", "-C", f"{temp_path}", "-cvjf", f"{bz2_file}", f"{text_file.name}"),
("tar", "-C", f"{temp_path}", "-cvJf", f"{xz_file}", f"{text_file.name}"),
("7z", "a", '-p""', "-aoa", f"{zip7_file}", f"{text_file}"),
("7z", "a", "-aoa", f"{zip7_file}", f"{text_file}"),
# ("tar", "-C", f"{temp_path}", "--lzma", "-cvf", f"{lzma_file}", f"{text_file.name}"),
("tar", "-C", f"{temp_path}", "-cvf", f"{tar_file}", f"{text_file.name}"),
("tar", "-C", f"{temp_path}", "-cvzf", f"{tgz_file}", f"{text_file.name}"),
Expand Down