From d77d6cde40fb47a926ce00a4d32e6424eb209fd2 Mon Sep 17 00:00:00 2001 From: Alessio Sergi Date: Thu, 27 Oct 2016 15:17:02 +0200 Subject: [PATCH] xbps-src: limit the search to the /usr/lib/pythonX.Y directory --- common/hooks/post-install/04-create-xbps-metadata-scripts.sh | 2 +- common/hooks/pre-pkg/03-rewrite-python-shebang.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/common/hooks/post-install/04-create-xbps-metadata-scripts.sh b/common/hooks/post-install/04-create-xbps-metadata-scripts.sh index 090e27e4a7c..15a6aae305f 100644 --- a/common/hooks/post-install/04-create-xbps-metadata-scripts.sh +++ b/common/hooks/post-install/04-create-xbps-metadata-scripts.sh @@ -232,7 +232,7 @@ _EOF # Handle python bytecode archives with pycompile trigger. # if [ -d ${PKGDESTDIR}/usr/lib/python* ]; then - pycompile_version="$(find ${PKGDESTDIR}/usr/lib/python* -type d | grep -o '[[:digit:]]\.[[:digit:]]$')" + pycompile_version="$(find ${PKGDESTDIR}/usr/lib/python* -prune -type d | grep -o '[[:digit:]]\.[[:digit:]]$')" fi if [ -n "${pycompile_dirs}" -o -n "${pycompile_module}" ]; then diff --git a/common/hooks/pre-pkg/03-rewrite-python-shebang.sh b/common/hooks/pre-pkg/03-rewrite-python-shebang.sh index e42b28a3bb9..2c95cd6005e 100644 --- a/common/hooks/pre-pkg/03-rewrite-python-shebang.sh +++ b/common/hooks/pre-pkg/03-rewrite-python-shebang.sh @@ -11,7 +11,7 @@ hook() { fi if [ -d ${PKGDESTDIR}/usr/lib/python* ]; then - pyver="$(find ${PKGDESTDIR}/usr/lib/python* -type d | grep -o '[[:digit:]]\.[[:digit:]]$')" + pyver="$(find ${PKGDESTDIR}/usr/lib/python* -prune -type d | grep -o '[[:digit:]]\.[[:digit:]]$')" fi if [ -n "$pycompile_version" ]; then