From 61db93cf5d3bea8c015941f6d0054da31b9d335d Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Sat, 22 Jul 2017 14:55:59 -0400 Subject: use(): Remove --- diff --git a/src/main.sh b/src/main.sh index 8ee09c4..4861181 100644 --- a/src/main.sh +++ b/src/main.sh @@ -38,44 +38,6 @@ conf_gzip= lock= exit_status= -# use() must be defined inline so it can be used to load other modules. -use() -{ - local module="${1}" - local default_dir= - local lib_subdir= - local dir= - - if [ "x${module%/*}" = "x${module}" ]; then - default_dir="${PKGLIBDIR}" - lib_subdir='' - else - case "${module%/*}" in - 'cmd') - loading_cmd="$(printf '%s' "${module##*/}" | \ - tr '[A-Z]' '[a-z]' | \ - tr -C '[a-z0-9_]' '_')" - default_dir="${PKGLIBCMDDIR}" - lib_subdir='cmd' - ;; - esac - fi - - if [ "${ARCHMAN_LIBDIR+set}" = 'set' ]; then - dir="${ARCHMAN_LIBDIR:-.}/${lib_subdir}" - else - dir="${default_dir}" - fi - - if [ -f "${dir}/${module##*/}.sho" ]; then - . "${dir}/${module##*/}.sho" - else - printf '%s: Error: Failed to load module "%s": %s\n' \ - "${0##*/}" "${module}" 'no such file or directory' >&2 - exit 2 - fi -} - main() { local cmd= -- cgit v0.9.1