From 259bd5c13f97907a25dbb2157b57e401dea81537 Mon Sep 17 00:00:00 2001 From: ngie Date: Tue, 20 Jan 2015 23:39:08 +0000 Subject: [PATCH] MFC r275907: r275907 (by ngie): Fix building/installing tests when TESTSBASE != /usr/tests The work in r258233 hardcoded the assumption that tests was the last component of the tests tree by pushing tests as an explicit prefix for the paths in BSD.tests.dist and /usr was the prefix for all tests, per BSD.usr.dist and all of the mtree calls used in Makefile.inc1. This assumption breaks if/when one provides a custom TESTSBASE "prefix", e.g. TESTSBASE=/mytests . One thing that r258233 did properly though was remove "/usr/tests" creation from BSD.usr.dist -- that should have not been there in the first place. That was an "oops" on my part for the work that was originally committed in r241823 Phabric: D1301 Reviewed by: imp Sponsored by: EMC / Isilon Storage Division --- Makefile.inc1 | 9 +- etc/Makefile | 4 +- etc/mtree/BSD.include.dist | 4 + etc/mtree/BSD.tests.dist | 692 +++++++++++------------ etc/mtree/BSD.usr.dist | 6 + tools/build/mk/OptionalObsoleteFiles.inc | 6 +- 6 files changed, 360 insertions(+), 361 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index b6a3f03f620e..b76c63b2f09c 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -513,8 +513,9 @@ _worldtmp: -p ${WORLDTMP}/usr/lib >/dev/null .endif .if ${MK_TESTS} != "no" + mkdir -p ${WORLDTMP}${TESTSBASE} mtree -deU -f ${.CURDIR}/etc/mtree/BSD.tests.dist \ - -p ${WORLDTMP}/usr >/dev/null + -p ${WORLDTMP}${TESTSBASE} >/dev/null .endif .for _mtree in ${LOCAL_MTREE} mtree -deU -f ${.CURDIR}/${_mtree} -p ${WORLDTMP} > /dev/null @@ -853,8 +854,9 @@ distributeworld installworld: _installcheck_world -p ${DESTDIR}/${DISTDIR}/${dist}/usr/lib >/dev/null .endif .if ${MK_TESTS} != "no" && ${dist} == "tests" + -mkdir -p ${DESTDIR}/${DISTDIR}/${dist}${TESTSBASE} mtree -deU -f ${.CURDIR}/etc/mtree/BSD.tests.dist \ - -p ${DESTDIR}/${DISTDIR}/${dist}/usr >/dev/null + -p ${DESTDIR}/${DISTDIR}/${dist}${TESTSBASE} >/dev/null .endif .if defined(NO_ROOT) ${IMAKEENV} nmtree -C -f ${.CURDIR}/etc/mtree/BSD.root.dist | \ @@ -1997,8 +1999,9 @@ _xi-mtree: mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \ -p ${XDDESTDIR}/usr/include >/dev/null .if ${MK_TESTS} != "no" + mkdir -p ${XDDESTDIR}${TESTSBASE} mtree -deU -f ${.CURDIR}/etc/mtree/BSD.tests.dist \ - -p ${XDDESTDIR}/usr >/dev/null + -p ${XDDESTDIR}${TESTSBASE} >/dev/null .endif .ORDER: xdev-build _xi-mtree _xi-cross-tools _xi-includes _xi-libraries _xi-links diff --git a/etc/Makefile b/etc/Makefile index b1013e60f0e6..85dad70aace8 100644 --- a/etc/Makefile +++ b/etc/Makefile @@ -327,7 +327,7 @@ MTREES+= mtree/BSD.debug.dist /usr/lib MTREES+= mtree/BSD.groff.dist /usr .endif .if ${MK_TESTS} != "no" -MTREES+= mtree/BSD.tests.dist /usr +MTREES+= mtree/BSD.tests.dist ${TESTSBASE} .endif .if ${MK_SENDMAIL} != "no" MTREES+= mtree/BSD.sendmail.dist / @@ -343,6 +343,7 @@ distrib-dirs: ${MTREES:N/*} shift; \ d=${DESTDIR}$$1; \ shift; \ + test -d $$d || mkdir -p $$d; \ ${ECHO} ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} \ -f $$m -p $$d; \ ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} -f $$m -p $$d; \ @@ -356,6 +357,7 @@ distrib-dirs: ${MTREES:N/*} test "$$d" == "/" && d=""; \ d=${DISTBASE}$$d; \ shift; \ + test -d $$d || mkdir -p $$d; \ ${ECHO} "${MTREE_CMD:N-W} -C -f $$m -K uname,gname | " \ "sed s#^\.#.$$d# | ${METALOG.add}" ; \ ${MTREE_CMD:N-W} -C -f $$m -K uname,gname | sed s#^\.#.$$d# | \ diff --git a/etc/mtree/BSD.include.dist b/etc/mtree/BSD.include.dist index ee9cc9bc9b07..011fa619f8f4 100644 --- a/etc/mtree/BSD.include.dist +++ b/etc/mtree/BSD.include.dist @@ -9,6 +9,10 @@ .. arpa .. + atf-c + .. + atf-c++ + .. bsm .. bsnmp diff --git a/etc/mtree/BSD.tests.dist b/etc/mtree/BSD.tests.dist index 0c6df5909cd6..da5de5abab2f 100644 --- a/etc/mtree/BSD.tests.dist +++ b/etc/mtree/BSD.tests.dist @@ -5,394 +5,378 @@ /set type=dir uname=root gname=wheel mode=0755 . - include - atf-c + bin + chown .. - atf-c++ + date + .. + mv + .. + pax + .. + pkill + .. + sh + builtins + .. + errors + .. + execution + .. + expansion + .. + parameters + .. + parser + .. + set-e + .. + .. + sleep + .. + test + .. + .. + cddl + lib + .. + sbin + .. + usr.bin + .. + usr.sbin + .. + .. + etc + .. + games + .. + gnu + lib + .. + usr.bin + diff + .. + .. + .. + lib + atf + libatf-c + detail + .. + .. + libatf-c++ + detail + .. + .. + test-programs + .. + .. + libc + c063 + .. + db + .. + gen + execve + .. + posix_spawn + .. + .. + hash + data + .. + .. + inet + .. + locale + .. + net + getaddrinfo + data + .. + .. + .. + regex + data + .. + .. + ssp + .. + stdio + .. + stdlib + .. + string + .. + sys + .. + time + .. + tls + dso + .. + .. + termios + .. + ttyio + .. + .. + libcrypt + .. + libmp + .. + librt + .. + libthr + dlopen + .. + .. + libutil + .. + msun + .. + .. + libexec + atf + atf-check + .. + atf-sh + .. + .. + .. + sbin + dhclient + .. + devd + .. + growfs + .. + mdconfig + .. + .. + secure + lib + .. + libexec + .. + usr.bin + .. + usr.sbin .. .. share - atf - .. - doc - atf - .. - pjdfstest + examples + tests + atf + .. + plain + .. .. .. .. - tests - bin - date - .. - mv - .. - pax - .. - pkill - .. - sh - builtins - .. - errors - .. - execution - .. - expansion - .. - parameters - .. - parser - .. - set-e - .. - .. - sleep - .. - test - .. + sys + kern .. - cddl - lib - .. - sbin - .. - usr.bin - .. - usr.sbin - .. + netinet .. - etc - .. - games - .. - gnu - lib + pjdfstest + chflags .. - usr.bin - diff - .. + chmod .. - .. - lib - atf - libatf-c - detail - .. - .. - libatf-c++ - detail - .. - .. - test-programs - .. + chown .. - libc - c063 - .. - db - .. - gen - execve - .. - posix_spawn - .. - .. - hash - data - .. - .. - inet - .. - locale - .. - net - getaddrinfo - data - .. - .. - .. - regex - data - .. - .. - ssp - .. - stdio - .. - stdlib - .. - string - .. - sys - .. - time - .. - tls - dso - .. - .. - termios - .. - ttyio - .. + ftruncate .. - libcrypt + granular .. - libmp + link .. - librt + mkdir .. - libthr - dlopen - .. + mkfifo .. - libutil + mknod .. - msun + open .. - .. - libexec - atf - atf-check - .. - atf-sh - .. + rename .. - .. - sbin - dhclient + rmdir .. - devd - .. - growfs - .. - mdconfig - .. - .. - secure - lib - .. - libexec - .. - usr.bin - .. - usr.sbin - .. - .. - share - examples - tests - atf - .. - plain - .. - .. - .. - .. - sys - kern - .. - netinet - .. - pjdfstest - chflags - .. - chmod - .. - chown - .. - ftruncate - .. - granular - .. - link - .. - mkdir - .. - mkfifo - .. - mknod - .. - open - .. - rename - .. - rmdir - .. - symlink - .. - truncate - .. - unlink - .. - .. - .. - usr.bin - apply - .. - basename - .. - bmake - archives - fmt_44bsd - .. - fmt_44bsd_mod - .. - fmt_oldbsd - .. - .. - basic - t0 - .. - t1 - .. - t2 - .. - t3 - .. - .. - execution - ellipsis - .. - empty - .. - joberr - .. - plus - .. - .. - shell - builtin - .. - meta - .. - path - .. - path_select - .. - replace - .. - select - .. - .. - suffixes - basic - .. - src_wild1 - .. - src_wild2 - .. - .. - syntax - directive-t0 - .. - enl - .. - funny-targets - .. - semi - .. - .. - sysmk - t0 - 2 - 1 - .. - .. - mk - .. - .. - t1 - 2 - 1 - .. - .. - mk - .. - .. - t2 - 2 - 1 - .. - .. - mk - .. - .. - .. - variables - modifier_M - .. - modifier_t - .. - opt_V - .. - t0 - .. - .. - .. - calendar - .. - cmp - .. - comm - .. - cut - .. - dirname - .. - file2c - .. - grep - .. - gzip - .. - join - .. - jot - .. - lastcomm - .. - m4 - .. - ncal - .. - opensm - .. - printf - .. - sed - regress.multitest.out - .. - .. - tr + symlink .. truncate .. - uudecode + unlink .. - uuencode + .. + .. + usr.bin + apply + .. + basename + .. + bmake + archives + fmt_44bsd + .. + fmt_44bsd_mod + .. + fmt_oldbsd + .. .. - xargs + basic + t0 + .. + t1 + .. + t2 + .. + t3 + .. .. - yacc - yacc + execution + ellipsis + .. + empty + .. + joberr + .. + plus + .. + .. + shell + builtin + .. + meta + .. + path + .. + path_select + .. + replace + .. + select + .. + .. + suffixes + basic + .. + src_wild1 + .. + src_wild2 + .. + .. + syntax + directive-t0 + .. + enl + .. + funny-targets + .. + semi + .. + .. + sysmk + t0 + 2 + 1 + .. + .. + mk + .. + .. + t1 + 2 + 1 + .. + .. + mk + .. + .. + t2 + 2 + 1 + .. + .. + mk + .. + .. + .. + variables + modifier_M + .. + modifier_t + .. + opt_V + .. + t0 .. .. .. - usr.sbin - etcupdate + calendar + .. + cmp + .. + comm + .. + cut + .. + dirname + .. + file2c + .. + grep + .. + gzip + .. + join + .. + jot + .. + lastcomm + .. + m4 + .. + ncal + .. + opensm + .. + printf + .. + sed + regress.multitest.out .. - newsyslog - .. - nmtree - .. - pw - .. - sa + .. + tr + .. + truncate + .. + uudecode + .. + uuencode + .. + xargs + .. + yacc + yacc .. .. .. + usr.sbin + etcupdate + .. + newsyslog + .. + nmtree + .. + pw + .. + sa + .. + .. .. # vim: set expandtab ts=4 sw=4: diff --git a/etc/mtree/BSD.usr.dist b/etc/mtree/BSD.usr.dist index a310e88eb85f..6bdb88c06672 100644 --- a/etc/mtree/BSD.usr.dist +++ b/etc/mtree/BSD.usr.dist @@ -126,6 +126,8 @@ sbin .. share + atf + .. bsdconfig media .. @@ -169,6 +171,8 @@ doc IPv6 .. + atf + .. atm .. legal @@ -189,6 +193,8 @@ .. papers .. + pjdfstest + .. psd 01.cacm .. diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc index 3e647da1d923..79e5313c9730 100644 --- a/tools/build/mk/OptionalObsoleteFiles.inc +++ b/tools/build/mk/OptionalObsoleteFiles.inc @@ -4585,10 +4585,10 @@ OLD_FILES+=usr/share/man/man4/atf-test-case.4.gz OLD_FILES+=usr/share/mk/atf.test.mk # Test suite. -. if(exists(${DESTDIR}/usr/tests/)) -TESTS_DIRS!=find ${DESTDIR}/usr/tests -type d | sed -e 's,^${DESTDIR}/,,'; echo +. if exists(${DESTDIR}${TESTSBASE}) +TESTS_DIRS!=find ${DESTDIR}${TESTSBASE} -type d | sed -e 's,^${DESTDIR}/,,'; echo OLD_DIRS+=${TESTS_DIRS} -TESTS_FILES!=find ${DESTDIR}/usr/tests \! -type d | sed -e 's,^${DESTDIR}/,,'; echo +TESTS_FILES!=find ${DESTDIR}${TESTSBASE} \! -type d | sed -e 's,^${DESTDIR}/,,'; echo OLD_FILES+=${TESTS_FILES} . endif .endif # Test suite.