pkgbase: hide duplicate METALOG directory warnings under verbose

Creating directories multiple times is an inherent side effect of the
way installation is done.  Hide warnings from duplicate directory
entries (with identical metadata) under metalog_reader's verbose mode.

Duplicate file entries are always reported.  They currently generate
warnings but will be switched to errors once the few instances currently
in the tree are fixed.

PR:		244596, 271178
Reviewed by:	kevans
Sponsored By:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D39898
This commit is contained in:
Ed Maste 2023-05-01 13:25:18 -04:00
parent 75baf3765c
commit 2a3bd08708

View file

@ -392,12 +392,18 @@ function Analysis_session(metalog, verbose, w_notagdirs)
if #rows == 1 then goto continue end
local iseq, offby = metalogrows_all_equal(rows)
if iseq then -- repeated line, just a warning
warn[#warn+1] = 'warning: '..filename
.. ' ' .. rows[1].attrs.type
..' repeated with same meta: line '
..table.concat(
table_map(rows, function(e) return e.linenum end), ',')
warn[#warn+1] = '\n'
local dupmsg = filename .. ' ' ..
rows[1].attrs.type ..
' repeated with same meta: line ' ..
table.concat(table_map(rows, function(e) return e.linenum end), ',')
if rows[1].attrs.type == "dir" then
if verbose then
warn[#warn+1] = 'warning: ' .. dupmsg .. '\n'
end
else
-- XXX downgrade to warning until instances in the tree are fixed (PR271178)
warn[#warn+1] = 'error: ' .. dupmsg .. '\n'
end
elseif not metalogrows_all_equal(rows, false, true) then
-- same filename (possibly different tags), different metadata, an error
errs[#errs+1] = 'error: '..filename