Is it possible to create /var/db/ports/*/options with pkgng?

Hi,

When a machine is installed with pkgng (using external repositories), is it possible to generate the /var/db/ports/{portname}/options files in order to be able to upgrade ports locally by compiling them from /usr/ports while maintaining compile-flags?
 
Re: Is it possible to create /var/db/ports/*/options with pk

There's no direct support for that but you can query the options for installed packages like this: pkg query "%n-%v %o %Ok %Ov". That will output something like:
Code:
cairo-1.10.2_6,2 graphics/cairo GLIB on
cairo-1.10.2_6,2 graphics/cairo OPENGL off
cairo-1.10.2_6,2 graphics/cairo X11 on
cairo-1.10.2_6,2 graphics/cairo XCB on
curl-7.33.0_1 ftp/curl CARES off
...

With some scripting knowledge you can turn those into an options file /var/db/ports/graphics_cairo/options:
Code:
# This file is auto-generated by 'make config'.
# Options for cairo-1.10.2_6,2
_OPTIONS_READ=cairo-1.10.2_6,2
_FILE_COMPLETE_OPTIONS_LIST=GLIB OPENGL X11 XCB
OPTIONS_FILE_SET+=GLIB
OPTIONS_FILE_UNSET+=OPENGL
OPTIONS_FILE_SET+=X11
OPTIONS_FILE_SET+=XCB

And the same for other installed packages.

It shouldn't too hard. The downside of this solution is that you can't trust that the format of the options files is going to remain stable.
 
Re: Is it possible to create /var/db/ports/*/options with pk

That's workable. Thanks. It would be a nice feature though! Agree? If yes, where to submit such a request?
 
Re: Is it possible to create /var/db/ports/*/options with pk

Sounds like a perfect reason to use Poudriere.
 
Re: Is it possible to create /var/db/ports/*/options with pk

Yes of course but ports-mgmt/poudriere still has the limitation that comes from ports(7) that you have to use the dialog if you want to save your customized options. It's not possible to do something like make -C /usr/ports/graphics/cairo setoptions WITH_OPENGL=1 to just toggle one option from its default.

Interestingly I thought setting BATCH=yes with make config would prevent the dialogs from popping but that doesn't seem to be the case now.
 
Re: Is it possible to create /var/db/ports/*/options with pk

frijsdijk said:
Hi,

When a machine is installed with pkgng (using external repositories), is it possible to generate the /var/db/ports/{portname}/options files in order to be able to upgrade ports locally by compiling them from /usr/ports while maintaining compile-flags?

You don't need to. PKGNG packages are built using the default OPTIONS. When you compile a port by hand, the OPTIONS screen comes up. Don't change anything, and you have the exact same OPTIONS set as the pkg.
 
Re: Is it possible to create /var/db/ports/*/options with pk

phoenix said:
frijsdijk said:
Hi,

When a machine is installed with pkgng (using external repositories), is it possible to generate the /var/db/ports/{portname}/options files in order to be able to upgrade ports locally by compiling them from /usr/ports while maintaining compile-flags?

You don't need to. PKGNG packages are built using the default OPTIONS. When you compile a port by hand, the OPTIONS screen comes up. Don't change anything, and you have the exact same OPTIONS set as the pkg.

Ah yes, default options. But I build my own repositories with poudriere.
 
Back
Top