From nobody Thu Jul 06 15:39:53 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 4QxghB14QRz4lXl7; Thu, 6 Jul 2023 15:39:54 +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 4QxghB0Zmdz3DYt; Thu, 6 Jul 2023 15:39:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1688657994; 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=877cKfzQwljcuRq4WWLQwEgzSRy9s0ze1ISdXt++I8Y=; b=SnYAGECrz6k65FB3y1+mQrXmZWohAyC2O/IPZ7/drChWXxIuy0wG7wqdd3v7hmZl/Oh3qB wBKBUfHjHuqaN5s6iXeph9yC56h7Cjqf8aJXI5g7CSuOT/0xOyKpiroeyuKVmvy5ZRurJQ wdzU7iBIrLWt7gsUx9RR2S5R8QXRCfO8+j+NSG69AA/W/s4g7S4VJr4hJzN3KfhW1vzMl/ iEYYRU46kA784I9kxwQe5MCQSlOsrqIh4wvGg+jflZ2bFunMSnc/ZazdyOfoVwzF9oI2vB kTlMickEc6hMDNeRpESVy3crgun+4voCoJsJYvHHZR8wXDW4YUg0buS2V+CEUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1688657994; 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=877cKfzQwljcuRq4WWLQwEgzSRy9s0ze1ISdXt++I8Y=; b=tbvsOGQFbicHztzUjmejBLzTdUCSNlslTOpFJkZxl+L9H5sY+38mW/n4zQJrz9oWHR1D1r 0/1TASHSmTVIXN/moheg7EpfR/7wUvGm7Efsatg/62fm8v+dJFVwMKcEaUPk+gumRlZRdk ox0wSi6LEQKfvFvdQAPwb2ce7gk12K6D4rcPOGkx5iQVPrN6IcH3l2D8DsYYbX3cJzPwIj CdbGYTsEgqVHPZ3uJJonULqvrtGzzfd/tY96A7TeNVds160DL938t2x9gtDP8FdSc3TPRn XkoXM/MBDL/FHxqc0t4U2i2u/nuzjW7hdPz1UfscWBlZjWCYmqpYAH5KkWFymA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1688657994; a=rsa-sha256; cv=none; b=tuExc0JGaarcoZ++A0ByMl8bWorw8U88Plte1iU3aDyVSs5tHIedo0QZEzi5vvhuEZPxmb nc1pSr0+VxVPqlTmpoETNOpCpjO0c8/C2th9XretlPrQU3v+EOHshH64CpRQOxr3OMlcwK d51bF9goXcrt5cbIkd7U339NI64PEJ1FKrF78PA+M3oZBTA814nFFlqVhYcCoZOOJN+Lm5 EnMqrjjFZ960JEedR3Z4xPdzpvoNk357SqntUoz5yjADEcNIVsK9NcsjXV9/QNfRSV0B9+ ClCNQA1GcCfIWJVmgpajHdiussgjos88smS/vBx5AXMc2f10w4Sj5uupB79nlw== 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 4Qxgh96kFXz12MJ; Thu, 6 Jul 2023 15:39:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 366FdrYT000994; Thu, 6 Jul 2023 15:39:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 366FdrSe000993; Thu, 6 Jul 2023 15:39:53 GMT (envelope-from git) Date: Thu, 6 Jul 2023 15:39:53 GMT Message-Id: <202307061539.366FdrSe000993@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 98358de5754c - stable/12 - Fix spurious error from sysrc 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: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 98358de5754cc85b50309323ff72a66193502107 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=98358de5754cc85b50309323ff72a66193502107 commit 98358de5754cc85b50309323ff72a66193502107 Author: Devin Teske AuthorDate: 2019-12-02 05:24:16 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2023-07-06 15:39:23 +0000 Fix spurious error from sysrc When using sysrc to modify a file, the file should be created silently. However, with the introduction of SVN r335280, an error of "No such file or directory" would appear despite everything else working as-expected. The nature of this spurious error is that SVN r335280 did not check if the file exists first, before trying to fixup the line-endings in the file just prior to modification. PR: bin/240875 Reported by: Jose Luis Duran MFC after: 3 days (cherry picked from commit e19a2226fe3bbeeb6e922987475300868374d09a) --- usr.sbin/bsdconfig/share/sysrc.subr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/bsdconfig/share/sysrc.subr b/usr.sbin/bsdconfig/share/sysrc.subr index 010d240f680a..11298f00f47a 100644 --- a/usr.sbin/bsdconfig/share/sysrc.subr +++ b/usr.sbin/bsdconfig/share/sysrc.subr @@ -560,7 +560,7 @@ f_sysrc_set() # if [ "$not_found" ]; then # Add a newline if missing before appending to the file - awk 'BEGIN { wc = 0 } NR == 1 { + [ ! -e "$file" ] || awk 'BEGIN { wc = 0 } NR == 1 { (cmd = "wc -l " FILENAME) | getline close(cmd) wc = $1