problems with half installed ports

Vitaly Magerya vmagerya at gmail.com
Thu Apr 11 11:17:02 UTC 2013


Matthias Apitz wrote:
> Say, we are installing ports/A which depends on ports/B; the Makefile
> detects the dependency and goes to install ports/B; if now during the
> final installation process, some files are already delivered to
> /usr/local, some files not, the system goes down (by intention because
> it's time to go out), before the installation of ports/B is fully done
> and registered to /var/db/pkg, next time when you restart installing
> ports/A it often sees, because the file referenced in the Makefile
> was allready installed (while others not), it thinks that ports/B was
> installed fine and proceeds with ports/A which later (or even in some
> other area) gives an error due to missing files of ports/B;
> 
> I think, the only solution is that the dependency is not only based on
> some (random) file of B, but on the fact if B was *fully* installed and
> registered in /var/db/pkg;

There is a case where this will break: if multiple ports install the
same file, and you don't care which of them installed it, then you need
to depend on the file, not on a specific port.

For example, both www/node and www/node-devel install the same binary,
and dependent ports will work with either of them.

Now, it's true that using files as a proxy for interchangeable ports
isn't ideal, and we could do better...

Anyway, the problem you're describing allows for another fix. If ports/A
depends of file-B, port system could check not only that file-B exists,
but if there is also a package that installed it (via 'pkg which'), and
if not, install ports/B. This will of course slow down ports operations
somewhat.


More information about the freebsd-ports mailing list