aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJessica Clarke <jrtc27@FreeBSD.org>2023-06-08 17:35:23 +0000
committerJessica Clarke <jrtc27@FreeBSD.org>2023-06-08 18:14:12 +0000
commit2e0d99a953ef30ad29b3c0143c0aa7a815cf8ef1 (patch)
treed9655a6501b6e60127078f938aea89fb187ff610
parent469727c966bbd91447c8402470452b95810f3ffe (diff)
downloadsrc-2e0d99a953ef30ad29b3c0143c0aa7a815cf8ef1.tar.gz
src-2e0d99a953ef30ad29b3c0143c0aa7a815cf8ef1.zip
Makefile.inc1: Fix distributeworld mtree mangling for dist root dir
The trailing slash means that ./base itself doesn't get mangled and remains as-is in the output, leading to a stray /base in base.txz for NO_ROOT builds and thus in the installed system. Since this action is running on a line whose file matches one listed by find (and we're printing all of these as part of that distribution), we don't need to care about the possibility of a path like ./basefoo/bar where the path prefix isn't ./base, and can thus just drop the slash rather than needing something more complicated like "slash or whitespace or EOL" as one might first think.
-rw-r--r--Makefile.inc14
1 files changed, 2 insertions, 2 deletions
diff --git a/Makefile.inc1 b/Makefile.inc1
index 88ae6dadd8a1..09267b8f69c2 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -1482,7 +1482,7 @@ distributeworld installworld stageworld: _installcheck_world .PHONY
@# the relevant mtree line.
cd ${DESTDIR}/${DISTDIR}; \
find ./${dist} | ${METALOG_SORT_CMD} -u ${METALOG} - | \
- awk 'BEGIN { print "#${MTREE_MAGIC}" } !/ type=/ { file = $$1 } / type=/ { if ($$1 == file) { sub(/^\.\/${dist}\//, "./"); print } }' > \
+ awk 'BEGIN { print "#${MTREE_MAGIC}" } !/ type=/ { file = $$1 } / type=/ { if ($$1 == file) { sub(/^\.\/${dist}/, "."); print } }' > \
${DESTDIR}/${DISTDIR}/${dist}.meta
.endfor
.for dist in ${DEBUG_DISTRIBUTIONS}
@@ -1492,7 +1492,7 @@ distributeworld installworld stageworld: _installcheck_world .PHONY
@# the relevant mtree line.
cd ${DESTDIR}/${DISTDIR}; \
find ./${dist}/usr/lib/debug | ${METALOG_SORT_CMD} -u ${METALOG} - | \
- awk 'BEGIN { print "#${MTREE_MAGIC}" } !/ type=/ { file = $$1 } / type=/ { if ($$1 == file) { sub(/^\.\/${dist}\//, "./"); print } }' > \
+ awk 'BEGIN { print "#${MTREE_MAGIC}" } !/ type=/ { file = $$1 } / type=/ { if ($$1 == file) { sub(/^\.\/${dist}/, "."); print } }' > \
${DESTDIR}/${DISTDIR}/${dist}.debug.meta
.endfor
.endif