]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
When running pkg_add -r, check & install our dependencies for each
authorbrian <brian@FreeBSD.org>
Fri, 19 Jun 2009 17:07:38 +0000 (17:07 +0000)
committerbrian <brian@FreeBSD.org>
Fri, 19 Jun 2009 17:07:38 +0000 (17:07 +0000)
commit020220234336a0527c3a4eb5fe739a256bd31981
tree7a28f52b43e5a7153d8f58917ed64d7cc7d49968
parentda4e70cf9ab3e05f67d77de37a7c6c335a5f7e4b
When running pkg_add -r, check & install our dependencies for each
package rather than expecting our top level package to get all of
the dependencies correct.

Previously, the code depended on the top level package having all
of the pkgdep lines in +CONTENTS correct and in the right order,
but that doesn't always happen due to code such as this (in
security/gnutls/Makefile):

    .if (defined(WITH_LZO) || exists(${LOCALBASE}/lib/liblzo2.so)) && !defined(WITHOUT_LZO)
    LIB_DEPENDS+=           lzo2:${PORTSDIR}/archivers/lzo2
    ....

With such conditional dependencies, my 'sophox-packages' package won't
install.  The dependency tree looks like this:

    sophox-packages
      ...
      x11/gnome2
        x11/gnome-applets
          net/libgweather
            devel/libsoup
              security/gnutls
                security/libgcrypt
                  security/libgpg-error
      ...
      x11/gnome2
        archivers/file-roller
          archivers/gtar
            archivers/lzop
              archivers/lzo2
      ...

gnutls doesn't depend on lzo2 initially, but lzo2 is dragged into the
mix via other dependencies and is built by the initial 'make'.  The
subsequent package generation for gnutls adds a pkgdep line for lzo2
to gnutls' +CONTENTS but the pkgdeps in sophox-packages' +CONTENTS
has gnutls *before* lzo2.

As a result, sophox-packages cannot install; gnutls fails because lzo2
is missing, 82 more packages fail because gnutls is missing and the
whole thing spirals into a super-confusing mess!

MFC after: 3 weeks
usr.sbin/pkg_install/add/perform.c
usr.sbin/pkg_install/create/perform.c
usr.sbin/pkg_install/info/perform.c
usr.sbin/pkg_install/lib/lib.h
usr.sbin/pkg_install/lib/pen.c
usr.sbin/pkg_install/lib/url.c