From nobody Wed Jul 13 16:06:32 2022 X-Original-To: dev-commits-src-branches@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 AB7411D0C44C; Wed, 13 Jul 2022 16:06:32 +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 4LjjD84Pbcz3PVT; Wed, 13 Jul 2022 16:06:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1657728392; 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=Gfrl891FbJRMjYtR0vaCMNpIEKqn/jsSdwA6d+O55m0=; b=nWdPu16Ts1BN0m1NfLsQsVx5IFZ6geh5t6NuHGkbQt0yodTRBiq37PE1ztq8mMDmuhUSEp GLpaUkhJb3zTZ5zKpEeGbMWc6JFkPiwouNVDNAwwodMfNFX+Snijxe89nRm+g42Ng3ZmyK pDUALSHOqrRb7OUlr0YgTcq//svn6/rWGenwNb7t74DY98nZfzXcgMI3Ao0fx3+HYfqPT6 a60XGf5zWlzuKzH6hwAb5iLrbFY12tPvEWjxcmOVls2XmqcS8M2RJWgWWIBfeaOPKSm8u8 /xoTUmT6nBCjq3Jdfw5FZ5dRYzjx+8sMdos4i8MsQ3ha1hEGC3LhU+1+n6UgjQ== 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 4LjjD83T9NzTNY; Wed, 13 Jul 2022 16:06:32 +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 26DG6W1B097631; Wed, 13 Jul 2022 16:06:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26DG6WTM097630; Wed, 13 Jul 2022 16:06:32 GMT (envelope-from git) Date: Wed, 13 Jul 2022 16:06:32 GMT Message-Id: <202207131606.26DG6WTM097630@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: e3f9397aea99 - stable/13 - Add list-old-{dirs,files,libs} targets. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: e3f9397aea99eabe85e8cfdc8721c0283adb2ec4 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1657728392; 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=Gfrl891FbJRMjYtR0vaCMNpIEKqn/jsSdwA6d+O55m0=; b=RHDbtP6KvKTBmStXE51Dead65E/RnmbTnBNqtBzPNCE5PrHKd0sBmzwXfOWxj/hf4LfJ92 2VvtTv2KJarC1HBHWLCxkMs82KF7Ma8r0KzKaqEvOPmx46wwep54crSf/DD1CjNfxYC6To ISA/WFlj8waV6KybrGaKOInc7z317+NxIJlXx8hbfoZx3P7JLGE+VYb/qiJkuyITKiNQg4 QDwN2OUh665B0N/d2Q8qiQO7EB1sGuvcHS6JwN+eJhwkWUo+tNxVTGOpenqc7CfA9hTLE0 5/RgHi7kqqi8mn7nohJOG5AU4N/AX0JJsVeMfXJa2Fly9XRTJHOxyDtaDLrkQw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1657728392; a=rsa-sha256; cv=none; b=FEcFaEz/ZaY2CrCZ1Q8V/4tEumEBmslYlY7g5sk84kIAhmXV4HtVHeYVjvppiLpksy3eHP 5KHfhXglcJujNsR7GRz8Ia8eK2gR/33CL81JMTa8koCSQbl5C/SYD9tQaEa00Fubduep7z Dv7AJ9GZShnuOnJJZyXNiheUWC8iJtHdVgY1Savhxh72By0596+43OC27M56B8CWjLy1rK JJYMc+4LAkr8dVp6QKOtmrPiunLONfZ6/VfpoF+tx/aw8flk6bPHVYa+SY4x50V6A2tPdK n/pqY/e27j9LPT1I2FMM617Q8p158qUOqEkmtFT0CscFrBJZ7vEblGsg0P6o6g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=e3f9397aea99eabe85e8cfdc8721c0283adb2ec4 commit e3f9397aea99eabe85e8cfdc8721c0283adb2ec4 Author: John Baldwin AuthorDate: 2022-01-11 19:38:11 +0000 Commit: John Baldwin CommitDate: 2022-07-13 15:22:24 +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 (cherry picked from commit 21baf42c57f080835496c5f4f349e9523d22a956) --- Makefile | 4 ++++ Makefile.inc1 | 40 +++++++++++++++++++++++++--------------- 2 files changed, 29 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index c64873fb241b..e16557f83371 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 10ee2148f97a..6bb616d7bc0c 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -3181,7 +3181,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 @@ -3200,6 +3201,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. @@ -3209,8 +3215,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; \ @@ -3239,8 +3244,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}"; \ @@ -3250,7 +3254,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:' | \ @@ -3261,13 +3265,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; \ @@ -3286,8 +3294,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}"; \ @@ -3297,13 +3304,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; \ @@ -3321,8 +3332,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}"; \