py-rules.mk: py.clean: Honour PY_UPDATE_INIT_PY
py.clean unconditionally runs scm.sh clean -f __init__.py, which deletes untracked __init__.py files in the source directory. In a package with PY_UPDATE_INIT_PY=false the build never generates __init__.py, as the generation rule in py-mod.mk is gated on the same variable. The __init__.py files in question are hand-written sources which are always tracked in SCM, and for those, "scm.sh clean" becomes a no-op, so with the current code, no real problem occurs, but explicitly protecting __init__.py from deletion if PY_UPDATE_INIT_PY is false is certainly more obvious. Move the __init__.py cleanup inside the PY_UPDATE_INIT_PY=true conditional so that py.clean only runs removal commands on files the build actually generates. Signed-off-by: Jan Lindemann <jan@janware.com> Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v0.84.2
This commit is contained in:
parent
0407215530
commit
5a3355b936
1 changed files with 3 additions and 1 deletions
|
|
@ -2,8 +2,10 @@ all:
|
|||
|
||||
py.clean:
|
||||
$(RM) -f *.done *.pyc *.rep
|
||||
/bin/bash $(JWB_SCRIPT_DIR)/scm.sh clean -f __init__.py
|
||||
$(RM) -rf __pycache__ .mypy_cache
|
||||
ifeq ($(PY_UPDATE_INIT_PY),true)
|
||||
/bin/bash $(JWB_SCRIPT_DIR)/scm.sh clean -f __init__.py
|
||||
endif
|
||||
|
||||
install-dirs.done:
|
||||
$(INSTALL) -d -m $(PYJWBDIRMODE) -o $(PYJWBDIROWNER) -g $(PYJWBDIRGROUP) $(PY_INSTALL_DIRS)
|
||||
|
|
|
|||
Loading…
Reference in a new issue