depends

Sharing something I just came across, which has made my life a great deal more pleasant. Rewritten into .bashrc format.

[CMD=""]## reveals dependencies of a /usr/ports package
alias depends='make pretty-print-run-depends-list'[/CMD]

Does what:
Code:
[root@sigma /usr/ports/lang/rubinius]# depends 
This port requires package(s) "gdbm-1.9.1" to run.
// ahh, this is ok with me!

Code:
[root@sigma /usr/ports/lang/jruby]# depends 
This port requires package(s) "bash-4.2.37 dejavu-2.33 expat-2.0.1_2 fontconfig-2.9.0,1 freetype2-2.4.9_1 gettext-0.18.1.1 inputproto-2.0.2 java-zoneinfo-2012.g javavmwrapper-2.4_1 jpeg-8_3 kbproto-1.0.5 libICE-1.0.7,1 libSM-1.2.0,1 libX11-1.4.4,1 libXau-1.0.6 libXaw-1.0.9,2 libXdmcp-1.1.0 libXext-1.3.0_1,1 libXft-2.1.14 libXi-1.4.5,1 libXmu-1.1.0,1 libXp-1.0.1,1 libXpm-3.5.9 libXrender-0.9.6 libXt-1.1.1,1 libXtst-1.2.0 libiconv-1.14 libpthread-stubs-0.3_3 libxcb-1.7 open-motif-2.3.3_2 openjdk6-b27 pkgconf-0.8.9 png-1.5.12 printproto-1.0.5 recordproto-1.14.1 renderproto-0.11.1 xbitmaps-1.1.1 xextproto-7.2.0 xproto-7.0.22" to run.
// OMG no way! Glad I saw that coming!


Wish I'd known about this years ago... Nominating to make this function more prevalent to the community.
 
Yup mine would be # alias depends man ports

or this would suffice =)
# alias depends 'man ports | less -p pretty-print-run-depends-list'

no need for bashrc here either. works just fine in csh(1)
 
Great information everyone. I like one-look views and concise usefulness to eliminate confusion. FreeBSD9.1's new installer seems to reflect this - very nice.

This basic script now tells me the important details of a port immediately.

Code:
#!/bin/sh

## Purpose: Gives information about a port from its location in /usr/ports/[]/[]

echo "Port description:"
cat pkg-descr
echo
make pretty-print-run-depends-list
echo 
echo "..and is missing:"
make missing
make clean

Code:
[root@sigma /usr/ports/www/apache22]# depends 
Port description:
The Apache HTTP Server Project is an effort to develop and maintain an
open-source HTTP server for various modern desktop and server operating
systems, such as UNIX and Windows NT. The goal of this project is to
provide a secure, efficient and extensible server which provides HTTP
services in sync with the current HTTP standards.
The 2.x branch of Apache Web Server includes several improvements like
threading, use of APR, native IPv6 and SSL support, and many more.

WWW: http://httpd.apache.org/

This port requires package(s) "apr-1.4.6.1.4.1_1 db42-4.2.52_5 expat-2.0.1_2 gdbm-1.9.1 libiconv-1.14 pcre-8.31_1 perl-threaded-5.16.0" to run.

..and is missing:
devel/apr1
databases/gdbm
databases/db42
===>  Cleaning for apache22-2.2.22_8
[root@sigma /usr/ports/www/apache22]#
 
realtime said:
Great information everyone. I like one-look views and concise usefulness to eliminate confusion. FreeBSD9.1's new installer seems to reflect this - very nice.

This basic script now tells me the important details of a port immediately.

Code:
#!/bin/sh

## Purpose: Gives information about a port from its location in /usr/ports/[]/[]

echo "Port description:"
cat pkg-descr
echo
make pretty-print-run-depends-list
echo 
echo "..and is missing:"
make missing
make clean

Code:
[root@sigma /usr/ports/www/apache22]# depends 
Port description:
The Apache HTTP Server Project is an effort to develop and maintain an
open-source HTTP server for various modern desktop and server operating
systems, such as UNIX and Windows NT. The goal of this project is to
provide a secure, efficient and extensible server which provides HTTP
services in sync with the current HTTP standards.
The 2.x branch of Apache Web Server includes several improvements like
threading, use of APR, native IPv6 and SSL support, and many more.

WWW: http://httpd.apache.org/

This port requires package(s) "apr-1.4.6.1.4.1_1 db42-4.2.52_5 expat-2.0.1_2 gdbm-1.9.1 libiconv-1.14 pcre-8.31_1 perl-threaded-5.16.0" to run.

..and is missing:
devel/apr1
databases/gdbm
databases/db42
===>  Cleaning for apache22-2.2.22_8
[root@sigma /usr/ports/www/apache22]#

Now you need a switch to recursively check the dependencies.
I like dpends -r # but it's your program.
 
Considered it, but I think the job is done. Going over each port required by hand seems to be the safer route.
 
Back
Top