Hello,
I'm searching for a way to automaticaly doing the following actions:
1/ update port tree (OPENBSD_4_0)
2/ get installed packages and find corresponding ports
3/ build this packages from ports.

Maybe i missed the point but i don't find an existing way to do that.
I'm using the following way to get packages path and flavor from installed package
Is there a better way to do that (throught pkg(1), pkg_info for example) ?


-----
PKG_DB=/var/db/pkg
PORTS=/usr/ports

PACKAGES=$(cd ${PKG_DB}; find . -maxdepth 1 -type d -and \! -name "." )

for i in ${PACKAGES}; do
   pkg_name=$(basename $i)
   grep "^$pkg_name\|" $PORTS/INDEX |awk -F\| '{print $2}'
   if [ $? -gt 0 ]; then
       echo "${pkg_name} not found in ports tree" >& 2
   fi
done
----

Reply via email to