Skip to content

Commit

Permalink
Make portage.util.compression_probe work when ctypes is unavailable
Browse files Browse the repository at this point in the history
This is useful for bootstrapping purposes, as _ctypes requires a dynamic
linker.

Closes: #1363
Signed-off-by: Mike Gilbert <floppym@gentoo.org>
  • Loading branch information
mid-kid authored and floppym committed Aug 15, 2024
1 parent 76615b8 commit 5ee1a19
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/portage/util/compression_probe.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Copyright 2015-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

import ctypes
import errno
import re


from portage import _encodings, _unicode_encode
from portage.exception import FileNotFound, PermissionDenied
from portage.util._ctypes import ctypes

_compressors = {
"bzip2": {
Expand Down Expand Up @@ -49,7 +49,7 @@
# if the current architecture can support it, which is true when
# sizeof(long) is at least 8 bytes.
"decompress": "zstd -d"
+ (" --long=31" if ctypes.sizeof(ctypes.c_long) >= 8 else ""),
+ (" --long=31" if ctypes and ctypes.sizeof(ctypes.c_long) >= 8 else ""),
"package": "app-arch/zstd",
},
}
Expand Down

0 comments on commit 5ee1a19

Please sign in to comment.