From 12a367c10d192f15912a63e26ce1ee14df7064ad Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Mon, 6 Jul 2026 14:50:01 +0200 Subject: netexec: fix venv relocation over bin/ dir contents --- netexec/netexec.SlackBuild | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/netexec/netexec.SlackBuild b/netexec/netexec.SlackBuild index 2594169..6b2d3ad 100644 --- a/netexec/netexec.SlackBuild +++ b/netexec/netexec.SlackBuild @@ -96,12 +96,16 @@ python3 -m venv $PKG$VENVDIR $PKG$VENVDIR/bin/pip install --no-index --no-deps --find-links=$TMP/wheels \ $TMP/wheels/*.whl +# Drop bytecode: it bakes in the build path and is non-reproducible; the +# interpreter regenerates it on first run. +find $PKG$VENVDIR -depth -type d -name __pycache__ -exec rm -rf {} + + # venvs are not relocatable: the absolute build path ($PKG$VENVDIR) is baked # into bin/* script shebangs and pyvenv.cfg. Rewrite it to the installed # prefix so the venv resolves at $VENVDIR after the package is installed. -sed -i "s|$PKG$VENVDIR|$VENVDIR|g" \ - $PKG$VENVDIR/pyvenv.cfg \ - $PKG$VENVDIR/bin/* +# Only rewrite regular files (bin/ also holds symlinks like python3). +sed -i "s|$PKG$VENVDIR|$VENVDIR|g" $PKG$VENVDIR/pyvenv.cfg +find $PKG$VENVDIR/bin -type f -exec sed -i "s|$PKG$VENVDIR|$VENVDIR|g" {} + # pip leaves the venv's own python as a symlink to the build host's python3; # that resolves fine on the target since it points at the system interpreter. -- cgit v1.2.3