From fd103d61f795de3dafa3501274ca3419d449deaa Mon Sep 17 00:00:00 2001 From: Kévin Le Gouguec Date: Thu, 10 Nov 2022 18:32:11 +0100 Subject: Cache configure results on stable distros --- .local/bin/emacs-build | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to '.local') diff --git a/.local/bin/emacs-build b/.local/bin/emacs-build index 815b244..cbd39a6 100755 --- a/.local/bin/emacs-build +++ b/.local/bin/emacs-build @@ -10,6 +10,29 @@ configure_flags=( --with-xinput2 ) +is-rolling-distro () +{ + ( + . /etc/os-release + case "${ID}" + in + opensuse-tumbleweed) return 0;; + esac + return 1 + ) +} + +if ! is-rolling-distro +then + cachedir=${XDG_CACHE_HOME:-~/.cache}/emacs + test -d "${cachedir}" || mkdir -p "${cachedir}" + + thistree=${PWD#~} + cachefile=${cachedir}/config${thistree//\//,} + + configure_flags=(--cache-file="${cachefile}" "${configure_flags[@]}") +fi + if ! test -f Makefile then ${make} configure -- cgit v1.2.3