Skip to content
Elliot Shank edited this page May 16, 2018 · 1 revision

Package definition

A package definition is the description of the contents of a package. It can come from either or both of:

  • A published package or a package definition file (usually "package.fig" or "application.fig")
  • Command-line options --set / --add / --archive / --resource / --include / --override.

When publishing, the definition of a package can be done from either command-line options or a package definition file, but not both.

From the command-line

Options by themselves

The command-line options create an in-memory package equivalent to a package definition file containing a "default" config with the equivalent statements. For example, the command line

fig --set TOAST=french --resource include/bacon.h --include eggs/fried ...

produces an in-memory package equivalent to the file

resource include/bacon.h
config default
    set TOAST=french
    include eggs/fried
end

As in a package definition file, the order of options that go into a config block is significant, i.e.

fig --set ROAST=french --include coffee/Ethiopian ...

is not the same as

fig --include coffee/Ethiopian --set ROAST=french ...

You can see the constructed package via the --dump-package-definition-for-command-line option.

Options combined with another package definition

When not publishing, you can use both command-line options and a published package or a package definition file. The result is a virtual package created from the command-line options that has an include of the other package as the first statement in the config block. Assuming that there's a "package.fig" file in the current directory, running

fig --set PASTA=rigatoni ...

produces an in-memory package equivalent to

config default
    include <package loaded from package.fig>:default
    set PASTA=rigatoni
end