conf / scripts: Fix unprivileged "make install" #71
Loading…
Reference in a new issue
No description provided.
Delete branch "jan/feature/20260818-conf-scripts-fix-unprivileged-make-install"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR fixes errors during "make install" as unprivileged user. It does little more than installing files into a fake root environment which in itself is not useful for anything meaningful. But users seeing errors during "make install" will understandably assume that something is very off, so this PR just fixes the errors.
defs.mk: Don't use plain /usr/bin/install
In a development tree, $(INSTALL) falls back to plain install(1), which refuses dead symlinks, so unprivileged "make install" fails outright. Packaging is unaffected, because the spec exports INSTALL_LOG, which already routes $(INSTALL) through "pkg.sh log-install"
Route the remaining $(INSTALL) defaults through $(LOG_INSTALL_SH) as well to address the failures: $(SUDO) jw.pkg log-install -p for DEVELOPMENT=false, plain jw.pkg log-install otherwise. Move -f $(PKG_FORMAT) out of $(LOG_INSTALL_SH) and into the two logging call sites, so the no-log paths don't carry a package format they never use.
pkg.sh: log-install: Don't log by default
cmd_log_install() defaults $c_logfile to "install.log", so every invocation without -l appends to an install.log in the current directory. That's semantical nonsense.
Default $c_logfile to empty instead. The existing empty-$c_logfile early exit already skips logging, so no -l now means no log, and callers that want a log pass -l explicitly, as the packaging flow does through INSTALL_LOG.
conf / scripts: Fix unprivileged "make install"
Unprivileged "make install" currently returns an error. That looks bad.
It actually is not a real problem, because unprivileged "make install" installs files into locations that are good for nothing, in the sense that they don't constitute a meaningful or usable hierarchy of installed files. Debugging / inspecting the install machinery itself is a valid use case, though, and it's easier to explain to the unsuspecting user that unprivileged installation is something akin to shooting range training than why "make install" outright errors out, so fix the error messages.