# Thoughts on mixing ports and packages.



## protocelt (Oct 7, 2014)

Hi all, 

It was mentioned in past threads that resources are a large part of why packages are built only once a week. This is of course understandable. pkg(8) is a remarkable tool and I would love to switch to using it solely. Unfortunately, given the rate that packages are built and with default options only, switching to using pkg(8) alone can be quite difficult. I see many problems with people attempting to mix ports and packages due to this. That said, an idea that came to mind (which to my knowledge is not available at this time. Please correct me if I'm wrong) was to add an option to ports-mgmt/portmaster to build packages only as needed. The -P option to portmaster(8) is available but as far as I understand, doesn't work the same way.(Again, please correct me if I'm mistaken. Also, is it still supported now that the old pkg_tools have been removed?).

So for example, the following option or similar could be added to portmaster(8);

```
% man portmaster

[...]

-Z  Always upgrade/install from package repository unless non-default options are used
    or package is not available from configured repository, in which case package will be
    built from ports.

[...]
```

In other words if I for instance want to install www/firefox, but changed the port options in either Firefox itself or any of it's dependencies, it and any dependencies I changed options for would be built from ports while all other dependencies would be installed through pkg(8). Likewise, if either Firefox or any of it's dependencies are unavailable in my configured package repository, they would also be built from ports. 

This would of course in theory save on build resources and possibly other various problems while saving time, power usage, and disk space for the people who would like to use packages whenever possible. One glaring problem I see is that being packages are built only once a week, ports are obviously updated first which would result in many installed packages possibly being upgraded/installed from ports as a result. Maybe there is a way around that? I'm aware that ports-mgmt/poudriere is an option but for someone who just uses a single laptop or desktop, especially new users, it's really overkill IMO. I'm also not knowledgeable enough to know if this option is even possible to do when considering the problem I mentioned previously and how portmaster(8) and pkg(8) work and interact. This may also have already been brought up and rejected. Anyway, just a thought.


----------

