commit 961ecba259528ced0029a63febe787f566a21a44 parent fa906e73dacd728f84309ba894612a4369651749 Author: KΓ©vin Le Gouguec <kevin.legouguec@gmail.com> Date: Sun, 23 Jun 2024 17:07:33 +0200 Fiddle with Emacs build script Fewer globals β better feng shui. Diffstat:
| M | .local/bin/emacs-build | | | 18 | ++++++++++++------ |
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/.local/bin/emacs-build b/.local/bin/emacs-build @@ -26,17 +26,23 @@ is-rolling-distro () ) } -if ! is-rolling-distro -then - cachedir=${XDG_CACHE_HOME:-~/.cache}/emacs +cache-file () +{ + local -r cachedir=${XDG_CACHE_HOME:-~/.cache}/emacs test -d "${cachedir}" || mkdir -p "${cachedir}" - builddesc=${PWD} + local builddesc=${PWD} builddesc=${builddesc#~} builddesc=${builddesc//\//,} - cachefile=${cachedir}/config${builddesc} + echo ${cachedir}/config${builddesc} +} - configure_flags=(--cache-file="${cachefile}" "${configure_flags[@]}") +if ! is-rolling-distro +then + configure_flags=( + --cache-file="$(cache-file)" + "${configure_flags[@]}" + ) fi if ! test -f "${src}"/Makefile