From: Simon McVittie Date: Mon, 20 Aug 2018 15:30:42 +0000 (+0100) Subject: tests: Remove vestigial support for putting Python 2 in a runtime X-Git-Tag: archive/raspbian/1.0.2-1+rpi1~1^2^2~4 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=2116e78645d29b1889703491ec55bb0df19071ee;p=flatpak.git tests: Remove vestigial support for putting Python 2 in a runtime This is only used in the flatpak-builder tests now, not the main flatpak tests. Signed-off-by: Simon McVittie Forwarded: https://github.com/flatpak/flatpak/pull/1990 Gbp-Pq: Name tests-Remove-vestigial-support-for-putting-Python-2-in-a-.patch --- diff --git a/tests/libtest.sh b/tests/libtest.sh index 0d22fa1..4154b7b 100644 --- a/tests/libtest.sh +++ b/tests/libtest.sh @@ -271,19 +271,6 @@ setup_sdk_repo () { update_repo $REPONAME "${COLLECTION_ID}" } -setup_python2_repo () { - REPONAME=${1:-test} - if [ x${USE_COLLECTIONS_IN_SERVER-} == xyes ] ; then - COLLECTION_ID=${2:-org.test.Collection.${REPONAME}} - else - COLLECTION_ID="" - fi - - GPGARGS="${GPGARGS:-${FL_GPGARGS}}" . $(dirname $0)/make-test-runtime.sh ${REPONAME} org.test.PythonPlatform "${COLLECTION_ID}" bash python2 ls cat echo rm readlink > /dev/null - GPGARGS="${GPGARGS:-${FL_GPGARGS}}" . $(dirname $0)/make-test-runtime.sh ${REPONAME} org.test.PythonSdk "${COLLECTION_ID}" python2 bash ls cat echo rm readlink make mkdir cp touch > /dev/null - update_repo $REPONAME "${COLLECTION_ID}" -} - install_repo () { REPONAME=${1:-test} ${FLATPAK} ${U} install -y ${REPONAME}-repo org.test.Platform master @@ -295,12 +282,6 @@ install_sdk_repo () { ${FLATPAK} ${U} install -y ${REPONAME}-repo org.test.Sdk master } -install_python2_repo () { - REPONAME=${1:-test} - ${FLATPAK} ${U} install -y ${REPONAME}-repo org.test.PythonPlatform master - ${FLATPAK} ${U} install -y ${REPONAME}-repo org.test.PythonSdk master -} - run () { ${CMD_PREFIX} flatpak run "$@" @@ -322,13 +303,6 @@ skip_without_bwrap () { fi } -skip_without_python2 () { - 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 -} - sed s#@testdir@#${test_builddir}# ${test_srcdir}/session.conf.in > session.conf dbus-daemon --fork --config-file=session.conf --print-address=3 --print-pid=4 \ 3> dbus-session-bus-address 4> dbus-session-bus-pid diff --git a/tests/make-test-runtime.sh b/tests/make-test-runtime.sh index 0fd9573..9ba3711 100755 --- a/tests/make-test-runtime.sh +++ b/tests/make-test-runtime.sh @@ -61,31 +61,6 @@ add_bin() { for i in $@; do I=`which $i` add_bin $I - if test $i == python2; then - 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 ${PYDIR}/$py.py ${DIR}/usr/lib/python2.7 - done - # These might not exist, depending how Python was configured; and the - # part after ${so} might be "module" or ".x86_64-linux-gnu" or - # something else - for so in _locale strop ; do - cp ${PYDIR}/lib-dynload/${so}*.so ${DIR}/usr/lib/python2.7/lib-dynload || : - done - for plat in $( cd ${PYDIR} && echo plat-* ); do - test -e ${PYDIR}/${plat} || continue - mkdir -p ${DIR}/usr/lib/python2.7/${plat} - cp ${PYDIR}/${plat}/*.py ${DIR}/usr/lib/python2.7/${plat}/ - done - fi done for i in `cat $BINS`; do echo Adding binary $i 1>&2