From nobody Wed Mar 15 03:08:27 2023 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 4PbwMH4tQXz3xt9q; Wed, 15 Mar 2023 03:08:27 +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 4PbwMH4FyLz3DRq; Wed, 15 Mar 2023 03:08:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678849707; 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=E1ZNDXteFAzGvDWObTc3fKZ2H5x/TLC9QI7F96bIqJI=; b=eDS7Nea+tnAvkeupOwPPs83Qu1VnG3kI87SrbgzxzNtFW/slmGF7+G6tTVXib5wjAwkeoD spIhaL/VsnVz3b4DdS13M+4BeXg6mKwvmAugxoAnBdeknbwtmZalF1nFzyuGeQV1knWKaj 27bBomJkb6Z14X72aR3/8VtpW4pDs3ppHLLtMxPsqjF8G/i+rxAUcoghP3iLYbyNCImPzd 4G6aFXIkM2QhxaWmXq9jsCw2ZUk25DnbGMy27qwuYPXcEg+fExJDmAVlaGDvEBKgC1gFgq HFsTWMRqqU4hWBJmYlF3vUP6GzObvMD0yjnLq/gn/hf0ChVP5VvtWvvzwyxElQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678849707; 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=E1ZNDXteFAzGvDWObTc3fKZ2H5x/TLC9QI7F96bIqJI=; b=iuDWIMO6/rO6urgAoRYicgtQmWyTGr0Ekp/6SK4F3Qa8SeXJT9YbtCaL71z4xYu0yts5Di m8HmXWauKuA3ReoU7tsT7za+qWwmMZNul/gpuaBS29IZoAnsofe/4ONCMtigKCluAniXpx cirAnqbSqIYsFqqB3bBzAj437bkEK0Ne7GoPlhkwFcrWfkbPYEtkqlosFRzyFLqbHa0AVg MRmyxJ3aWFEaNbowVueJXyQ3Rpw4ie3hkRF5H11CU8SqpTDF92UQwtmf6T6/XI+RSMKZmA 1QYVVE4VPqAyfzJCEiHlfEexyb285yE9c/kBSLud1xONjGNDiZ/Nj77FVrr5Sg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678849707; a=rsa-sha256; cv=none; b=adTQPlWvaHZqp7ar7+mw+QgYOyYyhbFjKKln5PHZy7go5n43F36DEFzz0SZ1uSoMGS9XuY TsyAihEEm2hc0ikUHiL81q9TKarg2x53oyrp4J+ceMSGf6zTPtq5qi9+eDr5XaZsnVlxeC wCx5rPuArppAjzocrhP9gVxzRRMeKyxfHiizyXDsLF+rKX6AKJUpNYoL/GjKaiWdSa+GSd 0eLNmG/iQj4fRXmi5Avk4si6QwwhwItfcr1mIgJh9bAMS4pLKxLO0cdJyznHoWwKtDl4Iv q3VCVOfnuANOlSjq16kCYrkUoVCR8B5a7zDm/s6uJ786Pq9kXExw33m6DT8lBA== 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 4PbwMH3JLFz10wk; Wed, 15 Mar 2023 03:08:27 +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 32F38Rh0011245; Wed, 15 Mar 2023 03:08:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32F38Rqk011244; Wed, 15 Mar 2023 03:08:27 GMT (envelope-from git) Date: Wed, 15 Mar 2023 03:08:27 GMT Message-Id: <202303150308.32F38Rqk011244@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 3693d9140e05 - main - rc: ignore .pkgsave files 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: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3693d9140e05aba9942232df13468f51a6cde136 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=3693d9140e05aba9942232df13468f51a6cde136 commit 3693d9140e05aba9942232df13468f51a6cde136 Author: Mina Galić AuthorDate: 2023-03-15 02:52:15 +0000 Commit: Warner Losh CommitDate: 2023-03-15 02:52:15 +0000 rc: ignore .pkgsave files The local parts of rc already skip .sample files; we add .pkgsave to the list, and add logic for base. Thanks to @RhodiumToad for getting this started. Differential Revision: https://reviews.freebsd.org/D27962 Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/662 --- libexec/rc/rc | 9 ++++++--- libexec/rc/rc.subr | 15 ++++++++++++++- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/libexec/rc/rc b/libexec/rc/rc index f021251bbd81..8ae048b67c1b 100644 --- a/libexec/rc/rc +++ b/libexec/rc/rc @@ -94,7 +94,9 @@ fi # Do a first pass to get everything up to $early_late_divider so that # we can do a second pass that includes $local_startup directories # -files=`rcorder ${skip} ${skip_firstboot} /etc/rc.d/* 2>/dev/null` +unset system_rc +find_system_scripts +files=`rcorder ${skip} ${skip_firstboot} ${system_rc} 2>/dev/null` _rc_elem_done=' ' for _rc_elem in ${files}; do @@ -106,7 +108,7 @@ for _rc_elem in ${files}; do esac done -unset files local_rc +unset files local_rc system_rc # Now that disks are mounted, for each dir in $local_startup # search for init scripts that use the new rc.d semantics. @@ -122,7 +124,8 @@ if [ -e ${firstboot_sentinel} ]; then skip_firstboot="" fi -files=`rcorder ${skip} ${skip_firstboot} /etc/rc.d/* ${local_rc} 2>/dev/null` +find_system_scripts +files=`rcorder ${skip} ${skip_firstboot} ${system_rc} ${local_rc} 2>/dev/null` for _rc_elem in ${files}; do case "$_rc_elem_done" in *" $_rc_elem "*) continue ;; diff --git a/libexec/rc/rc.subr b/libexec/rc/rc.subr index e21504248749..1c01f1cfd071 100644 --- a/libexec/rc/rc.subr +++ b/libexec/rc/rc.subr @@ -2083,7 +2083,7 @@ find_local_scripts_new() { if [ -d "${dir}" ]; then for file in `grep -l '^# PROVIDE:' ${dir}/* 2>/dev/null`; do case "$file" in - *.sample) ;; + *.sample|*.pkgsave) ;; *) if [ -x "$file" ]; then local_rc="${local_rc} ${file}" fi @@ -2094,6 +2094,19 @@ find_local_scripts_new() { done } +find_system_scripts() { + system_rc='' + for file in /etc/rc.d/*; do + case "${file##*/}" in + *.pkgsave) ;; + *) if [ -x "$file" ]; then + system_rc="${system_rc} ${file}" + fi + ;; + esac + done +} + # check_required_{before|after} command # Check for things required by the command before and after its precmd, # respectively. The two separate functions are needed because some