File: list_installed_dll_dependencies_cygwin.sh

package info (click to toggle)
numpy 1%3A1.24.2-1%2Bdeb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 44,720 kB
  • sloc: ansic: 188,931; python: 156,261; asm: 111,405; javascript: 32,693; cpp: 14,210; f90: 755; sh: 638; fortran: 478; makefile: 292; sed: 140; perl: 34
file content (35 lines) | stat: -rw-r--r-- 1,217 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/dash
# Check permissions and dependencies on installed DLLs
# DLLs need execute permissions to be used
# DLLs must be able to find their dependencies
# This checks both of those, then does a direct test
# The best way of checking whether a C extension module is importable
# is trying to import it.  The rest is trying to give reasons why it
# isn't importing.
#
# One of the tools and the extension for shared libraries are
# Cygwin-specific, but the rest should work on most platforms with
# /bin/sh

py_ver=${1}
dll_list=`/bin/dash tools/list_numpy_dlls.sh ${py_ver}`
echo "Checks for existence, permissions and file type"
ls -l ${dll_list}
file ${dll_list}
echo "Dependency checks"
ldd ${dll_list} | grep -F -e " => not found" && exit 1
cygcheck ${dll_list} >cygcheck_dll_list 2>cygcheck_missing_deps
grep -F -e "cygcheck: track_down: could not find " cygcheck_missing_deps && exit 1
echo "Import tests"
mkdir -p dist/
cd dist/
for name in ${dll_list};
do
    echo ${name}
    ext_module=`echo ${name} | \
                     sed -E \
			 -e "s/^\/+(home|usr).*?site-packages\/+//" \
			 -e "s/.cpython-3.m?-x86(_64)?-cygwin.dll$//" \
			 -e "s/\//./g"`
    python${py_ver} -c "import ${ext_module}"
done