From nobody Sat Jul 13 10:12:31 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 4WLkmH39VWz5QSY9; Sat, 13 Jul 2024 10:12:31 +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 4WLkmH1zv2z43vq; Sat, 13 Jul 2024 10:12:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720865551; 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=jB1MRO2rKnFSpmNn3SqeTHpgelmeEv5vFaQoiMkL3zs=; b=kAzYcO5d7oXNxvvFP9ZJnh8x8pC75LG4FOiIA4j1wvGVklv5cKjNjF8m0cMzx16nv2NTvP cxIHI/oO5XaxkPkUjMrs17v1NfXJHxkvk5qRtW14+eSrb/GOWGctSoz0tmJY74/XjpQJ2N Pkfozii3uy2rKQvGVMvybQF4823liuD7UG7eAhNXOkrove3iz0i7i5AhXomAm6vAmEi3Z+ p7NnaQhkLwpns73sOSGq17oKNigXyEIS5UOdy+n81CvzCyWVv9rFaa8MypWY5z6ABWQh7Q R10iW2CFDTag2LgZvaYsteQhCvA4DQarHGpWgXmR/eGYbFPpVOZRpR2t/Mx4QA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720865551; a=rsa-sha256; cv=none; b=kagj16bs4T1h6rLLyxoPkur936ZuAeYuLg3SEb/aNg1YdbaQdS1iAQoLj2TdumYKNLVQP8 p+hiQwEPwJIBfBxome3f4+hdSBR6gPK8JLn/+ynMS5CMI3xDWCJFr17JZVxElIFSydqX4T 6qpe48yriAZOePaksARYUGiNiEhTw2ksIDnzOjv0DgXSMlZK7bGj2Nb/YwfAyunRGiVxaw 77UQBosz2rbIEVl7gJ37oxZmYWgXkE5Iiz7QJnJg7HcHblEdnYR04nXhA2nQ/iTjsnxW+V LRiEzfzzMCbdJMXRLjnVVdF1ev0eQilqdowWz8DrRrbSdtuhtZKoDUZhspNl8g== 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=1720865551; 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=jB1MRO2rKnFSpmNn3SqeTHpgelmeEv5vFaQoiMkL3zs=; b=LaSmU/e9893LGm5rdsLrt6jYKpmpOPzNZedEkoF/gEx5/pxWApIO+ACzeNGoz7+dMhwr9b fPDAE3i3o+7CDblgYzoRpDuMuC+zS3I/ga/vfis4kKi1LWLNnmVWWzZ/cj/gcj6OA4VYMf bvJZ7qeWd86P01NOJ6Kyb7/yLRtkZ3HexXBS6oNB0XpauARLyq8fDwMcvFVGVlLw45aRIc oXvo2tKLchoca4YyOR8BTs/z4KwE41uWchqq7+qwRgTf35bf9c5W/WTffUbWlXspmFCCg9 9u70MUmWGTkvwA751lAEr/J70NeGZJ+8G/OI9+ZxdqbxF7TFwUxLwCMA0MuqXA== 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 4WLkmH1ZzRzMPv; Sat, 13 Jul 2024 10:12:31 +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 46DACV43025973; Sat, 13 Jul 2024 10:12:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46DACVx7025970; Sat, 13 Jul 2024 10:12:31 GMT (envelope-from git) Date: Sat, 13 Jul 2024 10:12:31 GMT Message-Id: <202407131012.46DACVx7025970@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: cf1bc41b29a7 - stable/14 - 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/14 X-Git-Reftype: branch X-Git-Commit: cf1bc41b29a7bd90d70445c8cf99474ef7b767b2 Auto-Submitted: auto-generated The branch stable/14 has been updated by wosch: URL: https://cgit.FreeBSD.org/src/commit/?id=cf1bc41b29a7bd90d70445c8cf99474ef7b767b2 commit cf1bc41b29a7bd90d70445c8cf99474ef7b767b2 Author: Wolfram Schneider AuthorDate: 2024-07-07 12:59:20 +0000 Commit: Wolfram Schneider CommitDate: 2024-07-13 10:11:51 +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