From nobody Thu Mar 23 15:10:59 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 4Pj81H3cWpz41Sk2; Thu, 23 Mar 2023 15:10:59 +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 4Pj81H2zzRz4cwj; Thu, 23 Mar 2023 15:10:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679584259; 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=FPggQOmj8Wl31ILh+vk3uXCjOTavPMR1Wn4tQsPJYKs=; b=UHLW1rO7/uhk3P+X8KB/xxxvip4/W//i36KiSltyk1+b3uxxltv9YuSV+0evQtRnaE6Lqw Appm+l1iWUlQs0F7E5wxpJTbhDKgfAy1AflkT1qQsB5ukubh132jLkjF+cITk/CPOPfjnp vad+k81BBR3JEEaQfph/Eg3LcJjNSj+ZlK69QOykrKQ6Y2TPnoux1n5ZBJfr8g2yPERqHH 5A56h+gXS0gK6grF/gD/7RpXtKIgCqgUJyoXYMyzVtXKf7Iqv1EHwrrcFsT8iZPY9hUNs8 RBQYJcsJNvspDEpsABJ1NlGWjkCCRIMH5HNGWE6rrrBkxHMXDnmLL93DTdX3FQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679584259; 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=FPggQOmj8Wl31ILh+vk3uXCjOTavPMR1Wn4tQsPJYKs=; b=Ny+NemtxLA/y3O2D48V2IpK/dTdP6X0BViYsOOnS1LhtrxXFjcmeNw4vEewFVdFPRRyxmS aPqm6jdscrsiu8uPZ+cY3OoU2NRXIm9EtGru/jdzFBSayVADeOARn1ZYTcviFNS+pVHeDw hDeaPa9XqY3Z1daPAsl0eBjXLbbRPEFpUE7rGLZ/zI3+j2Thnv7Mmpu3gDacJ8MLv+qnEi VrQ41A4gBIpgojwMxW++ZLETCAMKnKbWxpY45kCpCk8DsXbb0vo+F12T8AGdodFXOxOvEA cRlZq3xBjt4e6VZ2wAlIMjeokGJ5LDroub9Eni16/uIOIZvyAOOtNnUvwPIALw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679584259; a=rsa-sha256; cv=none; b=JZPlEfIdVH07XfnNFhVlDZm0fVVyow2XrHBOmSaY/AZ3I8uPj7Nv1Kb3oj5fGuS70H60G0 CWSouzvpES6v5o7o5DkLpeOjR+TiCGCwx3JS3ij0oFgO/xl8KtaUK6BPgGuFh5WJiLPyGU vFKFa0jE4k0DC+QFsufjNVamnSoT6Q0ZiNGIUiZy0jGYEF+vmDIo9wqY2ImjRbPPbBErN7 QYztHtvjHlmpiHWUlJ5fO0jEY/Hq9t0T6XG7VlNi7dj4jLuVFGfyVC6/juzTPX0T01nLDu pn9FHZUvb/OyWOWXthq/Wfv9YuAY9aMXFbEK6w6/urUqi2iDO4NXutK/bVmecA== 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 4Pj81H206Mzgk0; Thu, 23 Mar 2023 15:10:59 +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 32NFAxBT055070; Thu, 23 Mar 2023 15:10:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32NFAxHh055054; Thu, 23 Mar 2023 15:10:59 GMT (envelope-from git) Date: Thu, 23 Mar 2023 15:10:59 GMT Message-Id: <202303231510.32NFAxHh055054@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: 39c9fd8f2beb - stable/13 - pkgbase: report errors via metalog reader exit status 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: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 39c9fd8f2bebe2edfb700d0dd0458089ba687a7e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=39c9fd8f2bebe2edfb700d0dd0458089ba687a7e commit 39c9fd8f2bebe2edfb700d0dd0458089ba687a7e Author: Ed Maste AuthorDate: 2022-11-23 21:40:22 +0000 Commit: Ed Maste CommitDate: 2023-03-23 15:10:47 +0000 pkgbase: report errors via metalog reader exit status Reviewed by: kevans Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D37482 (cherry picked from commit f93d92f43d984c1d927c7c12d06ae1497d12deea) --- tools/pkgbase/metalog_reader.lua | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tools/pkgbase/metalog_reader.lua b/tools/pkgbase/metalog_reader.lua index 72cfcf46c95b..3e8cf8461914 100644 --- a/tools/pkgbase/metalog_reader.lua +++ b/tools/pkgbase/metalog_reader.lua @@ -86,13 +86,14 @@ function main(args) local sess = Analysis_session(filename, verbose, w_notagdirs) + local errors if printall then io.write('--- PACKAGE REPORTS ---\n') io.write(sess.pkg_report_full()) io.write('--- LINTING REPORTS ---\n') - print_lints(sess) + errors = print_lints(sess) elseif checkonly then - print_lints(sess) + errors = print_lints(sess) elseif pkgonly then io.write(sess.pkg_report_simple(dcount, dsize, { fuid and sess.pkg_issetuid or nil, @@ -103,6 +104,10 @@ function main(args) io.stderr:write('This text should not be displayed.') usage() end + + if errors then + return 1 + end end --- @param man boolean @@ -151,6 +156,7 @@ function print_lints(sess) local inodewarn, inodeerr = sess.inode_report() io.write(inodewarn) io.write(inodeerr) + return #duperr > 0 or #inodeerr > 0 end --- @param t table @@ -520,4 +526,4 @@ function Analysis_session(metalog, verbose, w_notagdirs) } end -main(arg) +os.exit(main(arg))