python.pkgs.pythonNamespacesHook: check parent directory exists before removing child

This commit is contained in:
Jonathan Ringer 2021-11-30 09:13:52 -08:00 committed by Jonathan Ringer
parent f56f3f7dcc
commit ae418d54d3

View file

@ -25,7 +25,12 @@ pythonNamespacesHook() {
fi
# remove ${pname}-${version}-${python-interpeter}-nspkg.pth
if [ -z ${dontRemovePth-} ]; then
#
# Still need to check that parent directory exists in the
# event of a "meta-package" package, which will just install
# other packages, but not produce anything in site-packages
# besides meta information
if [ -d "${constructedPath}/../" -a -z ${dontRemovePth-} ]; then
# .pth files are located in the parent directory of a module
@findutils@/bin/find ${constructedPath}/../ -name '*-nspkg.pth' -exec rm -v "{}" +
fi