From a79316179389b22525b58e38f4618bf9fa0ea525 Mon Sep 17 00:00:00 2001 From: Wynn Wolf Arbor Date: Thu, 4 Jun 2020 11:38:00 +0200 Subject: skein-infra: Simplify logging of mount actions Both bind_* functions remove the SKEIN_CGIT_ROOT prefix from its log messages in an effort to remove redundant information. With commit efdbb04 ("skein-infra: Rename instances/ to home/") however, it is no longer clear from the path alone that a path under SKEIN_CGIT_ROOT is being operated upon. Use the full path in the log message to resolve this. The logging aliases ladd() and ldel() are only used in the respective bind_mount() and bind_umount() functions and we don't expect this to change any time soon. Rename log() to log_mount() and call the latter directly from within both bind_* functions to improve clarity. --- skein-infra | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) (limited to 'skein-infra') diff --git a/skein-infra b/skein-infra index ac8084d..9673f55 100755 --- a/skein-infra +++ b/skein-infra @@ -10,33 +10,21 @@ usage() { exit 1 } -log() { +log_mount() { printf ' %s %s\n' "$1" "$2" } -ladd() { - log + "$1" -} - -ldel() { - log - "$1" -} - -remove_prefix() { - printf "%s" "${1#$SKEIN_CGIT_ROOT/*}" -} - bind_mount() { mkdir "$2" mount --rbind "$1" "$2" mount --make-rslave "$2" - ladd "$(remove_prefix "$2")" + log_mount "+" "$2" } bind_umount() { umount "$1" rmdir "$1" - ldel "$(remove_prefix "$1")" + log_mount "-" "$1" } setup() { -- cgit v1.2.3-2-gb3c3