Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

AFAIK this is the way that I can install for ex.: XYZ on OpenBSD:

pkg_add -Uvi XYZ

How can I get a list for all the dependencies regarding XYZ package?

-> So I need a list about .tgz filenames that pkg_add will download/install/update when I need to install given XYZ package.

What is the command to generate a list for XYZ package?

share|improve this question
    
please ask if it's unclear :) –  gasko peter May 8 '12 at 22:24
    
Why not just grab the ports tree, and check the Makefile for the ports you care about? –  gabe. Jun 22 '12 at 17:48

1 Answer 1

up vote 2 down vote accepted

Looks like dependencies are specified in the packing list. You can see the packing list with pkg_info -f.

So, assuming PKG_PATH is already set:

pkg_info -f XYZ | grep '^@depend' | cut -f 3 -d :

should give you the package names.

Prepending $PKG_PATH and appending .tgz to each line should give you a URL that's probably what would be downloaded, e.g. to get bash's dependencies:

PKG_PATH=http://ftp3.usa.openbsd.org/pub/OpenBSD/5.1/packages/amd64/
export PKG_PATH
pkg_info -f bash | grep '@depend' | cut -f 3 -d : | while read package; do
    echo $PKG_PATH$package.tgz
done

prints

http://ftp3.usa.openbsd.org/pub/OpenBSD/5.1/packages/amd64/libiconv-1.14.tgz
http://ftp3.usa.openbsd.org/pub/OpenBSD/5.1/packages/amd64/gettext-0.18.1p1.tgz

See also pkg_add -n and PKG_CACHE.

References:

share|improve this answer
    
sqlports is simpler :) openports.se/databases/sqlports –  J.F. May 16 '12 at 1:55

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.