#!/bin/sh

export HOME=$AUTOPKGTEST_TMP
export PATH=$PATH:$HOME/.local/bin
export PIP_DISABLE_PIP_VERSION_CHECK=1

if [ $(id -u) = 0 ]
then
    chown nobody:nogroup $HOME
    runuser="runuser -p -u nobody --"
else
    runuser=""
fi

$runuser pip install "world<4"
pip list --format=columns
pip show world
ls -ld $HOME/.local/lib/python2.*/site-packages/world-*.dist-info
$runuser pip uninstall -y world
pip list --format=columns

$runuser pip2 install "world<4"
pip2 list --format=columns
pip2 show world
ls -ld $HOME/.local/lib/python2.*/site-packages/world-*.dist-info
$runuser pip2 uninstall -y world
pip2 list --format=columns
