mirror of
https://github.com/flatpak/flatpak.git
synced 2026-05-18 21:55:22 -04:00
tests: Fix python2 use
This commit is contained in:
@@ -242,7 +242,7 @@ skip_without_bwrap () {
|
||||
}
|
||||
|
||||
skip_without_python2 () {
|
||||
if ! test -f /usr/bin/python2 || ! test -f /usr/lib*/python2.7/os.py ; then
|
||||
if ! test -f /usr/bin/python2 || ! /usr/bin/python2 -c "import sys; sys.exit(0 if sys.version_info >= (2, 7) else 1)" ; then
|
||||
echo "1..0 # SKIP this test requires /usr/bin/python2 (2.7) support"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
@@ -24,15 +24,17 @@ for i in $@; do
|
||||
mkdir -p ${DIR}/usr/lib/python2.7/lib-dynload
|
||||
# This is a hardcoded minimal set of modules we need in the current tests.
|
||||
# Pretty hacky stuff. Add modules as needed.
|
||||
PYDIR=/usr/lib/python2.7
|
||||
if test -d /usr/lib64/python2.7; then PYDIR=/usr/lib64/python2.7; fi
|
||||
for py in site os stat posixpath genericpath warnings \
|
||||
linecache types UserDict abc _abcoll \
|
||||
_weakrefset copy_reg traceback sysconfig \
|
||||
re sre_compile sre_parse sre_constants \
|
||||
_sysconfigdata ; do
|
||||
cp /usr/lib*/python2.7/$py.py ${DIR}/usr/lib/python2.7
|
||||
cp ${PYDIR}/$py.py ${DIR}/usr/lib/python2.7
|
||||
done
|
||||
for so in _locale strop ; do
|
||||
cp /usr/lib*/python2.7/lib-dynload/${so}module.so ${DIR}/usr/lib/python2.7/lib-dynload
|
||||
cp ${PYDIR}/lib-dynload/${so}module.so ${DIR}/usr/lib/python2.7/lib-dynload
|
||||
done
|
||||
fi
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user