# "pkg info" - get build options?



## spork (Sep 12, 2019)

I have a situation where I have some binary packages that were built from ports. There are a handful of build options that were set differently than they are on the FreeBSD build server, hence local builds (from a long-gone virtual machine).

I see "pkg info" dumps the build options in the output, but I'm wondering if there's a "pkg" command that just directly dumps out a ports-ready "options" (ie: what you'd find in '
/var/db/ports/www_nginx/options') file?


----------



## talsamon (Sep 12, 2019)

`pkg options pkgname`  (is an alias for `pkg query -i "%n - %Ok: %Ov"` ).
See /usr/local/etc/pkg.conf.


----------



## T-Daemon (Sep 13, 2019)

talsamon, I belive he wants to know something else. (Note: There is a typo in the command line, `pikg`)


spork said:


> There are a handful of *build options that were set differently than they are* *on the FreeBSD build server*, hence local builds (from a long-gone virtual machine).





spork said:


> I see "pkg info" dumps the build options in the output, but I'm wondering if there's a "pkg" command that just directly *dumps out a ports-ready "options"*


From the above I understand that you wish to know the default configuration a  FreeBSD.org pkg mirror (build from ports) package has.

`pkg info` can show only with which options a package is build, it has no function to query the ports configuration, default or otherwise. See `pkg help info`.

To show the ports default options one must query the port itself (but one should also consider the version the port had when the package was build, in this case build local from a long gone virtual machine, the current default options might differ).

In case you are  asking for tools to query the configuration options: change to the ports directory, execute `make rmconfig`,  to make sure posible previous configurations are reset to default, then `make showconfig`. See ports(7).


----------



## spork (Sep 17, 2019)

talsamon has it right, I'm looking to get the options the port was built with, I was just wondering if the pkg tools can spit out an actual "options" file as used by ports.

For example, the options file has settings in this format:


```
OPTIONS_FILE_UNSET+=DEBUG
OPTIONS_FILE_UNSET+=DEBUGLOG
OPTIONS_FILE_SET+=DSO
OPTIONS_FILE_SET+=FILE_AIO
OPTIONS_FILE_SET+=IPV6
OPTIONS_FILE_SET+=THREADS
OPTIONS_FILE_SET+=WWW
OPTIONS_FILE_UNSET+=GSSAPI_BASE
OPTIONS_FILE_UNSET+=GSSAPI_HEIMDAL
OPTIONS_FILE_UNSET+=GSSAPI_MIT
OPTIONS_FILE_SET+=MAIL
OPTIONS_FILE_UNSET+=MAIL_IMAP
OPTIONS_FILE_UNSET+=MAIL_POP3
OPTIONS_FILE_UNSET+=MAIL_SMTP
```

And "pkg options pkgname" outputs this:


```
nginx - AJP: off
nginx - ARRAYVAR: off
nginx - AWS_AUTH: off
nginx - BROTLI: off
nginx - CACHE_PURGE: on
nginx - CLOJURE: off
nginx - CT: off
nginx - DEBUG: off
nginx - DEBUGLOG: off
nginx - DEVEL_KIT: off
nginx - DRIZZLE: off
nginx - DSO: on
nginx - DYNAMIC_UPSTREAM: off
nginx - ECHO: off
```

I know I can massage one format into the other, but the convenience of having the pkg tool do that would be nice.


----------



## SirDice (Sep 18, 2019)

spork said:


> I know I can massage one format into the other, but the convenience of having the pkg tool do that would be nice.


Why not follow the age old UNIX tradition and string a couple of existing commands together to get want you want/need?


----------

