| 1 |
From 407949994bcd8f827a0963592018a65c9cc8a9e4 Mon Sep 17 00:00:00 2001 |
| 2 |
From: SVN-Git Migration <[email protected]> |
| 3 |
Date: Thu, 8 Oct 2015 13:29:41 -0700 |
| 4 |
Subject: Hardcode the libudev SONAME that the package depends on. |
| 5 |
|
| 6 |
This makes sure that we don't load an untested ABI. |
| 7 |
Bu-Debian: https://bugs.debian.org/722573 |
| 8 |
|
| 9 |
Patch-Name: libudev_loading.diff |
| 10 |
--- |
| 11 |
src/pyudev/_ctypeslib/utils.py | 5 ++++- |
| 12 |
src/pyudev/core.py | 2 +- |
| 13 |
2 files changed, 5 insertions(+), 2 deletions(-) |
| 14 |
|
| 15 |
Index: pyudev/src/pyudev/_ctypeslib/utils.py |
| 16 |
=================================================================== |
| 17 |
--- pyudev.orig/src/pyudev/_ctypeslib/utils.py |
| 18 |
+++ pyudev/src/pyudev/_ctypeslib/utils.py |
| 19 |
@@ -46,7 +46,10 @@ def load_ctypes_library(name, signatures |
| 20 |
:rtype: ctypes.CDLL |
| 21 |
:raises ImportError: if the library is not found |
| 22 |
""" |
| 23 |
- library_name = find_library(name) |
| 24 |
+ if ".so" in name: |
| 25 |
+ library_name = name |
| 26 |
+ else: |
| 27 |
+ library_name = find_library(name) |
| 28 |
if not library_name: |
| 29 |
raise ImportError(f"No library named {name}") |
| 30 |
lib = CDLL(library_name, use_errno=True) |
| 31 |
Index: pyudev/src/pyudev/core.py |
| 32 |
=================================================================== |
| 33 |
--- pyudev.orig/src/pyudev/core.py |
| 34 |
+++ pyudev/src/pyudev/core.py |
| 35 |
@@ -56,7 +56,7 @@ class Context: |
| 36 |
""" |
| 37 |
Create a new context. |
| 38 |
""" |
| 39 |
- self._libudev = load_ctypes_library("udev", SIGNATURES, ERROR_CHECKERS) |
| 40 |
+ self._libudev = load_ctypes_library('libudev.so.1', SIGNATURES, ERROR_CHECKERS) |
| 41 |
self._as_parameter_ = self._libudev.udev_new() |
| 42 |
|
| 43 |
def __del__(self): |