OpenPKG Advent Calendar 2006

...every day a little pondering, backstage information, jokes, tips and tricks.
13
Wednesday 2006-12-13: Tips & Tricks
Upgrade/Downgrade Package Features

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable man."
— George Bernard Shaw

What if you have already installed an Apache with a bunch of enabled addon modules (e.g. via "openpkg build -D with_mod_php -D with_mod_perl apache | sh") and now you recognize afterwards that you also need mod_ssl for SSL/TLS support?

Package Feature Upgrade

Don't panic. You don't have to fiddle around with all the old options yourself again. Just run "openpkg build -g -D with_mod_ssl=yes apache | sh" and the openpkg build command figures out for you what build options are already in effect, adds the additional with_mod_ssl option, determines the new dependency packages (here the direct dependencies openssl and mm plus a bunch of indirect ones like perl, etc) and builds and rebuilds everything for you. OpenPKG will also automatically restart Apache for you at the end. Voila!

Package Feature Downgrade

Btw, similar to the SSL/TLS upgrade, you can also downgrade to a plain HTTP Apache with "openpkg build -g -D with_mod_ssl=no apache | sh". The only drawback is that the now no longer needed packages "openssl", "mm" and "perl" are not automatically removed for you as "openpkg build" no longer knows by querying the RPM database that those packages were installed just for dependency reasons. Instead it has to assume that they were explicitly installed for the user.