From nobody Sat Jan 22 12:10:40 2022 X-Original-To: dev-commits-src-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 A339E196F075; Sat, 22 Jan 2022 12:10:40 +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 4Jgw7N4Db6z3lf8; Sat, 22 Jan 2022 12:10:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642853440; 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=g/uFEXVpFXOA1cgvIlmaR+at07ZwUPYbX9V1wqDyVYg=; b=FbrW8LqDGCNdoXO1CtuGB/ugXJon/y1ZxtI0GvCOKtudikxbHtwBurKaZ1Kz/i0EUn9qDL YQAsxf4CvNftj48gWGufH26n3YxuISTiZM/Wttqophqfz50zJDXx3U8vvJ1uZOuuC0DwVP HxZHJYu73jtU7CEnf/D3IXigA1QCicXKC7VNaHuCkJs5KCJCfqEMPk6S2KKAEU6hIJVozO TmBv6OtmymmoQjI3Dau+7C+W0IeSrrMFSszX4RDhxIBo60H50V62ja+dUMvuFukliQ3kuc +yNWQat3dzbYgw7wBPyHxVGU8pYN2E3qP18JNFdvUxi9xR8PhSVDqCqAshd75A== 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 70C6F6D49; Sat, 22 Jan 2022 12:10:40 +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 20MCAePs008679; Sat, 22 Jan 2022 12:10:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20MCAeS6008678; Sat, 22 Jan 2022 12:10:40 GMT (envelope-from git) Date: Sat, 22 Jan 2022 12:10:40 GMT Message-Id: <202201221210.20MCAeS6008678@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Stefan E=C3=9Fer?= Subject: git: f89afaa148f1 - main - port_conflicts_check.lua: revert commit 82bfeeff10da List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: se X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f89afaa148f183964ffdf708910d1c2e2f19d274 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642853440; 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=g/uFEXVpFXOA1cgvIlmaR+at07ZwUPYbX9V1wqDyVYg=; b=n0iLk08OFSdgcCSdyykklssDqBAcyCg5+CLcXmNPTGwYFarg1J9AkIj5LXeIck4/LWPRbC dIIfzYvA6Dc42vDz5K/aC1Hjs4uoXvhinRftRKlVEuzXo5N84PvDwTO2oUCpbJRM6CiGwc IibVdOH8q/o2scgZoAuEGctjunzHSnxcScZAZa4dcSWEdDM0T5vnZwxiKcqghSq8iZsZRI lJensNi2N+i3jBIHqyQymfM+LW1vBObaC9sojc67vOxNqi/oyrD5ixjxsG2/WWPpX4X/Nz rhyOFPBIHe6RImjKovIN0/LEUn0A2C84agbYHJxXqBss0EbFHMLhLZSgVTKdNQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1642853440; a=rsa-sha256; cv=none; b=Pk9IUnu9mGAMF8QUWxRVbrqBD0yZbGd98EW5smwl+R4tSimueUk0bPtFysfiX4wwImI07h TQCLsQchTse0w5Pse0HhJBqEK0TOa/QGFBStbeKfTgX0JRa/cqRhKoOkTa2C62MPag9E8m LPTsIS/E7qbPlN4QpH2ULBVnQrOm/2QKm8DAXIdGapMtaQFIeiOIa367FKa74L1yl40nfS MYLPK69biUCE3FtwOwEaE5bQksuzCazQlsPcPN7dndT0eq8qbuYOZajO5Iu3X33KzjAym9 YqpceLWVt08S5HytaL7DlfcJWHan94ex002IYB0TGpo9aIpyEDC2sQNMkToMkQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=f89afaa148f183964ffdf708910d1c2e2f19d274 commit f89afaa148f183964ffdf708910d1c2e2f19d274 Author: Stefan Eßer AuthorDate: 2022-01-22 12:08:15 +0000 Commit: Stefan Eßer CommitDate: 2022-01-22 12:08:15 +0000 port_conflicts_check.lua: revert commit 82bfeeff10da An enhanced version of this script has been committed to the ports repository as /usr/ports/Tools/scripts/port_conflicts_check.lua. --- tools/tools/portconflicts/port_conflicts_check.lua | 184 --------------------- 1 file changed, 184 deletions(-) diff --git a/tools/tools/portconflicts/port_conflicts_check.lua b/tools/tools/portconflicts/port_conflicts_check.lua deleted file mode 100755 index ced7cc619f4d..000000000000 --- a/tools/tools/portconflicts/port_conflicts_check.lua +++ /dev/null @@ -1,184 +0,0 @@ -#!/usr/libexec/flua - ---[[ -SPDX-License-Identifier: BSD-2-Clause-FreeBSD - -Copyright (c) 2022 Stefan Esser - -Generate a list of existing and required CONFLICTS_INSTALL lines -for all ports (limited to ports for which official packages are -provided). - -This script depends on the ports-mgmt/pkg-provides port for the list -of files installed by all pre-built packages for the architecture -the script is run on. - -The script generates a list of ports by running "pkg provides ." and -a mapping from package base name to origin via "pkg rquery '%n %o'". - -The existing CONFLICTS and CONFLICTS_INSTALL definitions are fetched -by "make -C $origin -V CONFLICTS -V CONFLICTS_INSTALL". This list is -only representative for the options configured for each port (i.e. -if non-default options have been selected and registered, these may -lead to a non-default list of conflicts). - -The script detects files used by more than one port, than lists by -origin the existing definition and the list of package base names -that have been detected to cause install conflicts followed by the -list of duplicate files separated by a hash character "#". - -This script uses the "hidden" LUA interpreter in the FreeBSD base -systems and does not need any port except "pkg-provides" to be run. - -The run-time on my system checking the ~32000 packages available -for -CURRENT on amd64 is 150 seconds. ---]] - -require "lfs" - -local index_file = "/usr/ports/INDEX-14" - -local function read_index () - local ORIGIN = {} - - local pipe = io.popen("pkg rquery '%n %o'") - for line in pipe:lines() do - local pkgbase, origin = string.match(line, "(%S+) (%S+)") - ORIGIN[pkgbase] = origin - end - pipe:close() - return ORIGIN -end - -local function read_files() - local FILES_TABLE = {} - - local pkgbase, version - local pipe = io.popen("pkg provides .") - for line in pipe:lines() do - local label = string.sub(line, 1, 10) - if label == "Name : " then - name = string.sub(line, 11) - pkgbase, version = string.match(name, "(.*)-([^-]*)") - elseif label == " " or label == "Filename: " then - local file = string.sub(line, 11) - if file:sub(1, 10) == "usr/local/" then - file = file:sub(11) - else - file = "/" .. file - end - local t = FILES_TABLE[file] or {} - t[#t + 1] = pkgbase - FILES_TABLE[file] = t - end - end - pipe:close() - return FILES_TABLE -end - -local PKG_PAIRS = {} - -for file, pkgbases in pairs(read_files()) do - if #pkgbases > 1 then - for i = 1, #pkgbases -1 do - local pkg_i = pkgbases[i] - for j = i + 1, #pkgbases do - local pkg_j = pkgbases[j] - if pkg_i ~= pkg_j then - p1 = PKG_PAIRS[pkg_i] or {} - p2 = p1[pkg_j] or {} - p2[#p2 + 1] = file - p1[pkg_j] = p2 - PKG_PAIRS[pkg_i] = p1 - end - end - end - end -end - -local CONFLICT_PKGS = {} -local CONFLICT_FILES = {} - -for pkg_i, p1 in pairs(PKG_PAIRS) do - for pkg_j, p2 in pairs(p1) do - CONFLICT_PKGS[pkg_i] = CONFLICT_PKGS[pkg_i] or {} - CONFLICT_PKGS[pkg_j] = CONFLICT_PKGS[pkg_j] or {} - CONFLICT_FILES[pkg_i] = CONFLICT_FILES[pkg_i] or {} - CONFLICT_FILES[pkg_j] = CONFLICT_FILES[pkg_j] or {} - table.insert(CONFLICT_PKGS[pkg_i], pkg_j) - table.insert(CONFLICT_PKGS[pkg_j], pkg_i) - for _, file in ipairs(p2) do - table.insert(CONFLICT_FILES[pkg_i], file) - table.insert(CONFLICT_FILES[pkg_j], file) - end - end -end - -local function table_sorted_keys(t) - result = {} - for k, _ in pairs(t) do - result[#result + 1] = k - end - table.sort(result) - return result -end - -local function table_sort_uniq(t) - local result = {} - local last - - table.sort(t) - for _, entry in ipairs(t) do - if entry ~= last then - last = entry - result[#result + 1] = entry - end - end - return result -end - -local ORIGIN = read_index() - -local RESULT_PATTERN = {} - -for pkg, pkgs in pairs(CONFLICT_PKGS) do - local origin = ORIGIN[pkg] - - if origin then - table.sort(pkgs) - RESULT_PATTERN[origin] = table.concat(pkgs, " ") - end -end - -local FILE_LIST = {} - -for pkg, files in pairs(CONFLICT_FILES) do - local origin = ORIGIN[pkg] - - if origin then - FILE_LIST[origin] = table.concat(table_sort_uniq(files), " ") - end -end - -for _, origin in ipairs(table_sorted_keys(RESULT_PATTERN)) do - local pipe = io.popen("make -C /usr/ports/" .. origin .. " -V CONFLICTS -V CONFLICTS_INSTALL 2>/dev/null") - local conflicts_table = {} - local seen = {} - for line in pipe:lines() do - for word in line:gmatch("(%S*)%s?") do - if word ~= "" and not seen[word] then - table.insert(conflicts_table, word) - seen[word] = true - end - end - end - pipe:close() - table.sort(conflicts_table) - conflicts_string = table.concat(conflicts_table, " ") - local conflicts_new = RESULT_PATTERN[origin] - if conflicts_string ~= conflicts_new then - print("< " .. origin, conflicts_string) - print("> " .. origin, conflicts_new .. " # " .. FILE_LIST[origin]) - print() - end -end