From nobody Sun Nov 20 03:07:20 2022 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 4NFFn46QZ7z4hgjM; Sun, 20 Nov 2022 03:07:20 +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 4NFFn45xqrz40pQ; Sun, 20 Nov 2022 03:07:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1668913640; 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=M0v+6xUt4Bd+B07yXpbOTSfqHul+JAepK06EWwGR/TY=; b=ulMrGFsxJbO0d2OgRzVoL6IWmzYDUK8Lw9yhoCDtjUNnsNJVkvxID9vecgEVl37m0RpVRC 3U5u89u1IHB99C/INxru5fI5rmhYuSGEYG6fQapHlROhXclKOjfSbd89lF3nJApZC2IdUd bGxTwSuWFVPiAIDm/5QQQo5grwPHVMWD6t7/T95GVoFL05tLvwpY8gSljwbb1fw2vd1aGb uwhffaXT+0NATIPvXUdeersgxoT8cGqskZzLcocR0zogT/P4O2uVT8YgkZMgLAg8S+egnB YH/m9I+wQSV+ERLywj2AXU0IyHqzuEK8BbE6ob5Wdg8vDGmbDsqsVdm1nxOjBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1668913640; 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=M0v+6xUt4Bd+B07yXpbOTSfqHul+JAepK06EWwGR/TY=; b=u+sho7VHSQBS4gopbVNwluCSHNVQ8AanXqe/kpEO45xT5ZB+RPRmXaxHFO8nOIeHiEUkfl o+ZG4woe4AnuUOUf+6on6PWJjdzB1VZ5/WehPlMwUfv8VPLax6RuymmY4qICP8Pu5Y6P+L txAj2cZuXeNFBjzjD4mxBVy1lEj7pUomeFH1Z3Fxb43dlLXJDvlZp/1hKSX8GCLrGCEAJ7 lDswwZxD+Yn7SEenhDQe9vmdCq+9Tp3SVJxJgcFHTT8HH7CCWmD5GV97tWiRKESXj+rniE dl0ZOZnQUDdhSPPcBqWmzLHrZONss78ZgWyZ5sWq+s7EPdTOdNjbbQvkueRytw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1668913640; a=rsa-sha256; cv=none; b=iMWwwxZ7ZEJmcte+oDzQ2vQmsffd5hQwDgvPEzVqkhTlEi+zEc2kkCGV8tAxQhcdC3pDlA 2plfrSa+3jEBC/lpw7f86hzypcmtPKp2XLiAdSUezK2IsuLJ+vCdCFkLiU0G6zfI5JnnIS 22wbXVELG+WmTO0rUd4cokI5eALWeIcogi4wLSxeuIS2//6cEMFwiEvpK3XaySMldfD5cn SXthzDV/S2a91xn0Z1HseKQu0eHpDDX3/4lVfMDf85ttUrKSr/sBBbe13CIvfnxXlzB6Rz KNcQLwldmscvsHd1wDg616rPsZuaG/yvMO5BQkeWBTGnDVtcUzSrKAUP6RnEiw== 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 4NFFn452dzz18Q2; Sun, 20 Nov 2022 03:07:20 +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 2AK37KlD020462; Sun, 20 Nov 2022 03:07:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2AK37KV8020461; Sun, 20 Nov 2022 03:07:20 GMT (envelope-from git) Date: Sun, 20 Nov 2022 03:07:20 GMT Message-Id: <202211200307.2AK37KV8020461@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: ee0c57076688 - stable/13 - pkgbase: examine METALOG files relative to stage root directory 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: ee0c57076688642e2e9d5173850dd245803e0754 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=ee0c57076688642e2e9d5173850dd245803e0754 commit ee0c57076688642e2e9d5173850dd245803e0754 Author: Ed Maste AuthorDate: 2022-11-16 19:53:42 +0000 Commit: Ed Maste CommitDate: 2022-11-19 19:12:47 +0000 pkgbase: examine METALOG files relative to stage root directory Previously we stripped the '.' from the beginning of each METALOG entry to determine the path to stat. This meant that we examined files on the build host, not the staged files. Instead, strip off the last part of the specified METALOG pathname to find the stage root directory, and stat files relative to that. Reviewed by: bapt Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D37412 (cherry picked from commit bca4d27052bf5735725449cd0be51bd58cf0cb80) --- tools/pkgbase/metalog_reader.lua | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tools/pkgbase/metalog_reader.lua b/tools/pkgbase/metalog_reader.lua index c3b5b6039873..02f8c4ab65bd 100644 --- a/tools/pkgbase/metalog_reader.lua +++ b/tools/pkgbase/metalog_reader.lua @@ -257,6 +257,7 @@ end --- @param verbose boolean --- @param w_notagdirs boolean turn on to also check directories function Analysis_session(metalog, verbose, w_notagdirs) + local stage_root = {} local files = {} -- map -- set is map. if bool is true then elem exists local pkgs = {} -- map> @@ -418,17 +419,14 @@ function Analysis_session(metalog, verbose, w_notagdirs) if files[filename][1].attrs.type ~= 'file' then goto continue end - -- make ./xxx become /xxx so that we can stat - filename = filename:sub(2) - local fs = attributes(filename) + local fs = attributes(stage_root .. filename) if fs == nil then unstatables[#unstatables+1] = filename goto continue end local inode = fs.ino inm[inode] = inm[inode] or {} - -- add back the dot prefix - table.insert(inm[inode], '.'..filename) + table.insert(inm[inode], filename) ::continue:: end @@ -462,6 +460,9 @@ function Analysis_session(metalog, verbose, w_notagdirs) return table.concat(warn, ''), table.concat(errs, '') end + -- The METALOG file is assumed to be at the top of the stage directory. + stage_root = string.gsub(metalog, '/[^/]*$', '/') + do local fp, errmsg, errcode = io.open(metalog, 'r') if fp == nil then