From nobody Tue Jan 11 19:39:33 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 8C1A4193A94E; Tue, 11 Jan 2022 19:39:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JYLcP39ZVz3JBs; Tue, 11 Jan 2022 19:39:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 31E191F0E3; Tue, 11 Jan 2022 19:39:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 20BJdXEd035896; Tue, 11 Jan 2022 19:39:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20BJdXIh035895; Tue, 11 Jan 2022 19:39:33 GMT (envelope-from git) Date: Tue, 11 Jan 2022 19:39:33 GMT Message-Id: <202201111939.20BJdXIh035895@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 21baf42c57f0 - main - Add list-old-{dirs,files,libs} targets. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 21baf42c57f080835496c5f4f349e9523d22a956 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1641929973; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=R4mJ9ODC4uyiy+86luZGdzEf1Dlt/915IIjlyMbsfY4=; b=N5yYQSSBs0X6UTu4JuvOCQeE4hFPa9aapTJfleaYJksO+vG808ZDQPAO1mf7qd+2/XsO6x G7OicS/QRRKobX/h94s+h51p02v5rzswc0G1NN+olP1ZY4jz2iTqpidmzFpUWcpFS8b/nb mYYZkGHTNX7G1DPkjJPiE/U8E1ROjQe57iEINsPnkV8ntUQEIShUF7aX2u9nz6htbWZNyn iohptqy25DKFEJH6vZhptX3k8oAltSsr5ly4xm/oSwrXDEwHRFfsfCxsWHhllN0cIpTXM1 E+1ZtHK9Wikx9USWGmB0ZbaZY2e68TMMJTF0tpCraSjdzPd2a5s4qUQ7whQDoQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1641929973; a=rsa-sha256; cv=none; b=o0jdL/eYVSFNuAIGZgJ1f6iwIQyeMgHScDX4PtUjex1+xHN4UB8ePO9CQuCB2heAVK6shU teSK15VQTbocllZED9mbW+QpA8tU1K/PjZNCG6UBtS/0OX1HoPzN7O5Imstob/rGcdGHfy 4xUnlG2LgsJQ+J2UafOqzybocD6aAqN2I6FFfYblmP0nPR1r0Imo+Z/irJRZ+K6uAFB6F4 /wvZjfrCFm/yhLGwSNOGcguC4Iwtccx5X0LXwwSId/tDyZ3om0n4LPnchbGACBqOb98hzt fA7B3s4UGhfRNsxENBAZIlh9Mvhf2c60rUNhoxvYD9HNFP+aPSRUdkitVBq5jQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=21baf42c57f080835496c5f4f349e9523d22a956 commit 21baf42c57f080835496c5f4f349e9523d22a956 Author: John Baldwin AuthorDate: 2022-01-11 19:38:11 +0000 Commit: John Baldwin CommitDate: 2022-01-11 19:38:11 +0000 Add list-old-{dirs,files,libs} targets. These targets generate a raw list of the candidate old files roughly corresponding to the values of OLD_DIRS, OLD_FILES, and OLD_LIBS. Currently list-old-files also includes uncompressed manpages in addition to compressed manpages. Use these targets in the implementation of check-old-* and delete-old-* to replace duplicated logic. Reviewed by: imp, emaste Sponsored by: The University of Cambridge, Google Inc. Differential Revision: https://reviews.freebsd.org/D33327 --- Makefile | 4 ++++ Makefile.inc1 | 40 +++++++++++++++++++++++++--------------- 2 files changed, 29 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index ef430aa41e66..adba83592743 100644 --- a/Makefile +++ b/Makefile @@ -33,6 +33,9 @@ # delete-old-dirs - Delete obsolete directories. # delete-old-files - Delete obsolete files. # delete-old-libs - Delete obsolete libraries. +# list-old-dirs - Raw list of possibly obsolete directories. +# list-old-files - Raw list of possibly obsolete files. +# list-old-libs - Raw list of possibly obsolete libraries. # targets - Print a list of supported TARGET/TARGET_ARCH pairs # for world and kernel targets. # toolchains - Build a toolchain for all world and kernel targets. @@ -154,6 +157,7 @@ TGTS= all all-man buildenv buildenvvars buildkernel buildworld \ installkernel.debug packagekernel packageworld \ reinstallkernel reinstallkernel.debug \ installworld kernel-toolchain libraries maninstall \ + list-old-dirs list-old-files list-old-libs \ obj objlink showconfig tags toolchain \ makeman sysent \ _worldtmp _legacy _bootstrap-tools _cleanobj _obj \ diff --git a/Makefile.inc1 b/Makefile.inc1 index b31c1d09fbeb..9adc48b79c65 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -3193,7 +3193,8 @@ SUBDIR_PARALLEL= .if make(check-old) || make(check-old-dirs) || \ make(check-old-files) || make(check-old-libs) || \ make(delete-old) || make(delete-old-dirs) || \ - make(delete-old-files) || make(delete-old-libs) + make(delete-old-files) || make(delete-old-libs) || \ + make(list-old-dirs) || make(list-old-files) || make(list-old-libs) # # check for / delete old files section @@ -3212,6 +3213,11 @@ RM_I=-i RM_I=-v .endif +list-old-files: .PHONY + @cd ${.CURDIR}; \ + ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \ + -V OLD_FILES -V "OLD_FILES:Musr/share/*.gz:R" | xargs -n1 | sort + delete-old-files: .PHONY @echo ">>> Removing old files (only deletes safe to delete libs)" # Ask for every old file if the user really wants to remove it. @@ -3221,8 +3227,7 @@ delete-old-files: .PHONY # the Makefile parser segfault. @exec 3<&0; \ cd ${.CURDIR}; \ - ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \ - -V OLD_FILES -V "OLD_FILES:Musr/share/*.gz:R" | xargs -n1 | sort | \ + ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} list-old-files | \ while read file; do \ if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \ chflags noschg "${DESTDIR}/$${file}" 2>/dev/null || true; \ @@ -3251,8 +3256,7 @@ delete-old-files: .PHONY check-old-files: .PHONY @echo ">>> Checking for old files" @cd ${.CURDIR}; \ - ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \ - -V OLD_FILES -V "OLD_FILES:Musr/share/*.gz:R" | xargs -n1 | \ + ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} list-old-files | \ while read file; do \ if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \ echo "${DESTDIR}/$${file}"; \ @@ -3262,7 +3266,7 @@ check-old-files: .PHONY echo "${DESTDIR}${DEBUGDIR}/$${file}.$${ext}"; \ fi; \ done; \ - done | sort + done # Check for catpages without corresponding manpages. @find ${DESTDIR}/usr/share/man/cat* ! -type d 2>/dev/null | \ sed -ep -e's:${DESTDIR}/usr/share/man/cat:${DESTDIR}/usr/share/man/man:' | \ @@ -3273,13 +3277,17 @@ check-old-files: .PHONY fi; \ done | sort +list-old-libs: .PHONY + @cd ${.CURDIR}; \ + ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \ + -V OLD_LIBS | xargs -n1 | sort + delete-old-libs: .PHONY @echo ">>> Removing old libraries" @echo "${OLD_LIBS_MESSAGE}" | fmt @exec 3<&0; \ cd ${.CURDIR}; \ - ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \ - -V OLD_LIBS | xargs -n1 | sort | \ + ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} list-old-libs | \ while read file; do \ if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \ chflags noschg "${DESTDIR}/$${file}" 2>/dev/null || true; \ @@ -3298,8 +3306,7 @@ delete-old-libs: .PHONY check-old-libs: .PHONY @echo ">>> Checking for old libraries" @cd ${.CURDIR}; \ - ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \ - -V OLD_LIBS | xargs -n1 | \ + ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} list-old-libs | \ while read file; do \ if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \ echo "${DESTDIR}/$${file}"; \ @@ -3309,13 +3316,17 @@ check-old-libs: .PHONY echo "${DESTDIR}${DEBUGDIR}/$${file}.$${ext}"; \ fi; \ done; \ - done | sort + done + +list-old-dirs: .PHONY + @cd ${.CURDIR}; \ + ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \ + -V OLD_DIRS | xargs -n1 | sort -r delete-old-dirs: .PHONY @echo ">>> Removing old directories" @cd ${.CURDIR}; \ - ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \ - -V OLD_DIRS | xargs -n1 | sort -r | \ + ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} list-old-dirs | \ while read dir; do \ if [ -d "${DESTDIR}/$${dir}" ]; then \ rmdir -v "${DESTDIR}/$${dir}" || true; \ @@ -3333,8 +3344,7 @@ delete-old-dirs: .PHONY check-old-dirs: .PHONY @echo ">>> Checking for old directories" @cd ${.CURDIR}; \ - ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \ - -V OLD_DIRS | xargs -n1 | sort -r | \ + ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} list-old-dirs | \ while read dir; do \ if [ -d "${DESTDIR}/$${dir}" ]; then \ echo "${DESTDIR}/$${dir}"; \