Fix install-missing-packages when port is missing multiple dependencies The current implementation of install-missing-packages does not handle correctly the situation when a port is missing multiple dependencies. pkg(8) would only get the first missing origin as an argument. All the other origins would be listed on new lines and would not be passed to pkg(8). This patch replaces newlines with spaces to avoid this problem. An alternative solution would be to replace ECHO_CMD with "printf %s" and unquote the _dirs variable. The implemented solution is cleaner, however, in my opinion (less magical).
Details
Details
- Reviewers
mat trasz - Group Reviewers
O5: Ports Framework portmgr - Commits
- rP529956: Fix install-missing-packages when port is missing multiple dependencies
Test with both default SU_CMD and SU_CMD= /usr/local/bin/sudo -E sh -c set in /etc/make.conf.
Diff Detail
Diff Detail
- Repository
- rP FreeBSD ports repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Mk/bsd.port.mk | ||
---|---|---|
4338 ↗ | (On Diff #68683) | I would use | ${XARGS} which will take care of that. |
Mk/bsd.port.mk | ||
---|---|---|
4338 ↗ | (On Diff #68683) | Hmm, sure, although I think that tr is more explicit. |
Mk/bsd.port.mk | ||
---|---|---|
4338 ↗ | (On Diff #68683) | This should be ${SU_CMD} "${ECHO_CMD} \"$${_dirs}\" | ${SED} 's%${PORTSDIR}/%%g' | ${XARGS} ${PKG_BIN} install -A" or even better push the su outwards as much as possible ${ECHO_CMD} "$${_dirs}" | ${SED} "s%${PORTSDIR}/%%g" | ${SU_CMD} "${XARGS} ${PKG_BIN} install -A" |
Mk/bsd.port.mk | ||
---|---|---|
4338 ↗ | (On Diff #68683) | I see. Luckily there seems to be an xargs(1) flag for exactly that, -o: ${ECHO_CMD} "$${_dirs}" | ${SED} "s%${PORTSDIR}/%%g" | ${SU_CMD} "${XARGS} -o ${PKG_BIN} install -A" |
Mk/bsd.port.mk | ||
---|---|---|
4338 ↗ | (On Diff #68683) | Ha! I didn't know about this one! Thanks. |