An interesting discussion started earlier this week: upstream dependents.
At present, FreshPorts captures and displays the information output from:
make -V BUILD_DEPENDS -V RUN_DEPENDS -V LIB_DEPENDS
For a given port, this tells up what that port depends upon for building, running, and libraries.
The request is for this same information, but in the reverse ordering; what ports depend upon this port.
So far, I think we have a simple solution. A new table:
create table port_dependencies ( port_id integer not null, port_id_dependent_upon integer not null, dependency_type char(1) not null, primary key (port_id, port_id_dependent_upon, dependency_type) ); alter table port_dependencies add foreign key (port_id) references ports (id) on update cascade on delete cascade; alter table port_dependencies add foreign key (port_id_dependent_upon) references ports (id) on update cascade on delete cascade;
It’s still early in the day, and I’ve not had breakfast. Thus, I think it’s a good idea for you to provide feedback on this. :)
I’ve decided to start with a populated table and go from from there.
Here we have ports and their ID
22514 libwps
482 libtool
2763 doxygen
And some output:
INSERT INTO port_dependencies (port_id, port_id_dependent_upon, dependency_type)
VALUES (22514, 482, ‘B’);
INSERT INTO port_dependencies (port_id, port_id_dependent_upon, dependency_type)
VALUES (22514, 2763, ‘B’);
And we’ll go from there. My first goal will be writing the code to display this information on the webpages.
This is the query I’ll need for displaying details on the webpage:
We now have proof of concept at http://dev.freshports.org/textproc/libwps/
Now for the big work: populating and maintaining the new table.
This may be useful when I come to process the depends:
Initial testing with Ade’s code on a recent lang/gcc45/ commit.
The B depends are
archivers/zip – devel/gmake – devel/binutils – devel/bison – lang/perl5.8
The R depends are
devel/binutils
The L depends are
math/gmp – math/mpfr – math/mpc – converters/libiconv
We now have a great little stored procedure:
SELECT PortsDependenciesAdd (‘lang/gcc45’, ‘lang/perl5.8’, ‘B’);
Which looks like this:
Last night, I realized the website already has this functionality. Here are all the ports which depend upon archivers/zip:
http://www.freshports.org/search.php?stype=depends_all&method=match&query=archivers%2Fzip&num=100&orderby=category&orderbyupdown=asc&search=Search
I am now running the upgrade script on http://beta.freshports.org… then I’ll let that site run for a while with the new code before moving over to production.
It appears we have created some monsters. Look at the size of this page:
We also have: PATCH_DEPENDS FETCH_DEPENDS and EXTRACT_DEPENDS.
Thanks for bf for pointing this out. I shall leave this for another weekend. It should be trivial to add in. It’s just code. No database changes.
dougb just mentioned: make run-depends-list and make build-depends-lis