diff options
author | Mx Kookie <kookie@spacekookie.de> | 2020-12-09 18:55:19 +0000 |
---|---|---|
committer | Mx Kookie <kookie@spacekookie.de> | 2020-12-09 18:55:19 +0000 |
commit | 80d90d9b204f7c17912740f9f414fe5d59f293ba (patch) | |
tree | 5f2065a06e724270610760d59d01c6888b375a46 /infra/libkookie/nixpkgs/pkgs/development/interpreters/python/hooks/python-namespaces-hook.sh | |
parent | 3a31a84c7d3e589035ad08499206aac44a81f424 (diff) | |
parent | 83cbad92d73216bb0d9187c56cce0b91f9121d5a (diff) |
Merge commit '83cbad92d73216bb0d9187c56cce0b91f9121d5a' into main
Diffstat (limited to 'infra/libkookie/nixpkgs/pkgs/development/interpreters/python/hooks/python-namespaces-hook.sh')
-rw-r--r-- | infra/libkookie/nixpkgs/pkgs/development/interpreters/python/hooks/python-namespaces-hook.sh | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/infra/libkookie/nixpkgs/pkgs/development/interpreters/python/hooks/python-namespaces-hook.sh b/infra/libkookie/nixpkgs/pkgs/development/interpreters/python/hooks/python-namespaces-hook.sh index 50f21819d176..15d2bd0eb34c 100644 --- a/infra/libkookie/nixpkgs/pkgs/development/interpreters/python/hooks/python-namespaces-hook.sh +++ b/infra/libkookie/nixpkgs/pkgs/development/interpreters/python/hooks/python-namespaces-hook.sh @@ -17,16 +17,17 @@ pythonNamespacesHook() { for pathSegment in ${pathSegments[@]}; do constructedPath=${constructedPath}/${pathSegment} pathToRemove=${constructedPath}/__init__.py - pycachePath=${constructedPath}/__pycache__/__init__* + pycachePath=${constructedPath}/__pycache__/ + # remove __init__.py if [ -f "$pathToRemove" ]; then - echo "Removing $pathToRemove" - rm "$pathToRemove" + rm -v "$pathToRemove" fi - if [ -f "$pycachePath" ]; then - echo "Removing $pycachePath" - rm "$pycachePath" + # remove __pycache__/ entry, can be interpreter specific. E.g. __init__.cpython-38.pyc + # use null characters to perserve potential whitespace in filepath + if [ -d "$pycachePath" ]; then + @findutils@/bin/find "$pycachePath" -name '__init__*' -exec rm -v "{}" + fi done done |