FreshPorts / freshports

The website part of FreshPorts
http://www.freshports.org/
BSD 2-Clause "Simplified" License
68 stars 24 forks source link

Add links for conflicts #103

Open dlangille opened 5 years ago

dlangille commented 5 years ago

Shall we add links for dependencies?

see also https://news.freshports.org/2018/09/26/adding-and-populating-conflicts/

dlangille commented 5 years ago

Looking at https://dev.freshports.org/devel/binutils/ I see:

Conflicts:
  CONFLICTS:
    libbfd-[0-9]*

Conflicts Matches:
  There are no matches for this port. This is usually an error.

The code to populate the Conflict Matches already exists. It just needs to be invoked on regular basis. Here is a manual update:

[dan@pg03:~] $ psql freshports.dev
psql (11.1)
Type "help" for help.

freshports.dev=# begin;
BEGIN
freshports.dev=# delete from ports_conflicts_matches;
DELETE 50836
freshports.dev=# insert into ports_conflicts_matches SELECT PC4.*                                                                                
freshports.dev-#   FROM ports_conflicts PC, LATERAL (SELECT * FROM port_conflicts(PC.id, '^' || PC.item_value || '$')) PC4;
INSERT 0 75920
freshports.dev=# commit;
COMMIT
freshports.dev=# begin;
BEGIN
freshports.dev=# delete from ports_conflicts_matches;
DELETE 75920
freshports.dev=# explain analyse insert into ports_conflicts_matches SELECT PC4.*                                                                                
  FROM ports_conflicts PC, LATERAL (SELECT * FROM port_conflicts(PC.id, '^' || PC.item_value || '$')) PC4;
                                                             QUERY PLAN                                                             
------------------------------------------------------------------------------------------------------------------------------------
 Insert on ports_conflicts_matches  (cost=0.26..227756.03 rows=11377000 width=12) (actual time=34475.188..34475.188 rows=0 loops=1)
   ->  Nested Loop  (cost=0.26..227756.03 rows=11377000 width=12) (actual time=15.449..33758.483 rows=75920 loops=1)
         ->  Seq Scan on ports_conflicts pc  (cost=0.00..215.77 rows=11377 width=21) (actual time=0.374..7.404 rows=11261 loops=1)
         ->  Function Scan on port_conflicts  (cost=0.26..10.26 rows=1000 width=12) (actual time=2.994..2.994 rows=7 loops=11261)
 Planning Time: 1.550 ms
 Trigger for constraint ports_conflicts_matches_conflicts_id: time=945.716 calls=75920
 Trigger for constraint ports_conflicts_matches_port_id: time=1048.466 calls=75920
 Execution Time: 36490.057 ms
(8 rows)

freshports.dev=# 
dlangille commented 5 years ago

How about a script which gets invoked by freshports daemon?

Why don't we create and use a queue?

dlangille commented 5 years ago

This script should be invoked by the queue processing daemon.

grahamperrin commented 2 years ago

https://github.com/FreshPorts/freshports/issues/103#event-2046496724 yes, a #conflicts anchor will be nice, if that's what's intended here.