Received: from mail.netbsd.org (mail.NetBSD.org [199.233.217.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK)) by mollari.NetBSD.org (Postfix) with ESMTPS id 0E9287ABE7 for ; Sun, 31 Jan 2016 17:27:43 +0000 (UTC) Received: by mail.netbsd.org (Postfix, from userid 605) id B229E85EBB; Sun, 31 Jan 2016 17:27:42 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id 4036885E8B for ; Sun, 31 Jan 2016 17:27:42 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([IPv6:::1]) by localhost (mail.netbsd.org [IPv6:::1]) (amavisd-new, port 10025) with ESMTP id SgcwdaHMx5Ol for ; Sun, 31 Jan 2016 17:27:41 +0000 (UTC) Received: from cvs.NetBSD.org (unknown [IPv6:2001:470:a085:999:28c:faff:fe03:5984]) by mail.netbsd.org (Postfix) with ESMTP id D428484CFB for ; Sun, 31 Jan 2016 17:27:41 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id C7D39FBB7; Sun, 31 Jan 2016 17:27:41 +0000 (UTC) Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" MIME-Version: 1.0 Date: Sun, 31 Jan 2016 17:27:41 +0000 From: "Roland Illig" Subject: CVS commit: pkgsrc/mk To: pkgsrc-changes@NetBSD.org Reply-To: rillig@netbsd.org X-Mailer: log_accum Message-Id: <20160131172741.C7D39FBB7@cvs.NetBSD.org> Sender: pkgsrc-changes-owner@NetBSD.org List-Id: pkgsrc-changes.NetBSD.org Precedence: bulk Module Name: pkgsrc Committed By: rillig Date: Sun Jan 31 17:27:41 UTC 2016 Modified Files: pkgsrc/mk: subst.mk pkgsrc/mk/wrapper: bsd.wrapper.mk Log Message: Fixed subst.mk not to corrupt files Up to now, using subst.mk may have led to file corruption during active package development. This happened when a sed(1) command had a syntax error, in which case the whole sed(1) command was terminated, leaving an empty original file behind. This commit changes that behavior by applying the sed(1) commands to the original file and saving the result in a temporary file. Only after that succeeded is the original file overwritten. During this rewrite, SUBST_POSTCMD has been removed, since it was only used in one place (mk/wrapper), and since it relied on the exact sequence of the internal commands. No package in either main pkgsrc or pkgsrc-wip uses this variable right now. To generate a diff of this commit: cvs rdiff -u -r1.54 -r1.55 pkgsrc/mk/subst.mk cvs rdiff -u -r1.93 -r1.94 pkgsrc/mk/wrapper/bsd.wrapper.mk Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.