diff options
author | Wynn Wolf Arbor | 2020-01-20 21:50:07 +0100 |
---|---|---|
committer | Wynn Wolf Arbor | 2020-01-20 21:50:07 +0100 |
commit | 64dfee80d86b8f969a037945b7a5ce671e74fb0b (patch) | |
tree | ce7fe0e52dfe2b8cce41131dba9597b0bbce09f5 | |
parent | de30b45b62b6940230315f61d4ee48c0f59f2914 (diff) | |
download | bosun-64dfee80d86b8f969a037945b7a5ce671e74fb0b.tar.gz |
Simplify invocation of stow
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.
-rwxr-xr-x | bosun | 14 |
1 files changed, 6 insertions, 8 deletions
@@ -1,9 +1,7 @@ #!/bin/sh -STOW_DIR=/etc/portage/stow -TARGET=/etc/portage - -stowcmd="stow -d "$STOW_DIR" -t "$TARGET"" +# allow overriding STOW_DIR by the user +export STOW_DIR=${STOW_DIR:-/etc/portage/stow} need_root() { if test $(id -u) -ne 0; then @@ -14,22 +12,22 @@ need_root() { add() { need_root - $stowcmd -S "$@" + stow -S "$@" } remove() { need_root - $stowcmd -D "$@" + stow -D "$@" } flush() { need_root - list | xargs -- $stowcmd -D + list | xargs -- stow -D } rebuild() { need_root - list | xargs -- $stowcmd -R + list | xargs -- stow -R } list() { |