fix(setup ghc): cd to `TERMUX_SCRIPTDIR` before executing buildorder.py

Signed-off-by: Aditya Alok <dev.aditya.alok@gmail.com>
This commit is contained in:
Aditya Alok 2022-04-25 22:18:06 +05:30
parent 3ba86891ed
commit 21353d954a
No known key found for this signature in database
GPG Key ID: 345AE134142077D8
1 changed files with 4 additions and 3 deletions

View File

@ -2,11 +2,11 @@
__termux_haskell_register_packages() {
# Register dependency haskell packages with termux-ghc-pkg.
echo "Registering haskell packages with ghc-pkg...(if any)"
while read -r DEP DEP_DIR; do
while read DEP DEP_DIR; do
if [[ -z $DEP ]]; then
continue
elif [[ "${DEP}" == "ERROR" ]]; then
termux_error_exit "Failed to find dependencies of ${TERMUX_PKG_NAME}[Context: ${FUNCNAME[0]}]"
termux_error_exit "Failed to find dependencies of ${TERMUX_PKG_NAME} [Context: ${FUNCNAME[0]}]"
fi
if [[ "${DEP/haskell-/}" != "${DEP}" ]]; then
sed "s|${TERMUX_PREFIX}/bin/ghc-pkg|$(command -v termux-ghc-pkg)|g" \
@ -18,7 +18,8 @@ __termux_haskell_register_packages() {
fi
done <<<"$(
# shellcheck disable=SC2086
"${TERMUX_SCRIPTDIR}"/buildorder.py -i "${TERMUX_PKG_BUILDER_DIR}" ${TERMUX_PACKAGES_DIRECTORIES} || echo "ERROR"
cd "${TERMUX_SCRIPTDIR}" &&
./scripts/buildorder.py -i "${TERMUX_PKG_BUILDER_DIR}" ${TERMUX_PACKAGES_DIRECTORIES} || echo "ERROR"
)"
}