python script to enhance ports.

Sideris Michael msid at daemons.gr
Sun Feb 19 00:11:12 PST 2006


This is something I did in one day so if there are any bugs bare with me, I am looking for feedback here. So, this is a python script I made to enhance the ports system. In what way... Well, it allows you to see the knobs of the port you want to install as well as the knobs of the ports' dependencies. In a matter of fact it can be used also as a searching tool for ports as well as a tool for installing and uninstalling ports. These are more or less the current functionalities of this python script.

I would like to take the opportunity and elaborate on the philosophy behind that script. A freebsd user is constantly installing and uninstalling ports for whatever reasons. Each port provides a number of knobs that allows you to configure it. There are quite a few ways to do so. The most efficient way though is the way that this script is based on. When you install a port, you care about saving any customizations this port might have. Now this port, ideally, can be configured through the OPTIONS framework, if it supports it. Even if it does though it doesn't guarantee that its dependencies do support it as well. So, the user has to deal with knobs directly in this case. He has two ways of doing so. The global knobs, that he puts in /etc/make.conf and can be read from portinstall and portupgrade, and the port specific knobs. metaport, the name I gave to the tool, allows you to view the knobs of the port and its dependencies before you install it. Additionally, it shows you which from the dependencies support the Options framework as it does for the port itself. Then the user has just to just where to place the knobs according to the current configuration. He can choose global setup and put any interesting knobs in /etc/make.conf, or follow a more specialized setup putting the appropriate knobs in /usr/local/etc/pkgtools.conf in the appropriate section. Then he can use metaport to install the port. Initially it will attempt to configure it through the Options framework, if any available, and then it will use portinstall to install it, since portinstall, and portupgrade, reads both from make.conf and pkgtools.conf. This ends up to a totally organized and customized environment.

This is more or less the functionality you should expect as well as the ability to uninstall ports using pkg_deinstall in an agressive yet interactive way. I am really looking forward for feedback on this one since I think it can evolve into something better and hopefully more efficient. For those who are interested into giving it a try, you need python, duh. It runs smoothly, hopefully, on my laptop freebsd 6.1 and python 2.4.2. Below I give you the link from where you can fetch metaport. Enjoy!

http://black.daemons.gr/msid/metaport


More information about the freebsd-ports mailing list