Commit 9ee0cd0
committed
libmagic-sys-provided: let user override paths
let the user override assumed paths via environment.
lib_dir is probed first from LD_LIBRARY_PATH.
Location on libmagic.so can be overriden by passing path via LIBMAGIC
environment variable. If not found it falls back to lib_dir/libmagic.so.
Location of the magic database can be specified via MAGIC environment
variable. If not found it falls back to the previous bevahior.
With this patch it possible to run scancode is buildsystems like YOCTO,
which heaviily rely on overriding paths via environment to pick the
correct implementation from the build workspace
Signed-off-by: Konrad Weihmann <kweihmann@outlook.com>1 parent 42a870a commit 9ee0cd0
File tree
1 file changed
+31
-26
lines changed- builtins/typecode_libmagic_system_provided/src/typecode_libmagic
1 file changed
+31
-26
lines changedLines changed: 31 additions & 26 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
26 | 25 | | |
| 26 | + | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| |||
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
48 | 49 | | |
49 | | - | |
50 | | - | |
51 | | - | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
52 | 53 | | |
53 | | - | |
54 | | - | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
55 | 57 | | |
56 | | - | |
| 58 | + | |
| 59 | + | |
57 | 60 | | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
63 | 66 | | |
64 | | - | |
65 | | - | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
66 | 71 | | |
67 | 72 | | |
68 | 73 | | |
69 | | - | |
70 | | - | |
| 74 | + | |
| 75 | + | |
71 | 76 | | |
72 | 77 | | |
0 commit comments