]> xenbits.xensource.com Git - people/julieng/freebsd.git/commitdiff
Handle lib32 files during delete-old* when MK_LIB32=no.
authorjmmv <jmmv@FreeBSD.org>
Tue, 20 Oct 2015 20:35:34 +0000 (20:35 +0000)
committerjmmv <jmmv@FreeBSD.org>
Tue, 20 Oct 2015 20:35:34 +0000 (20:35 +0000)
Extend OptionalObsoleteFiles.inc to delete all lib32 files when MK_LIB32 is
set to no on a system that previously had lib32 libraries installed.

Also, to prevent "make delete-old-dirs" from always deleting lib32 directories
after an installworld, move the lib32 subtree to its own mtree file that only
gets applied when MK_LIB32=yes.

Test: Ran "make delete-old" and "make delete-old-libs" on a system that never
had MK_LIB32 enabled, and on a system where MK_LIB32 was enabled and later
disabled.  Did this both on amd64 and powerpc64.

Test: Ran "make tinderbox" without errors.

Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D3923

Makefile.inc1
etc/Makefile
etc/mtree/BSD.debug.dist
etc/mtree/BSD.lib32.dist [new file with mode: 0644]
etc/mtree/BSD.usr.dist
etc/mtree/Makefile
tools/build/mk/OptionalObsoleteFiles.inc

index 6056c37d519855e660e913c1b12124e97b446c81..937148ec410cfd0c216edcb43d57c9e6a9e5d549 100644 (file)
@@ -560,6 +560,16 @@ _worldtmp:
        mtree -deU -f ${.CURDIR}/etc/mtree/BSD.debug.dist \
            -p ${WORLDTMP}/usr/lib >/dev/null
 .endif
+.if ${MK_LIB32} != "no"
+       mtree -deU -f ${.CURDIR}/etc/mtree/BSD.lib32.dist \
+           -p ${WORLDTMP}/usr >/dev/null
+.if ${MK_DEBUG_FILES} != "no"
+       mtree -deU -f ${.CURDIR}/etc/mtree/BSD.lib32.dist \
+           -p ${WORLDTMP}/legacy/usr/lib/debug/usr >/dev/null
+       mtree -deU -f ${.CURDIR}/etc/mtree/BSD.lib32.dist \
+           -p ${WORLDTMP}/usr/lib/debug/usr >/dev/null
+.endif
+.endif
 .if ${MK_TESTS} != "no"
        mkdir -p ${WORLDTMP}${TESTSBASE}
        mtree -deU -f ${.CURDIR}/etc/mtree/BSD.tests.dist \
@@ -653,9 +663,13 @@ build32:
            -p ${LIB32TMP}/usr >/dev/null
        mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \
            -p ${LIB32TMP}/usr/include >/dev/null
+       mtree -deU -f ${.CURDIR}/etc/mtree/BSD.lib32.dist \
+           -p ${LIB32TMP}/usr >/dev/null
 .if ${MK_DEBUG_FILES} != "no"
        mtree -deU -f ${.CURDIR}/etc/mtree/BSD.debug.dist \
            -p ${LIB32TMP}/usr/lib >/dev/null
+       mtree -deU -f ${.CURDIR}/etc/mtree/BSD.lib32.dist \
+           -p ${LIB32TMP}/usr/lib/debug/usr >/dev/null
 .endif
        mkdir -p ${WORLDTMP}
        ln -sf ${.CURDIR}/sys ${WORLDTMP}
@@ -901,6 +915,14 @@ distributeworld installworld: _installcheck_world
        mtree -deU -f ${.CURDIR}/etc/mtree/BSD.debug.dist \
            -p ${DESTDIR}/${DISTDIR}/${dist}/usr/lib >/dev/null
 .endif
+.if ${MK_LIB32} != "no"
+       mtree -deU -f ${.CURDIR}/etc/mtree/BSD.lib32.dist \
+           -p ${DESTDIR}/${DISTDIR}/${dist}/usr >/dev/null
+.if ${MK_DEBUG_FILES} != "no"
+       mtree -deU -f ${.CURDIR}/etc/mtree/BSD.lib32.dist \
+           -p ${DESTDIR}/${DISTDIR}/${dist}/usr/lib/debug/usr >/dev/null
+.endif
+.endif
 .if ${MK_TESTS} != "no" && ${dist} == "tests"
        -mkdir -p ${DESTDIR}/${DISTDIR}/${dist}${TESTSBASE}
        mtree -deU -f ${.CURDIR}/etc/mtree/BSD.tests.dist \
@@ -917,6 +939,10 @@ distributeworld installworld: _installcheck_world
            sed -e 's#^\./#./${dist}/usr/#' >> ${METALOG}
        ${IMAKEENV} mtree -C -f ${.CURDIR}/etc/mtree/BSD.include.dist | \
            sed -e 's#^\./#./${dist}/usr/include/#' >> ${METALOG}
+.if ${MK_LIB32} != "no"
+       ${IMAKEENV} mtree -C -f ${.CURDIR}/etc/mtree/BSD.lib32.dist | \
+           sed -e 's#^\./#./${dist}/usr/#' >> ${METALOG}
+.endif
 .endif
 .endfor
        -mkdir ${DESTDIR}/${DISTDIR}/base
@@ -2241,6 +2267,10 @@ _xi-mtree:
            -p ${XDDESTDIR}/usr >/dev/null
        mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \
            -p ${XDDESTDIR}/usr/include >/dev/null
+.if ${MK_LIB32} != "no"
+       mtree -deU -f ${.CURDIR}/etc/mtree/BSD.lib32.dist \
+           -p ${XDDESTDIR}/usr >/dev/null
+.endif
 .if ${MK_TESTS} != "no"
        mkdir -p ${XDDESTDIR}${TESTSBASE}
        mtree -deU -f ${.CURDIR}/etc/mtree/BSD.tests.dist \
index 24c83d1eb2a9aefe1a666a6a68cdd38c363e0dbd..bb62db9a87def295b907af67504b8acd9aa4d4a2 100644 (file)
@@ -151,6 +151,9 @@ BIN1+= regdomain.xml
 BIN2=  netstart pccard_ether rc.suspend rc.resume
 
 MTREE= BSD.debug.dist BSD.include.dist BSD.root.dist BSD.usr.dist BSD.var.dist
+.if ${MK_LIB32} != "no"
+MTREE+=        BSD.lib32.dist
+.endif
 .if ${MK_TESTS} != "no"
 MTREE+=        BSD.tests.dist
 .endif
@@ -344,6 +347,10 @@ MTREES=            mtree/BSD.root.dist             /               \
 .if ${MK_GROFF} != "no"
 MTREES+=       mtree/BSD.groff.dist            /usr
 .endif
+.if ${MK_LIB32} != "no"
+MTREES+=       mtree/BSD.lib32.dist            /usr
+MTREES+=       mtree/BSD.lib32.dist            /usr/lib/debug/usr
+.endif
 .if ${MK_TESTS} != "no"
 MTREES+=       mtree/BSD.tests.dist            ${TESTSBASE}
 MTREES+=       mtree/BSD.tests.dist            /usr/lib/debug/${TESTSBASE}
index 8df0a725e5fe103fcf7e07a1e3a7e019ca23635d..e760e01562f59269eefa2190461cdde6e7fabb01 100644 (file)
                 private
                 ..
             ..
-            lib32
-                i18n
-                ..
-                private
-                ..
-            ..
             libexec
                 bsdinstall
                 ..
diff --git a/etc/mtree/BSD.lib32.dist b/etc/mtree/BSD.lib32.dist
new file mode 100644 (file)
index 0000000..a82368f
--- /dev/null
@@ -0,0 +1,14 @@
+# $FreeBSD$
+#
+# Please see the file src/etc/mtree/README before making changes to this file.
+#
+
+/set type=dir uname=root gname=wheel mode=0755
+.
+    lib32
+        dtrace
+        ..
+        i18n
+        ..
+    ..
+..
index d9cdcd11abb90a3827349876c7c3626658b7a449..8d571e07e24ee710f7fe34b79a032dc214374551 100644 (file)
             ..
         ..
     ..
-    lib32
-        dtrace
-        ..
-        i18n
-        ..
-    ..
     libdata
         gcc
         ..
index afed37044fa23ef8ed17beed3e6335ca8a78bc07..1a941e41c27ad8ef494ef018c19a0d984afb8081 100644 (file)
@@ -5,6 +5,7 @@
 FILES= ${_BSD.debug.dist} \
        BSD.include.dist \
        BSD.root.dist \
+       ${_BSD.lib32.dist} \
        ${_BSD.sendmail.dist} \
        ${_BSD.tests.dist} \
        BSD.usr.dist \
@@ -16,6 +17,9 @@ _BSD.debug.dist=      BSD.debug.dist
 .if ${MK_GROFF} != "no"
 _BSD.groff.dist=       BSD.groff.dist
 .endif
+.if ${MK_LIB32} != "no"
+_BSD.lib32.dist=       BSD.lib32.dist
+.endif
 .if ${MK_SENDMAIL} != "no"
 _BSD.sendmail.dist=    BSD.sendmail.dist
 .endif
index daa5cd9e647af306167745dc589987682af14b6a..489c3b427eb3dd81e4663163b02b1836b2e27b3d 100644 (file)
@@ -3964,9 +3964,34 @@ OLD_FILES+=usr/share/man/man5/keymap.5.gz
 OLD_FILES+=usr/share/man/man8/moused.8.gz
 .endif
 
-#.if ${MK_LIB32} == no
-# to be filled in
-#.endif
+.if ${MK_LIB32} == no
+OLD_FILES+=etc/mtree/BSD.lib32.dist
+OLD_FILES+=libexec/ld-elf32.so.1
+.  if exists(${DESTDIR}/usr/lib32)
+LIB32_DIRS!=find ${DESTDIR}/usr/lib32 -type d \
+    | sed -e 's,^${DESTDIR}/,,'; echo
+LIB32_FILES!=find ${DESTDIR}/usr/lib32 \! -type d \
+    \! -name "lib*.so*" | sed -e 's,^${DESTDIR}/,,'; echo
+LIB32_LIBS!=find ${DESTDIR}/usr/lib32 \! -type d \
+    -name "lib*.so*" | sed -e 's,^${DESTDIR}/,,'; echo
+OLD_DIRS+=${LIB32_DIRS}
+OLD_FILES+=${LIB32_FILES}
+OLD_LIBS+=${LIB32_LIBS}
+.  endif
+.  if ${MK_DEBUG_FILES} == no
+.    if exists(${DESTDIR}/usr/lib/debug/usr/lib32)
+DEBUG_LIB32_DIRS!=find ${DESTDIR}/usr/lib/debug/usr/lib32 -type d \
+    | sed -e 's,^${DESTDIR}/,,'; echo
+DEBUG_LIB32_FILES!=find ${DESTDIR}/usr/lib/debug/usr/lib32 \! -type d \
+    \! -name "lib*.so*" | sed -e 's,^${DESTDIR}/,,'; echo
+DEBUG_LIB32_LIBS!=find ${DESTDIR}/usr/lib/debug/usr/lib32 \! -type d \
+    -name "lib*.so*" | sed -e 's,^${DESTDIR}/,,'; echo
+OLD_DIRS+=${DEBUG_LIB32_DIRS}
+OLD_FILES+=${DEBUG_LIB32_FILES}
+OLD_LIBS+=${DEBUG_LIB32_LIBS}
+.    endif
+.  endif
+.endif
 
 .if ${MK_LIBCPLUSPLUS} == no
 OLD_LIBS+=lib/libcxxrt.so.1