diff options
| author | Kévin Le Gouguec <kevin.legouguec@gmail.com> | 2022-11-10 18:32:11 +0100 |
|---|---|---|
| committer | Kévin Le Gouguec <kevin.legouguec@gmail.com> | 2022-11-10 18:32:11 +0100 |
| commit | fd103d61f795de3dafa3501274ca3419d449deaa (patch) | |
| tree | 39a40e06be21df74b72e0ea76ab59a7008fa64d1 /.local/bin | |
| parent | e2df3eb277bb0bb9acc0261bc7ad16c298740b53 (diff) | |
| download | dotfiles-fd103d61f795de3dafa3501274ca3419d449deaa.tar.xz | |
Cache configure results on stable distros
Diffstat (limited to '.local/bin')
| -rwxr-xr-x | .local/bin/emacs-build | 23 |
1 files changed, 23 insertions, 0 deletions
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 |
