libmakepkg: fix missing or inaccurate interdependencies

When the executable checking was refactored into libmakepkg, it carried
with it, usage of $E_* error codes, which need to be declared from
error.sh but are only available when the parent program already sources
error.sh; additionally, message.sh was only loaded in a parent
library, but not where it was needed, and option.sh was often loaded
when it wasn't needed at all.

util.sh, meanwhile, has always depended on message.sh functions.

Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Eli Schwartz 2019-04-16 13:12:39 -04:00 committed by Allan McRae
parent b93dfa935f
commit 614ef781eb
13 changed files with 14 additions and 14 deletions

View file

@ -22,11 +22,6 @@
[[ -n "$LIBMAKEPKG_BUILDENV_SH" ]] && return
LIBMAKEPKG_BUILDENV_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/message.sh"
declare -a buildenv_functions build_options
for lib in "$LIBRARY/buildenv/"*.sh; do

View file

@ -21,11 +21,6 @@
[[ -n "$LIBMAKEPKG_EXECUTABLE_SH" ]] && return
LIBMAKEPKG_EXECUTABLE_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/message.sh"
declare -a executable_functions
for lib in "$LIBRARY/executable/"*.sh; do

View file

@ -23,6 +23,7 @@ LIBMAKEPKG_EXECUTABLE_CCACHE_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/message.sh"
source "$LIBRARY/util/option.sh"
executable_functions+=('executable_ccache')

View file

@ -23,6 +23,7 @@ LIBMAKEPKG_EXECUTABLE_CHECKSUM_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/message.sh"
executable_functions+=('executable_checksum')

View file

@ -23,6 +23,7 @@ LIBMAKEPKG_EXECUTABLE_DISTCC_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/message.sh"
source "$LIBRARY/util/option.sh"
executable_functions+=('executable_distcc')

View file

@ -23,7 +23,7 @@ LIBMAKEPKG_EXECUTABLE_FAKEROOT_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/option.sh"
source "$LIBRARY/util/message.sh"
executable_functions+=('executable_fakeroot')

View file

@ -23,6 +23,7 @@ LIBMAKEPKG_EXECUTABLE_GPG_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/message.sh"
source "$LIBRARY/util/option.sh"
executable_functions+=('executable_gpg')

View file

@ -23,6 +23,7 @@ LIBMAKEPKG_EXECUTABLE_GZIP_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/message.sh"
source "$LIBRARY/util/option.sh"
executable_functions+=('executable_gzip')

View file

@ -23,7 +23,7 @@ LIBMAKEPKG_EXECUTABLE_PACMAN_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/option.sh"
source "$LIBRARY/util/message.sh"
executable_functions+=('executable_pacman')

View file

@ -23,6 +23,7 @@ LIBMAKEPKG_EXECUTABLE_STRIP_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/message.sh"
source "$LIBRARY/util/option.sh"
executable_functions+=('executable_strip')

View file

@ -23,7 +23,7 @@ LIBMAKEPKG_EXECUTABLE_SUDO_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/option.sh"
source "$LIBRARY/util/message.sh"
executable_functions+=('executable_sudo')

View file

@ -23,7 +23,8 @@ LIBMAKEPKG_EXECUTABLE_VCS_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/option.sh"
source "$LIBRARY/util/error.sh"
source "$LIBRARY/util/message.sh"
executable_functions+=('executable_vcs')

View file

@ -22,6 +22,9 @@
[[ -n "$LIBMAKEPKG_UTIL_UTIL_SH" ]] && return
LIBMAKEPKG_UTIL_UTIL_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/message.sh"
##
# usage : in_array( $needle, $haystack )