From nobody Sat Jul 13 10:14:39 2024 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 4WLkpl4sZpz5QSkQ; Sat, 13 Jul 2024 10:14:39 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WLkpl3vLgz442N; Sat, 13 Jul 2024 10:14:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720865679; 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=W+BhtVyhz55qlNLc3lsNxoYUXc59AvMU21W4+ZeNkwI=; b=mLWwk1fslGiMvO23Na7AGTW2HTdNwj3ATWa0Ik0IVOCR9MVsoSHz6hm/UsUJi6Vq0XnPCg QwcbaNl1uHvotXQh8wSMqkaj+RYHEFmLuc/dmz7pzz0F7z9vwYmab/4UPXLj6S9UBtS6D8 XDe6jBGau2RH5e8bz9t08joDvCA6XVv4z84m24vsOM5cV6U1qRLoyy5bhNVw6jh/EVIXgK 0fSIedqUkG0Y1cTTORoBZVBNTHTQRs4L37y5riLabd6uj/2PyhKR2aTd5aZyttOnGVYBcO 4H8VYDuI6gdEf5zrpYi/q4qdd4arzBYQo4nF10cY2AIL5MunOoMfk615tbDUuA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720865679; a=rsa-sha256; cv=none; b=yNiPntKNPFgFtCxNlwkLoyGqG+R4bdXe7E3BY3qa+9Uo3IK6z7AazZQvVin7A7Mx0TfQoY RQyBgglzLFypQ0YVq160VqnE75OcfNVxLCdHpz6g/LOaXFG0MIgmV5Psr+sZPj3aPJBbZ6 Yc+vPXtVW9DwVT7eEzJuJkqjOgrp+5NgCL0A4UWUj59Ok/2vb+rtFWf1knmgvqDN2iixhG BljiPljicp+fhZUQvLmEFsaHPQDRhThB1jlsuO0xc51Q2dXraV/zdxqf+lRgi5jpZsq6wr KPipUszbBBhzcdasXSmKWfVsUbI4XBOsadjRlnMR6t52Wbzs5tNfbjF4cl9kuw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720865679; 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=W+BhtVyhz55qlNLc3lsNxoYUXc59AvMU21W4+ZeNkwI=; b=phgLVvgEZswG2xXwFZOO3X17BrFMj1/5rbBPjPXwnAXrkUKQQhjN8z7L4ueo/dJc7lNvJS i8Zbv3jk9y3X2oiOUMklc5wnXsw3lywDXkHM3wcj6bAcims+1HalTUXtirau2PqqC318lK Y3VJEYls6F/72vLjMBFJT13gq7WPFjGZrHQAzaXSQp0aaysSxL2PMpNPbCeqIvSnNEelAa 1YZrhDvURUJYABwnIN0gT6LTafswHKsifyD2H5TaOauK0xhb2c532p/u0ESRe659oEh8BP j32UNG2gf4qZi/vfjyJxxAj+RznvPxnAgY5LyB9Lp5RcpSq2AWKs6EdYZAbcrw== 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 4WLkpl3BkSzMnw; Sat, 13 Jul 2024 10:14:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46DAEdYv026400; Sat, 13 Jul 2024 10:14:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46DAEdKG026397; Sat, 13 Jul 2024 10:14:39 GMT (envelope-from git) Date: Sat, 13 Jul 2024 10:14:39 GMT Message-Id: <202407131014.46DAEdKG026397@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Wolfram Schneider Subject: git: 3e8a2296e9ad - stable/13 - stale-symlink-buildworld.sh: a script to check for stale symlinks on a FreeBSD system 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wosch X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3e8a2296e9ad827268d0398738a3ed95877d872e Auto-Submitted: auto-generated The branch stable/13 has been updated by wosch: URL: https://cgit.FreeBSD.org/src/commit/?id=3e8a2296e9ad827268d0398738a3ed95877d872e commit 3e8a2296e9ad827268d0398738a3ed95877d872e Author: Wolfram Schneider AuthorDate: 2024-07-07 12:59:20 +0000 Commit: Wolfram Schneider CommitDate: 2024-07-13 10:14:27 +0000 stale-symlink-buildworld.sh: a script to check for stale symlinks on a FreeBSD system You can run the script before or after `make installworld' You may also check your local ports with: env STALE_SYMLINK_BUILDWORLD_DIRS=/usr/local ./stale-symlink-buildworld.sh PR: 276235 (cherry picked from commit e880dd644f63fbe068c38b73b44aa7e7c5f176f3) --- tools/build/stale-symlink-buildworld.sh | 53 +++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/tools/build/stale-symlink-buildworld.sh b/tools/build/stale-symlink-buildworld.sh new file mode 100755 index 000000000000..a4515db3fccb --- /dev/null +++ b/tools/build/stale-symlink-buildworld.sh @@ -0,0 +1,53 @@ +#!/bin/sh +# Copyright (c) Feb 2024 Wolfram Schneider +# SPDX-License-Identifier: BSD-2-Clause +# +# stale-symlink-buildworld.sh - check for stale symlinks on a FreeBSD system +# +# You can run the script before or after `make installworld' +# + +PATH="/bin:/usr/bin"; export PATH + +: ${ncpu=$(nproc)} + +# check other directories as well +: ${STALE_SYMLINK_BUILDWORLD_DIRS="/usr/obj"} + +trap 'rm -f $script' 0 +script=$(mktemp -t stale-symlink) +chmod u+x $script + +# create a temporary shell script to check for stale symbolic links +cat << 'EOF' > $script +file="$1" + +if [ ! -e "$file" ]; then + echo "stale symlink detected: $(ls -ld $file)" >&2 + exit 1 +else + exit 0 +fi +EOF + +find -s -H \ + /bin \ + /boot \ + /etc \ + /lib \ + /libexec \ + /sbin \ + /usr/bin \ + /usr/include \ + /usr/lib \ + /usr/lib32 \ + /usr/libdata \ + /usr/libexec \ + /usr/sbin \ + /usr/src \ + /usr/share \ + $STALE_SYMLINK_BUILDWORLD_DIRS \ + -type l \ + -print0 | xargs -n1 -0 -P${ncpu} $script + +#EOF