From nobody Sun Dec 18 08:59:22 2022 X-Original-To: dev-commits-ports-main@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 4NZcGL2pKfz1Gx3P; Sun, 18 Dec 2022 08:59:22 +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 4NZcGL21Mxz3FPt; Sun, 18 Dec 2022 08:59:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1671353962; 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=1KRozfIDYwW8t/caEpwZVsmFq1Li+SuBTwOn6lxnUyg=; b=R5q0uoOgys0Pi0yGBZXEmS3ty8LqJV5t7rMK++51clYBQvngSnDHnOJqgrh5E0gGoyRqVC /92UqUEmbV+0b1wySkyj7HlJfoDjqelbYlSj0N9oB4kHsAk24iThIyvFCjKof0+sRbvPQ6 CTFUzkKCrPDXfJGHfEuzX8UvA92F7Ip9pAKpjbIYzx9d7lbMozQ6NAFjchApO9aFDP6NaT zIdnGa8PksfoyyHs5SgviflrmCXKK6vAReKzj+oSK8XBZCROIZfzBESQ80XJVdkngC20wT rQtoMTd+Z3WEScVjWakuqe1hmUkqUXVgQnbIyE1TmHQJDEwNKr/NIpStV1KCDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1671353962; 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=1KRozfIDYwW8t/caEpwZVsmFq1Li+SuBTwOn6lxnUyg=; b=i4gAD4XmQmos3+NJnCQkuq8aKBRJr4MimycKBQDg1e3nRnmI54jWOvXhsWeRvdM0F5sTvs acw1F93S0oBBCGrubWlDc/Hu5vJWkfCx+SVQuAXfsltwUIaqpF+9tRI+VMHaoacx6y49Je s5+aW/Zj7TsrspMjkC4PtrUNFfm2I+TjMf03laoqh8J2q0b+bTb0ywyLBfMhoZEb9dSD4z ELDtemlnhxTEH1D+vo2zvaONABA6nNZfUZdxuolpsVyh3qUjm06yJUMsaWAIStGtpji3BL HryuPF9F0BgdIOeslDpfzGleaucKqgpWOPMQ+IbMGVLd4vXtWig1J7FPkxNJIQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1671353962; a=rsa-sha256; cv=none; b=BaQjUr4VEQDkwakYSWxmxPUYXsDHMip/G7PLKi69MfzIEJilPHauS+ZCfKroQYnZTFKqpQ tnZ8YtddcIkXLm0BNMTwVI8S48KICMk6yKWRmootbQBOF7X0vGsMULLDnhYcXszKQWLGgp 4sR7OzDC42Thd3RxPSkwJcOgePp32BSFl8CG2Wv24tPNHE9B+L6LYebVq7QoTpUz/oPdCo r0LYpgcefWPn84AdONvBQ58j2R0Nf9aiMljXWDYjYyjTthcynCG0SRIzVhr+OsW7fWSIBa UjZ1e6+AV3MAJY7VCOGYjtnz5AGcSOwgr/1bc1ePHa9a00DuvvCSzEXMmJv1OA== 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 4NZcGL10l1z1PRm; Sun, 18 Dec 2022 08:59:22 +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 2BI8xMFi046506; Sun, 18 Dec 2022 08:59:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2BI8xMbn046505; Sun, 18 Dec 2022 08:59:22 GMT (envelope-from git) Date: Sun, 18 Dec 2022 08:59:22 GMT Message-Id: <202212180859.2BI8xMbn046505@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: "Tobias C. Berner" Subject: git: 414b5c616456 - main - .hooks/pre-commit.d: unbreak EPOCH checker List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tcberner X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 414b5c61645669a346fc817e0b5852c265b96187 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by tcberner: URL: https://cgit.FreeBSD.org/ports/commit/?id=414b5c61645669a346fc817e0b5852c265b96187 commit 414b5c61645669a346fc817e0b5852c265b96187 Author: Matthias Andree AuthorDate: 2022-11-27 12:51:51 +0000 Commit: Tobias C. Berner CommitDate: 2022-12-18 08:58:17 +0000 .hooks/pre-commit.d: unbreak EPOCH checker dns/dnsmasq-devel as of 2.88rc3 contained a comment about PORTEPOCH, which I removed in the 2.88rc5. This tripped up the checker because it assumed that if git yielded lines containing PORTEPOCH, then it must have been PORTEPOCH= or similar lines. Untrue in my case. It was printing [pre-commit] dropped PORTEPOCH in dns/dnsmasq-devel/Makefile To solve, only pick out PORTEPOCH diffs that are actual assignments, and if the new PORTEPOCH is empty, and the old one is also, ignore this condition (previously we would exit 1, which is bogus). Also, grep without -E should not have \ in front of - or +. FreeBSD 13.1 grep is fine, but GNU grep ignores those backslashes noisily (and I have prepended it to PATH) and emits warnings. PR: 268024 --- .hooks/pre-commit.d/check_portepoch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.hooks/pre-commit.d/check_portepoch b/.hooks/pre-commit.d/check_portepoch index 1a59a39b5407..34d93e2efcf4 100755 --- a/.hooks/pre-commit.d/check_portepoch +++ b/.hooks/pre-commit.d/check_portepoch @@ -5,9 +5,9 @@ check_epoch() { local makefile="$1" - local old_epoch=$(git diff --cached -U0 "${makefile}" | grep '^\-PORTEPOCH' | grep -oE '[0-9]+') - local new_epoch=$(git diff --cached -U0 "${makefile}" | grep '^\+PORTEPOCH' | grep -oE '[0-9]+') - if [ -z "${new_epoch}" ] ; then + local old_epoch=$(git diff --cached -U0 "${makefile}" | grep '^-PORTEPOCH.*=' | grep -oE '[0-9]+') + local new_epoch=$(git diff --cached -U0 "${makefile}" | grep '^+PORTEPOCH.*=' | grep -oE '[0-9]+') + if [ -z "${new_epoch}" -a -n "${old_epoch}" ] ; then echo "[pre-commit] dropped PORTEPOCH ${old_epoch} in ${makefile}" exit 1 fi