From 24584296a8f93f3bd9d81bd050e3b4ec33fcfaf2 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sat, 7 Oct 2023 02:06:33 +0100 Subject: put include/export.sh in build script remove include/export.sh it's not a lot of code, and build is the only file that uses it Signed-off-by: Leah Rowe --- build | 23 +++++++++++++++++++++-- include/export.sh | 22 ---------------------- 2 files changed, 21 insertions(+), 24 deletions(-) delete mode 100755 include/export.sh diff --git a/build b/build index e3ba1b9c..50a291ed 100755 --- a/build +++ b/build @@ -9,13 +9,32 @@ set -u -e . "include/err.sh" -. "include/export.sh" . "include/option.sh" +eval "$(setvars "" mode option project version versiondate aur_notice tmpdir)" + +tmpdir_was_set="y" +set | grep TMPDIR 1>/dev/null 2>/dev/null || tmpdir_was_set="n" +if [ "${tmpdir_was_set}" = "y" ]; then + tmpdir="${TMPDIR##*/}" + tmpdir="${TMPDIR%_*}" + if [ "${tmpdir}" = "lbmk" ]; then + tmpdir="" + tmpdir_was_set="n" + fi +fi +if [ "${tmpdir_was_set}" = "n" ]; then + export TMPDIR="/tmp" + tmpdir="$(mktemp -d -t lbmk_XXXXXXXX)" + export TMPDIR="${tmpdir}" +else + export TMPDIR="${TMPDIR}" +fi +tmpdir="${TMPDIR}" + linkpath="${0}" linkname="${linkpath##*/}" buildpath="./script/${linkname}" -eval "$(setvars "" mode option project version versiondate aur_notice)" main() { diff --git a/include/export.sh b/include/export.sh deleted file mode 100755 index ada84e92..00000000 --- a/include/export.sh +++ /dev/null @@ -1,22 +0,0 @@ -# SPDX-License-Identifier: MIT -# SPDX-FileCopyrightText: 2023 Leah Rowe - -tmpdir="" -tmpdir_was_set="y" -set | grep TMPDIR 1>/dev/null 2>/dev/null || tmpdir_was_set="n" -if [ "${tmpdir_was_set}" = "y" ]; then - tmpdir="${TMPDIR##*/}" - tmpdir="${TMPDIR%_*}" - if [ "${tmpdir}" = "lbmk" ]; then - tmpdir="" - tmpdir_was_set="n" - fi -fi -if [ "${tmpdir_was_set}" = "n" ]; then - export TMPDIR="/tmp" - tmpdir="$(mktemp -d -t lbmk_XXXXXXXX)" - export TMPDIR="${tmpdir}" -else - export TMPDIR="${TMPDIR}" -fi -tmpdir="${TMPDIR}" -- cgit v1.2.1