made list-dependencies.sh more robust against paths with spaces