From nobody Tue Sep 06 19:13:30 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 4MMZmV380Yz4bTJw; Tue, 6 Sep 2022 19:13:30 +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 4MMZmV2bM4z3dsP; Tue, 6 Sep 2022 19:13:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1662491610; 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=rb619x5MsJ95GeZl+aOb+93gV0jNPAWRirSpxcRGXNo=; b=LpuOjRjbTBT4gQxr0jN7EjXAg/RCaDbEffUPaIQoo94WiSJCVj0r63yYR3jiosknbLxf56 YGEYdYvhnabTBsOC3+ErvuDa49Hl5rJkpkWV9IrbaHqpms+RDekmzc3N9ECH8Kd3BO7uVr Ss3FE9A0RsbbLrdb76mEjfyqrYfnqQWttYJdm9jak5UqkwpHN8i/Ia0E5E54YrFr1PzdRQ 5tYB75FzoyNgz04+NRdFq1M2eiTDlRR6M8a2LFm2JYAM2Pq9tHEgHWiheo+7neurV5+ngP K9B0hgEq748MLJMeeoz2k/uaD8clbaGY2OZZjN4R345vL6YXWHSyi0B67jnT9A== 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 4MMZmV1c4KzGqY; Tue, 6 Sep 2022 19:13:30 +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 286JDUDq021095; Tue, 6 Sep 2022 19:13:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 286JDUFG021094; Tue, 6 Sep 2022 19:13:30 GMT (envelope-from git) Date: Tue, 6 Sep 2022 19:13:30 GMT Message-Id: <202209061913.286JDUFG021094@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 16354ca2d8c4 - stable/12 - newvers.sh: avoid regenerating vers.c if content unchanged 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: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 16354ca2d8c45e2e72bffbb61d99f5fe3858b6de Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1662491610; 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=rb619x5MsJ95GeZl+aOb+93gV0jNPAWRirSpxcRGXNo=; b=XPIC2C5FvjENebtLUA9YbCJ1dYcgTxn3kgXy31A/f61MOFOhgdVqBS+tBRn4TDh/ICF32k PpgKNLoVSZxnErEZ+2kpuo9ElR2yIt4VyIQNrerMCQWfvBUNK7aYIsoM3h704R2I576UiW 4hJ5uCJRuSUKtY4mihgVLcHRErBNjZoi9soiLQyA0bHyMEgsBtRRtOVqn87eYsK/uj+Ucb ZtHh1ALnX+q9bUX42cwXxGtcHsGKgj1MHowiL5xooqgnUHLVh0aB+p4NTUR6cfUS/Zhqm5 7DrJrW7yybfCna4idp9jEYSknJgfoSAMFEFjwrjoKjoSLfCdoO0bn35iIt4lig== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1662491610; a=rsa-sha256; cv=none; b=CJKQbmpq9gzXXzgTECa9ttZ6cV+INIh8YgjsmmC55Ds4hlYBbN1uXPAu2qzU/qQwFDd+2u 5Wt4FWTvH3BAJo8cs6u+yWa+IhA6+sO7HfDKHjob2ljU4XW6GPQGhNdslp70jRxU66QhZe 0K0ikMeto1bTaRyzyqWFEU1iPtqk72efqCXMNNm7YST97HneRNN2zkfsdkzHj+3qSOoWUH HCOv2qoxkluJKomJ9NFqhk1TcdC2XlU+8/oFy1WPhDq9EWiWMj+ETrFQ8VCCagsPocHPRw EtruIWpmC9ztSGkSh56psOcH+CI3e0Wh/fV+R9CbDGavS3a8KpTQjbPX16vE/g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=16354ca2d8c45e2e72bffbb61d99f5fe3858b6de commit 16354ca2d8c45e2e72bffbb61d99f5fe3858b6de Author: Ed Maste AuthorDate: 2018-11-07 20:36:57 +0000 Commit: Ed Maste CommitDate: 2022-09-06 19:11:09 +0000 newvers.sh: avoid regenerating vers.c if content unchanged When reproducible build mode is enabled vers.c may be unchanged between successive builds. In this case avoid changing the file's metadata so that it does not cause dependent targets to be rebuilt. Sponsored by: The FreeBSD Foundation Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D17892 (cherry picked from commit 179460e1481ef98aa6824681ee472b0764c9d9a0) --- sys/conf/newvers.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index 18ada43e0cbc..542dae42b567 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -285,7 +285,7 @@ else VERSTR="${VERINFO}\\n ${u}@${h}:${d}\\n" fi -cat << EOF > vers.c +vers_content_new=$(cat << EOF $COPYRIGHT #define SCCSSTR "@(#)${VERINFO}" #define VERSTR "${VERSTR}" @@ -299,5 +299,10 @@ char osrelease[sizeof(RELSTR) > 32 ? sizeof(RELSTR) : 32] = RELSTR; int osreldate = ${RELDATE}; char kern_ident[] = "${i}"; EOF +) +vers_content_old=$(cat vers.c 2>/dev/null || true) +if [ "$vers_content_new" != "$vers_content_old" ]; then + echo "$vers_content_new" > vers.c +fi echo $((v + 1)) > version