Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 27 Sep 2008 23:54:29 -0700
From:      "Garrett Cooper" <yanefbsd@gmail.com>
To:        ports@freebsd.org
Subject:   Usefulness of pkg_depend command?
Message-ID:  <7d6fde3d0809272354o2da84929t62ca7f585d486a1f@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
Hi porters,
     Just thinking -- one of the problems with many utilities is
mapping dependencies with installing either packages or ports. Would
there be any interest in a C app (based off the same code in
pkg_install already) in the base system being able to provide
dependency info for a list of ports / pkgs provided, s.t. we could
have a shell script to simply install items in order via the
BUILD_DEPS and RUN_DEPS fields in INDEX files?
     The driving force behind this is that I should be able to do the
following to upgrade my ports / pkgs instead of depending on
complicated infrastructures to do this for me:

#!/bin/sh

for pkg in `pkg_depend -o $@ | grep '<' | cut -d ' ' -f 1`; do
        cd /usr/ports/$pkg || continue
        make clean all || continue
        make deinstall install
done
# END

      I realize that pkg_cutleaves brute forces this logic and
pkg_tree does similar. My point was to implement it in C with existing
logic in pkg_install for both performance reasons and to prevent code
duplication as much as possible.
Thanks,
-Garrett



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?7d6fde3d0809272354o2da84929t62ca7f585d486a1f>