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

Website Feedback
 New Topic  |  Go to Top  |  Go to Topic  |  Search  |  Log In   Newer Topic  |  Older Topic 
 Search for command
Author: anonymous1234 
Date:   19-05-07 15:01

The ability to find the port that installs a given command or other
file would be useful to me. For example, I was just compiling some
software from source and it required the pngtopnm command. There is
no port by that name, but it turns out that this command is part of
the netpbm port. Similarly, mkisofs is often needed, but is part of
the cdrtools port.

So, I'd like to have a FreshPorts feature that returns the netpbm port
when I search for the pngtopnm command, for example. It could be an
extra option in the first drop-down list in the search form -- the one
whose items currently are: port name, package name, latest link, and
so on.

To implement this, you need the list of files installed by each port.
This is available in the pkg-plist file in the port directory, though
I think some ports also specify files in their Makefile that are not
in pkg-plist. A good start is to grep the pkg-plist files for lines
starting with "bin/" or "sbin/", and register the last pathname
component in each such line as a command name for the port.

Reply To This Message
 Re: Search for command
Author: Dan 
Date:   10-08-07 20:13

This is a good idea. If you can start scripting the code to extract the filenames from pkg-plist, that'll be a big help.

Preferably use Python, or Perl.

Ideally, given a pkg-plist filename, the code returns a list of installed components.

The Man Behind The Curtain

Reply To This Message
 Re: Search for command
Author: Dan 
Date:   10-08-07 20:22

Have a look at this:

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:
 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-2018 Dan Langille. All rights reserved.