aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeLines
* Add completions for the fish shellHEAD1.4.0masterWolfgang Müller2022-10-26-0/+16
| | | | | | | bosun manages role names that are user-defined and may be hard to remember or annoying to type out. Supporting auto-complete frameworks in modern shells is an obvious improvement. For now only support the fish shell since we use that on all our systems.
* Add a first draft of the test suite1.3.0Wolfgang Müller2021-03-10-0/+295
| | | | | | | The introduction of a test suite makes future changes easier to troubleshoot and verify. Whilst this is only a first draft, it should be stable enough to be used in normal development and should cover the entirety of bosun's functionality.
* Have find look in the current directory explicitlyWolfgang Müller2021-03-10-1/+1
| | | | | | This will squash shellcheck's SC2184 [1]. [1] https://github.com/koalaman/shellcheck/wiki/SC2185
* Allow overriding the role directoryWolfgang Müller2021-03-10-3/+13
| | | | | | | The upcoming test suite needs a way to operate on roles without referencing the system's default store in /etc/portage/stow. Have bosun respect the 'BOSUN_DIR' environment variable that overrides the role directory bosun operates on.
* Improve and harden list_activeWolfgang Müller2021-03-10-7/+8
| | | | | | | | | | | | | | | An upcoming commit will introduce support for the BOSUN_DIR environment variable that allows users (and, crucially, the upcoming test suite) to override the default role directory. Since we have previously assumed that we are in full control of STOW_DIR, we now have to be more careful. Revamp list_active such that the sed invocation no longer gets any user input. This should protect against any nefarious contents in BOSUN_DIR. The new approach used by list_active relies on 'realpath', a GNU-only coreutils program, and its '--relative-base' option which prints absolute paths unless they are below a given directory. This allows us to filter symbolic links that do not point to a path within BOSUN_DIR.
* Do not act if there is nothing to flush or rebuildWolfgang Müller2021-03-10-2/+2
| | | | | | | | | | | | By default, xargs runs the given command once even if there is no input. This does not make sense for these two invocations, so make sure that xargs only runs if active roles were found. Furthermore, state explicitly which command to run and do not rely on the default action of 'list'. Note: This change makes use of the '-r' flag, which is a GNU extension. We assume that bosun is only ever going to be used on Gentoo systems, so this should be fine.
* Remove the test for superuser accessWolfgang Müller2021-03-10-8/+0
| | | | | | | As bosun may run in environments that do not require superuser access, do away with this check and rely on stow itself for any relevant error reporting. This will also enable an upcoming test suite to work correctly.
* Update name and add .mailmap for consistencyWolfgang Müller2021-03-10-2/+3
|
* Fix a typo in the manual1.2.0Wynn Wolf Arbor2020-05-13-1/+1
|
* Add aliases for the `remove` commandWynn Wolf Arbor2020-05-13-1/+6
| | | | | | | Even if the user is familiar with bosun(1), they might try to remove a role by invoking it with `delete` or `del` instead of `remove`. As these are very common synonyms, add a simple DWIM mechanic to enhance the user experience.
* Improve error reportingWynn Wolf Arbor2020-05-13-4/+31
| | | | | | | | | | | | This commit introduces several improvements to the way bosun reacts to and reports errors. Instead of doing nothing and exiting silently, alert the user and print a short usage synopsis if bosun does not understand a command it was passed. Also, alert the user and print available list types if the `list` command was invoked with a type it does not understand. Lastly, check for the existence of a role before trying to `add`, `remove`, or `rebuild` it.
* Use placeholder instead of an exhaustive listing in the synopsisWynn Wolf Arbor2020-05-13-1/+1
|
* Simplify handling of default actionsWynn Wolf Arbor2020-05-13-4/+2
| | | | | | | Instead of using a catchall pattern for `case`, assign a default value to the variable in question. This helps reduce the amount of special cases - especially considering the addition of better error reporting in an upcoming commit.
* Only shift positional parameters if there are anyWynn Wolf Arbor2020-05-13-2/+1
| | | | | | | | | | | | | | bash 5.0 now enables its 'shift_verbose' option in POSIX mode by default, printing an error message if there's not enough positional arguments for the `shift` builtin. We rely on the previous (silent) behaviour in two places. For main command parsing, introduce an explicit check before invoking `shift` to make sure it is only called if there are enough positional arguments. The call to `shift` in the list() method is actually superfluous, as no more than one positional argument is ever referenced; we drop it fully there.
* Use Op Ar macros instead of manual formattingWynn Wolf Arbor2020-05-03-2/+2
|
* Add EXAMPLES section to the manual1.1.2Wynn Wolf Arbor2020-02-04-0/+63
|
* Use Pa instead of generic Em in the manualWynn Wolf Arbor2020-02-04-1/+1
|
* Improve the SYNOPSIS section in the manual1.1.1Wynn Wolf Arbor2020-01-21-2/+13
|
* Make list_active more robustWynn Wolf Arbor2020-01-21-5/+6
| | | | | | | | | | | | | | | | | | A couple of small changes to this function should make it more robust in the long run: 1) We no longer filter the symlinks with find(1), instead combining filtering and substituting in sed(1) 2) We use the absolute path (as given by readlink -f) such that we can anchor the regular expression pattern to avoid unwanted substitution. 3) Instead of hard-coding paths we now use STOW_DIR (and STOW_DIR/.. for the target directory) 4) To avoid unnecessary complexity, we no longer let the user override STOW_DIR. This tool is supposed to be used with the canonical /etc/portage/stow location
* Fix manual section number for stow1.1.0Wynn Wolf Arbor2020-01-20-3/+3
| | | | | I am unsure whether this is consistent across distributions, but for me stow appears in Section 8 - User Contributed Perl Documentation.
* Have rebuild accept one or more rolesWynn Wolf Arbor2020-01-20-5/+11
| | | | | This lets the user rebuild (or restow) specific roles and will fix a certain issue with stow refusing to unstow everything.
* Make shellcheck happyWynn Wolf Arbor2020-01-20-1/+1
| | | | | I would not expect this to ever fail, but quoting the specific invocation of id -u here silences the only shellcheck warning.
* Simplify invocation of stowWynn Wolf Arbor2020-01-20-8/+6
| | | | | | | Instead of hard-coding the stow invocation (which also had a quoting issue), just export the STOW_DIR environment variable which stow uses already. TARGET can be dropped because it is implicitly defined to be the parent directory of STOW_DIR.
* Update name and mail address1.0.1Wynn Wolf Arbor2020-01-17-2/+2
|
* Update manual to match program behaviourWynn Wolf Arbor2020-01-17-5/+5
| | | | | It has always been possible to add or remove multiple roles at once, and this is now reflected in the manual.
* Fix a typo in the manual pageWolfgang Müller2019-07-27-1/+1
|
* Rename to "bosun"1.0.0Wolfgang Müller2019-06-19-6/+6
|
* Add licenseWolfgang Müller2019-02-24-0/+13
|
* Initial commit0.1.0Wolfgang Müller2019-02-24-0/+154