aboutsummaryrefslogtreecommitdiffstats
BOSUN(1) General Commands Manual BOSUN(1)

bosun
manage portage roles with stow

bosun add role ...

bosun flush

bosun [list [type]]

bosun rebuild [role ...]

bosun remove role ...

bosun is a program to add, remove, and list portage roles.

A “role” is a directory comprised of a set of portage configuration files pertaining to a specific service, usage, et cetera. Roles are placed into /etc/portage/stow or the directory pointed to by BOSUN_DIR.

bosun uses stow(8) to build a full set of portage configuration files in /etc/portage. It does so by creating symlinks in /etc/portage that point back to the actual files in the role directories.

The commands are as follows:

add role ...
Activates the given roles on the system.
flush
Deactivates all active roles on the system.
list [type]
Lists roles of the given type. If no type is given, list roles of the “active” type. The types are as follows:
active
Lists roles that are active on the system.
all
Lists all roles.
available
Lists roles that are not active on the system.
rebuild [role ...]
Deactivates the given roles and then activates them again. This is used to incorporate files that have been added to an already active role.

If no roles are given, rebuild all active roles.

remove role ...
Deactivates the given roles on the system.

This command has two aliases, del and delete.

If no command is given, bosun will list active roles.

The base directory containing all portage roles. See FILES for the default location if this is unset.

/etc/portage/stow
The base directory containing all portage roles.

The following directory structure under /etc/portage/stow describes a simple setup of bosun with three roles, service-mail, app-tex, and group-musl.
service-mail/package.accept_keywords/20-service-mail
service-mail/package.use/20-service-mail
app-tex/sets/tex
group-musl/package.accept_keywords/02-group-musl
group-musl/repos.conf/musl.conf
group-musl/patches/net-misc/openssh/disable-utmp-in-musl.patch

After activating group-musl and service-mail, /etc/portage will look something like this:

package.accept_keywords/02-group-musl@
package.accept_keywords/20-service-mail@
package.use/20-service-mail@
patches/net-misc/openssh/disable-utmp-in-musl.patch@
repos.conf/musl.conf@

Here, each symbolic link points to the corresponding file in /etc/portage/stow. bosun transparently merged the given roles into one structure. After removing group-musl and activating app-tex, the directory will look like this:

package.accept_keywords/20-service-mail@
package.use/20-service-mail@
sets/tex@

As roles are activated or removed, the role directory stays untouched; it is merely the symbolic links that are added or removed. This makes it suitable to manage /etc/portage/stow in git(1).

Suppose we add another file to the service-mail role in a new directory package.use. The role is already active, but since bosun cannot know that it has been changed, we need to rebuild the symbolic links:

bosun rebuild service-mail

portage(5), stow(8)

bosun was written by Wolfgang Müller
March 10, 2021