diff options
author | Ed Maste <emaste@FreeBSD.org> | 2023-05-01 17:25:18 +0000 |
---|---|---|
committer | Ed Maste <emaste@FreeBSD.org> | 2023-05-04 16:45:50 +0000 |
commit | f6488428308edeb1fb8fc8aa0eb4e2744db78748 (patch) | |
tree | a01ac28cd2262caf82c7c63cffebccefa97cc438 | |
parent | 63c903e874da4d8d4a81cba9d7bdfecfe0169598 (diff) | |
download | src-f6488428308edeb1fb8fc8aa0eb4e2744db78748.tar.gz src-f6488428308edeb1fb8fc8aa0eb4e2744db78748.zip |
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
(cherry picked from commit 2a3bd0870869819354b5ea65761d13e5e2987697)
-rw-r--r-- | tools/pkgbase/metalog_reader.lua | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/tools/pkgbase/metalog_reader.lua b/tools/pkgbase/metalog_reader.lua index 3e8cf8461914..9cc5fd727923 100644 --- a/tools/pkgbase/metalog_reader.lua +++ b/tools/pkgbase/metalog_reader.lua @@ -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 |