#!/bin/sh
# removing the package removes the downloaded files, and the game
# goes back to its own level sets, free sounds and free walls
set -e
dir=/usr/share/games/bubbros/bubbob/levels/fanlevels
test -s $dir/Arena.bin
apt-get remove -y bubbros-nonfree-installer
test ! -e $dir
test ! -e /usr/share/games/bubbros/nonfree
cd /usr/share/games/bubbros/bubbob
python3 - <<'PY'
import sys
sys.path[:0] = ['.', '../common']
import bb, gamesrv, images
assert gamesrv.soundpath('ext1/music.wav') == 'ext1/music.wav'
assert images.patdir == 'tmp', images.patdir
names = [n for n, p in bb.BubBobGame.FnListBoards()]
assert 'Levels' in names and 'Arena' not in names, names
print(names)
PY
