From nobody Sun May 22 20:14:43 2022 X-Original-To: dev-commits-ports-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 581CB1B4A18E; Sun, 22 May 2022 20:14:44 +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 4L5sBW5SQCz3h9Y; Sun, 22 May 2022 20:14:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1653250483; 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=pFOAXkDxdxJjwyGugYwmJXydMG+xs0Od1hlT7R/MLog=; b=lhlanQ759qakYflPdEe+HV9gnbDtlC0sjH0qrrmhFRwukxnYOMGpoA1Oz/JR02WiDB8QVX /IMR6cBN00zGVqNhrQK/r5qsVU1hwSADoDl9Uv8Dl93yMt7eNV6kQDcFHMpfjost47IGuR DrZzqcnQ7vk8lDR2J1DZJrjjdOwwhdFczBoOmTKJOHcA7CKes/ytCta2Lh5Z9gUok0XGc0 VzJM8QS/MhsjXC1jDmVye0dKPSgc0c8TQWFAdDLFHo2fgNgW5ocGPFBgyYczLcfU3AwILq zGucldxEwbFZUIBdzbN0/g2DheMyk+xlGsdFZZsYwCvqzYDyiMi3MSgeApU2gA== 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 9B4AA21E1A; Sun, 22 May 2022 20:14:43 +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 24MKEh2V089967; Sun, 22 May 2022 20:14:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 24MKEh66089966; Sun, 22 May 2022 20:14:43 GMT (envelope-from git) Date: Sun, 22 May 2022 20:14:43 GMT Message-Id: <202205222014.24MKEh66089966@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: =?utf-8?Q?Stefan E=C3=9Fer?= Subject: git: 1f357cdb9252 - main - Tools/scripts: update port_conflicts_check.lua List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: se X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1f357cdb9252a62151de9903f52397374ad1d322 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1653250483; 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=pFOAXkDxdxJjwyGugYwmJXydMG+xs0Od1hlT7R/MLog=; b=iqq01t/s1YZ6qw2f69g0Z4VHFlm2lJG0agkynEXFfzWumfCelvVDhxwDp+7uqpBDnQgNAT IAR/6brObMvp2hxobBvl/F3hP7lqbjL/QvfdgARx3/kmrsYm+kkx7lIdqQl2NybgOl/oOX unH43nk96WNUnDO7kq/uFJAm52+SIwis4TM14HiBLGtsghheZmGRVz/y9WL0nOiocnDJLj W4RAjsTnPitRGBsDauQFkWU4TBEi4sEjOpRm/IlEasttJPL3LomogbQO/UzSbTihayP8Pk lf1JpvJtYhEjta2pMNfaiVNOWv+O0J5t4sEvpt0nrO5wWsPSLx0MpWyZq11AMw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1653250483; a=rsa-sha256; cv=none; b=KBOIzjtImZMZMOMO69+1P/yqwiCHg3WCBH2Z3w5kdJvaxrgjutxj1WpFwHzgHimQeMzWsV e+INp1GGfdVvJV8oNg+8p4GPl2dB2IM6L8vz1QY1ilEJTyXKsoBpKz7iigECC9DpZiaknY c822v2iZGojDt9b9wJ48Tluo9TngNR93m9WSfoIrONvHSgZsMTUn3CsRsY0f/ncEVqrgg3 XMtKsAowGBqcC9sEc7a2TQDa5KjVs+k6McmwR6btj5gjyUl4Sl2vm1gDqX6pKQ6Zr86mtq L02M1uYZpnYrBvtjuCV5AqYDOXak+47kUIDOyQwXmULDFNiU9LDc4kOVrruexA== 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/ports/commit/?id=1f357cdb9252a62151de9903f52397374ad1d322 commit 1f357cdb9252a62151de9903f52397374ad1d322 Author: Stefan Eßer AuthorDate: 2022-05-22 20:13:41 +0000 Commit: Stefan Eßer CommitDate: 2022-05-22 20:13:41 +0000 Tools/scripts: update port_conflicts_check.lua Check that the package file database exists and that it is up-to-date. --- Tools/scripts/port_conflicts_check.lua | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Tools/scripts/port_conflicts_check.lua b/Tools/scripts/port_conflicts_check.lua index ed81ad008298..c5265af19a5a 100755 --- a/Tools/scripts/port_conflicts_check.lua +++ b/Tools/scripts/port_conflicts_check.lua @@ -55,6 +55,7 @@ require "lfs" ------------------------------------------------------------------- local file_pattern = "." local database = "/var/db/pkg/provides/provides.db" +local max_age = 1 * 24 * 3600 -- maximum age of database file in seconds ------------------------------------------------------------------- local function table_sorted_keys(t) @@ -154,6 +155,20 @@ end ------------------------------------------------------------------- local function read_files(pattern) local files_table = {} + local now = os.time() + local modification_time = lfs.attributes(database, "modification") + if not modification_time then + print("# Aborting: package file database " .. database .. " does not exist.") + print("# Install the 'pkg-provides' package and add it as a module to 'pkg.conf'.") + print("# Then fetch the database with 'pkg update' or 'pkg provides -u'.") + os.exit(1) + end + if now - modification_time > max_age then + print("# Aborting: package file database " .. database) + print("# is older than " .. max_age .. " seconds.") + print("# Use 'pkg provides -u' to update the database.") + os.exit(2) + end local pipe = io.popen("locate -d " .. database .. " " .. pattern) if pipe then for line in pipe:lines() do