mirror of
git://git.gnupg.org/gnupg.git
synced 2024-11-10 21:38:50 +01:00
tests: Fix Python detection.
* tests/gpgme/gpgme-defs.scm (python): Fix Python detection. -- In 25e6444b3f4601c7821beab06bc4520deacb007b we changed the way GPGME creates the build directory for the Python bindings. We now use the basename of the interpreter as an identifier, that means we have to get the base name right, a link to the same binary is not sufficient. Signed-off-by: Justus Winter <justus@g10code.com>
This commit is contained in:
parent
d2f6798621
commit
ef1922b3b1
@ -167,13 +167,15 @@
|
|||||||
(expand-one (append acc (list (car v))) (cdr v))))))
|
(expand-one (append acc (list (car v))) (cdr v))))))
|
||||||
values)))
|
values)))
|
||||||
|
|
||||||
(define python (catch #f
|
(define python
|
||||||
(path-expand "python" (string-split (getenv "PATH") *pathsep*))))
|
(let loop ((pythons (list "python" "python2" "python3")))
|
||||||
|
(if (null? pythons)
|
||||||
|
#f
|
||||||
|
(catch (loop (cdr pythons))
|
||||||
|
(unless (file-exists? (path-join gpgme-builddir "lang" "python"
|
||||||
|
(string-append (car pythons) "-gpg")))
|
||||||
|
(throw "next please"))
|
||||||
|
(path-expand (car pythons) (string-split (getenv "PATH") *pathsep*))))))
|
||||||
|
|
||||||
(define (run-python-tests?)
|
(define (run-python-tests?)
|
||||||
(and python
|
(not (not python)))
|
||||||
(let* ((python-version
|
|
||||||
(string-trim char-whitespace?
|
|
||||||
(call-popen `(,python -c "import sys; print('{0}.{1}'.format(sys.version_info[0], sys.version_info[1]))") "")))
|
|
||||||
(build-path (path-join gpgme-builddir "lang" "python"
|
|
||||||
(string-append "python" python-version "-gpg"))))
|
|
||||||
(file-exists? build-path))))
|
|
||||||
|
Loading…
Reference in New Issue
Block a user