source: wspkg/freebsd/ @ d06ffc9

Last change on this file since d06ffc9 was d06ffc9, checked in by Ting-Wei Lan <lantw44@…>, 4 years ago

freebsd: Support flavors

Flavors is a new feature of FreeBSD ports, allowing creating different
packages from the same port by specifying different flavor values.
Python ports have been converted to use flavors, enabling us to have
both Python 2 and 3 packages installed on the workstation.

This change also means that the path of a port is no longer a unique
identifier. To specify a dependency in a port, we need both the path and
the flavor. The output file FREEBSD_OUT_PORTS, or freebsd.port, now have
the third column to store the flavor specified in the input file with
'@' symbol, which is the same as the symbol used in a port Makefile.
To simply the processing of the file, ports without flavors have their
third column set to '@'. This symbol is not required by the syntax, and
it can be changed to any non-alphanumeric symbols other than underscore.

Ideally we don't have to specify the flavor in the input file because
different flavors of a port produce packages with different names.
However, since the index file doesn't have a field for flavor, we have
to rely on users to provide them to avoid greatly slowing down the
process of generating a meta-port Makefile.

  • Property mode set to 100755
File size: 293 bytes
4: ${ports_file:="freebsd.ports"}
6exec 4< "${ports_file}"
8while read -r pkg_name pkg_ports pkg_flavor 0<&4; do
9        if [ "${pkg_flavor}" != "@" ]; then
10                pkg_ports="${pkg_ports}@${pkg_flavor}"
11        fi
12        printf "    %s>=a:%s ^%%" "${pkg_name}" "${pkg_ports}"
15exec 4<&-
Note: See TracBrowser for help on using the repository browser.