FreshPorts -- The Place For Ports If you buy from Amazon USA, please support us by using this link.
Follow us
Blog
Twitter

I am looking for an LTO tape library. Do you have one to spare?
Website Feedback
 New Topic  |  Go to Top  |  Go to Topic  |  Search  |  Log In   Newer Topic  |  Older Topic 
 Feature Request: upstream dependents
Author: tjp 
Date:   02-02-11 02:26

You know what would be really handy is the ability to see what ports require the port shown. This would particularly be helpful when you have a library and want to know who is using it.

Thanks for the great website/service.

Reply To This Message
 
 Re: Feature Request: upstream dependents
Author: Dan 
Date:   02-02-11 23:38

For example, http://www.freshports.org/textproc/libwps/ shows:

Required To Build: devel/doxygen, devel/libtool
Required To Run: misc/gnomehier
Required Libraries: textproc/libwpd

What you'd like to see at devel/libtool is a reference to textproc/libwps.

Do I understand correctly?

--
The Man Behind The Curtain

Reply To This Message
 
 Re: Feature Request: upstream dependents
Author: tjp 
Date:   04-02-11 14:49

Yes, exactly.

If I maintain a library, I would like to know who is using it without having to install every port and use pkg_info.

Reply To This Message
 
 Re: Feature Request: upstream dependents
Author: Dan 
Date:   05-02-11 15:11

The issue I see is how this information is presently stored in the database. For each port, there are three depends fields:

depends_build
depends_run
depends_lib

Each one is a text field. For example, the depends_run field contains the output of the 'make -V RUN_DEPENDS' command. Going back to our previous example, libtool, the data stored for textproc/libwps is:

freshports.org=# SELECT depends_build FROM ports_active WHERE name = 'libwps';
depends_build
------------------------------------------------------------------------
doxygen:/usr/ports/devel/doxygen libtool>=2.2:/usr/ports/devel/libtool
(1 row)

freshports.org=#

As you can see, this is a multi-value field; there are two depends in there: doxygen and libtool. That design decision is what is stopping us from quickly and easily implementing your request.

What is needed is a cross reference table, which references the dependent port from the depending port. Something such as:

depending_port_id int
dependent_port_id int
dependency_type char(1)

Where:
depending_port_id points to libwps
dependent_port_id points to libtool
dependency_type is 'B' for build

There would be a similar entry for doxygen:

depending_port_id points to libwps
dependent_port_id points to doxygen
dependency_type is 'B' for build

This table could be maintained through triggers. Each time a port is changed, this table would be updated.

Suggestion welcome. Consider alternative solutions, field names, etc. It's early in my day and I may not be thinking clearly. ;)

--
The Man Behind The Curtain

Reply To This Message
 
 Re: Feature Request: upstream dependents
Author: Dan 
Date:   05-02-11 17:32

We now have proof of concept at http://dev.freshports.org/textproc/libwps/

Now for the big work: populating and maintaining the new table.

See also: http://news.freshports.org/2011/02/05/what-ports-are-dependant-upon-this-port/

--
The Man Behind The Curtain

Reply To This Message
 
 Re: Feature Request: upstream dependents
Author: Dan 
Date:   06-02-11 13:03

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

--
The Man Behind The Curtain

Reply To This Message
 
 Re: Feature Request: upstream dependents
Author: tjp 
Date:   06-02-11 14:58

I took a look at the proof of concept. You have the new field named as "These ports depend upon this port: for Libraries". What about shortening this to "Required by"?

Reply To This Message
 
 Re: Feature Request: upstream dependents
Author: tjp 
Date:   06-02-11 15:02

You are right. This is what I was looking for. Thanks!

Reply To This Message
 
 Re: Feature Request: upstream dependents
Author: Dan 
Date:   06-02-11 15:16

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.

--
The Man Behind The Curtain

Reply To This Message
 
 But wait! There's more.
Author: Dan 
Date:   07-02-11 02:37

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.

--
The Man Behind The Curtain

Reply To This Message
 Forum List  |  Threaded View   Newer Topic  |  Older Topic 


 Forum List  |  Need a Login? Register Here 
 User Login
 User Name:
 Password:
 Remember my login:
   
 Forgot Your Password?
Enter your email address or user name below and a new password will be sent to the email address associated with your profile.


Servers and bandwidth provided by
New York Internet, SuperNews, and RootBSD
Valid HTML, CSS, and RSS.
Copyright © 2000-2014 Dan Langille. All rights reserved.