Getting a list of dependencies which have to be installed ?

2006-12-14 Thread Frank Staals

Hey...,

Is there a utility to display the dependencies of a port which have yet 
to be installed ? I know you can get a complete dependency list on 
freebsd.org/ports , pkg_info -r or just looking in the files in the 
ports dir. But is there a command to display only the dependencies which 
haven't been installed on your system yet ? I also looked at pkg_add -n 
but it immediately starts fetching the packages needed. I don't want to 
start downloading the complete package just because I want a list of 
ports I haven't installed yet.


Or is the only way making a diff between the pkg_info -r output and your 
pkg_info -a ? If so : Is there a way to tell pkg_info when using the -r 
flag on a not-yet-installed-port to only get a list of the dependencies 
instead of downloading the complete package ? Or is there just an other 
utility which can display this information which I'm not aware of ?


Thanks in advance,

--
-Frank Staals


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Getting a list of dependencies which have to be installed ?

2006-12-14 Thread Chad Gross

On 12/14/06, Frank Staals [EMAIL PROTECTED] wrote:


Hey...,

Is there a utility to display the dependencies of a port which have yet
to be installed ? I know you can get a complete dependency list on
freebsd.org/ports , pkg_info -r or just looking in the files in the
ports dir. But is there a command to display only the dependencies which
haven't been installed on your system yet ? I also looked at pkg_add -n
but it immediately starts fetching the packages needed. I don't want to
start downloading the complete package just because I want a list of
ports I haven't installed yet.

Or is the only way making a diff between the pkg_info -r output and your
pkg_info -a ? If so : Is there a way to tell pkg_info when using the -r
flag on a not-yet-installed-port to only get a list of the dependencies
instead of downloading the complete package ? Or is there just an other
utility which can display this information which I'm not aware of ?

Thanks in advance,

--
-Frank Staals


___




Yes, read man ports before asking :
http://www.freebsd.org/cgi/man.cgi?query=portsapropos=0sektion=0manpath=FreeBSD+6.1-RELEASEformat=html

cd to the dir of the port you wish to know the dependencies of and issue one
or both of these commands:

*pretty-print-run-depends-list*, *pretty-print-build-depends-list*
  Print a list of all the compile and run dependencies,
  and dependencies of those dependencies.


Chad
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Getting a list of dependencies which have to be installed ?

2006-12-14 Thread Randy Pratt
On Thu, 14 Dec 2006 19:10:27 +0100
Frank Staals [EMAIL PROTECTED] wrote:

 Hey...,
 
 Is there a utility to display the dependencies of a port which have yet 
 to be installed ? I know you can get a complete dependency list on 
 freebsd.org/ports , pkg_info -r or just looking in the files in the 
 ports dir. But is there a command to display only the dependencies which 
 haven't been installed on your system yet ? I also looked at pkg_add -n 
 but it immediately starts fetching the packages needed. I don't want to 
 start downloading the complete package just because I want a list of 
 ports I haven't installed yet.
 
 Or is the only way making a diff between the pkg_info -r output and your 
 pkg_info -a ? If so : Is there a way to tell pkg_info when using the -r 
 flag on a not-yet-installed-port to only get a list of the dependencies 
 instead of downloading the complete package ? Or is there just an other 
 utility which can display this information which I'm not aware of ?

I don't know of a utility that does that function.  Like you, I often
want to know what I'm committing to when installing a new port so I
wrote a small script to do just that:

what_do_i_need.sh
=
#!/bin/sh
#titleList needed ports not already installed/title

portsdir=`make -V PORTSDIR`
pkgdbdir=`make -V PKG_DBDIR`
indexfile=`make -V INDEXFILE`

origin_list=`pwd` `make all-depends-list`

for origin in ${origin_list}; do
#  echo ORIGIN: ${origin}
   pkg_name=`grep |${origin}| ${portsdir}/${indexfile} \
  | cut -d | -f 1`
   padding=$(( 50 - `echo ${origin} | wc -c` +1))
   if [ ! -e ${pkgdbdir}/${pkg_name} ]; then
  printf  NEED: ${origin}%${padding}c${pkg_name}\n  
   fi
done
=

Put it in your path somewhere, chmod to executable and use like:
# cd xawtv
# what_do_i_need.sh 
 NEED: /usr/ports/multimedia/xawtv   xawtv-3.95_1
 NEED: /usr/ports/x11-fonts/tv-fonts tv-fonts-1.1

It will only list the needed ports butyou can modify it to do as
you want.  Its probably a wise idea to make sure all ports have
been updated to match your ports tree.

HTH,

Randy
-- 
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Getting a list of dependencies which have to be installed ?

2006-12-14 Thread Frank Staals

Chad Gross wrote:



On 12/14/06, *Frank Staals* [EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED] wrote:


Hey...,

Is there a utility to display the dependencies of a port which
have yet




utility which can display this information which I'm not aware of ?

Thanks in advance,

--
-Frank Staals


___



Yes, read man ports before asking : 
http://www.freebsd.org/cgi/man.cgi?query=portsapropos=0sektion=0manpath=FreeBSD+6.1-RELEASEformat=html 
http://www.freebsd.org/cgi/man.cgi?query=portsapropos=0sektion=0manpath=FreeBSD+6.1-RELEASEformat=html


cd to the dir of the port you wish to know the dependencies of and 
issue one or both of these commands:


*pretty-print-run-depends-list*, *pretty-print-build-depends-list*
  Print a list of all the compile and run dependencies,
  and dependencies of those dependencies.

Chad

By running those commands you just get the complete dependency list of 
the port, that was not what I was asking for: I only wanted it to 
display the dependencies I don't have yet ..


--
-Frank Staals


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Getting a list of dependencies which have to be installed ?

2006-12-14 Thread Eric Schuele

On 12/14/2006 12:10, Frank Staals wrote:

Hey...,

Is there a utility to display the dependencies of a port which have yet 
to be installed ? I know you can get a complete dependency list on 
freebsd.org/ports , pkg_info -r or just looking in the files in the 
ports dir. But is there a command to display only the dependencies which 
haven't been installed on your system yet ? I also looked at pkg_add -n 
but it immediately starts fetching the packages needed. I don't want to 
start downloading the complete package just because I want a list of 
ports I haven't installed yet.


Or is the only way making a diff between the pkg_info -r output and your 
pkg_info -a ? If so : Is there a way to tell pkg_info when using the -r 
flag on a not-yet-installed-port to only get a list of the dependencies 
instead of downloading the complete package ? Or is there just an other 
utility which can display this information which I'm not aware of ?


Thanks in advance,



I needed this functionality, so I wrote a script... and sent it to the 
list for thoughts and opinions.  After a few folks chipped in... this is 
what we had.


Try the following (mind any wrapping):
#! /bin/sh

# Script to determine the differences between what is necessary for
# a port, and what is already present on the local machine.

awkprgt='{
count = 0
pkgs = 
for(i=5; i=NF-2; i++) {
  pkg = $i

  # the if is here to hack it around when you get:
  # This port requires package(s)  to build.
  if (pkg != \\) {
if (index(pkg, \) == 1)
  {pkg = substr(pkg, 2, length(pkg)-1)}
if (index(pkg, \)  1)
  {pkg = substr(pkg, 1, length(pkg)-1)}

if ( system(pkg_info -e  pkg) == 1) {
  pkgs = pkgs   pkg
  count++
}
  }
}

if ( count ) {
  printf You need the following %d (%typ) perequisites:, count
  print pkgs
}
else {
  print All (%typ) prerequisites are present.
}

  }
  END {
# triggered, eg., by audio/artswrapper (on my box, at least)
if( ! FNR) {
  print Bogus (empty) %s dependency information
}
  }
'

awkit() {
# Resolve %s-s via sed is a blunt hack
# but good enough here and thus we don't have
# to care about the number of occurrences
awk `echo $awkprgt | sed s/%typ/$1/g`
}


make pretty-print-build-depends-list | awkit build

make pretty-print-run-depends-list | awkit run

### End Script

HTH.  I use it all the time.

--
Regards,
Eric
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Getting a list of dependencies which have to be installed ?

2006-12-14 Thread Chris Whitehouse

Frank Staals wrote:

Hey...,

Is there a utility to display the dependencies of a port which have yet 
to be installed ? I know you can get a complete dependency list on 
freebsd.org/ports , pkg_info -r or just looking in the files in the 
ports dir. But is there a command to display only the dependencies which 
haven't been installed on your system yet ? I also looked at pkg_add -n 
but it immediately starts fetching the packages needed. I don't want to 
start downloading the complete package just because I want a list of 
ports I haven't installed yet.


Hi Frank,

It's not exactly what you want but at least it contains what you want: 
portmanager -s displays the status of each port including missing 
dependencies.


Chris

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]