[pacman-dev] libmakepkg: allow correctly sourcing when $LIBRARY is not set

Message ID 20210704165607.959061-1-eschwartz@archlinux.org
State Accepted, archived
Headers show
Series [pacman-dev] libmakepkg: allow correctly sourcing when $LIBRARY is not set | expand

Commit Message

Eli Schwartz July 4, 2021, 4:56 p.m. UTC
We usually set this up to default to the build time configured install
location, but a couple of files crept in without this.

Signed-off-by: Eli Schwartz <eschwartz at archlinux.org>
---
 scripts/libmakepkg/buildenv.sh.in      | 2 ++
 scripts/libmakepkg/executable.sh.in    | 2 ++
 scripts/libmakepkg/util/pkgbuild.sh.in | 2 ++
 3 files changed, 6 insertions(+)

Patch

diff --git a/scripts/libmakepkg/buildenv.sh.in b/scripts/libmakepkg/buildenv.sh.in
index 0f4178a90..07b32ce93 100644
--- a/scripts/libmakepkg/buildenv.sh.in
+++ b/scripts/libmakepkg/buildenv.sh.in
@@ -22,6 +22,8 @@ 
 [[ -n "$LIBMAKEPKG_BUILDENV_SH" ]] && return
 LIBMAKEPKG_BUILDENV_SH=1
 
+LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
+
 declare -a buildenv_functions build_options
 
 for lib in "$LIBRARY/buildenv/"*.sh; do
diff --git a/scripts/libmakepkg/executable.sh.in b/scripts/libmakepkg/executable.sh.in
index ea40289ba..dfa8a0bdf 100644
--- a/scripts/libmakepkg/executable.sh.in
+++ b/scripts/libmakepkg/executable.sh.in
@@ -21,6 +21,8 @@ 
 [[ -n "$LIBMAKEPKG_EXECUTABLE_SH" ]] && return
 LIBMAKEPKG_EXECUTABLE_SH=1
 
+LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
+
 declare -a executable_functions
 
 for lib in "$LIBRARY/executable/"*.sh; do
diff --git a/scripts/libmakepkg/util/pkgbuild.sh.in b/scripts/libmakepkg/util/pkgbuild.sh.in
index ceda7824f..e3c5b5902 100644
--- a/scripts/libmakepkg/util/pkgbuild.sh.in
+++ b/scripts/libmakepkg/util/pkgbuild.sh.in
@@ -21,6 +21,8 @@ 
 [[ -n "$LIBMAKEPKG_UTIL_PKGBUILD_SH" ]] && return
 LIBMAKEPKG_UTIL_PKGBUILD_SH=1
 
+LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
+
 source "$LIBRARY/util/schema.sh"