Broken _DEPENDS logic

Matthew Seaman matthew at FreeBSD.org
Sun May 3 21:48:38 UTC 2015


On 03/05/2015 20:27, Roger Marquis wrote:
> Short of editing mail/mailman/Makefile and building the port is there a
> way force 'pkg install' to just install a package and ignore its
> dependencies?  The man page doesn't indicate any such logic (a difference
> from other package managers).

pkg(8) goes to a great deal of effort to ensure that all the necessary
dependencies are installed.  Avoiding that: well, you'll quite likely
regret it, but...

    pkg install -M pkgname.txz

And if that doesn't work, then use 'pkg fetch' to download a pkg .txz
tarball, and try 'pkg add -M pkg.txz'

This will likely leave your pkg database in a weird state causing
undefined behaviour for subsequent operations.

>> Found why mailman is trying (and failing) to reinstall postfix and it
>> appears to be a bug in other ports as well.
>> 
>>  # cd /usr/ports/mail && grep '_DEPENDS+=.*postfix' */Makefile
>>  dk-milter/Makefile:RUN_DEPENDS+= ${LOCALBASE}/libexec/postfix/smtpd:${PORTSDIR}/mail/postfix-current
>>  dk-milter/Makefile:RUN_DEPENDS+= ${LOCALBASE}/libexec/postfix/smtpd:${PORTSDIR}/mail/postfix
>>  drac/Makefile:RUN_DEPENDS+=     postfix:${PORTSDIR}/mail/postfix
>>  enma/Makefile:RUN_DEPENDS+= ${LOCALBASE}/libexec/postfix/smtpd:${PORTSDIR}/mail/postfix-current
>>  enma/Makefile:RUN_DEPENDS+= ${LOCALBASE}/libexec/postfix/smtpd:${PORTSDIR}/mail/postfix
>>  mailman/Makefile:BUILD_DEPENDS+= /usr/sbin/postconf:${PORTSDIR}/mail/postfix
>>  mailman/Makefile:RUN_DEPENDS+=  /usr/sbin/postconf:${PORTSDIR}/mail/postfix
>> 
>> Shouldn't these ports be querying the pkg db rather than checking for a
>> particular file, particularly when the file is incorrectly specified?

This is a ports thing, and it's been like that for a long time.
Originally it was so you could install postfix some other way than using
the ports, and then install mailman from ports.  However, that *only*
works when you're compiling stuff yourself.  Whether it still make sense
today is a different question.

If you use precompiled packages the dependency check is that the postfix
package is installed.  However, precompiled pkgs are not relocatable.
If you're using binary packages from the FreeBSD repos then they're
going to have LOCALBASE=/usr/local hardwired into them.

There are now options for installing to a different system root using
pkg-add(8), but these are experimental and meant to facilitate
cross-architecture installation.  Everything will expect to find
themselves installed under /usr/local come run-time though.

	Cheers,

	Matthew



-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 971 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/freebsd-pkg/attachments/20150503/ffb807d1/attachment.sig>


More information about the freebsd-pkg mailing list