meso-web

Sources of the |Méso|Star> website
git clone git://git.meso-star.fr/meso-web.git
Log | Files | Refs | README | LICENSE

commit a06a68446eddaedc72394b85fdfdff4ca7f3e46e
parent feab05f7e69fae9129e2201c0d21fbb5170a32ff
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Fri,  3 Oct 2025 19:51:26 +0200

Speed up hook execution

Where possible, perform actions based on whether or not the resulting
files are present. This can significantly speed up execution when
processing is heavy, such as cryptographically signing a large archive
or extracting its contents.

The main goal is to avoid slowing down the use of the "make clean"
command, which is often the only way to ensure that the content, once
generated, is up to date with the latest updates.

Diffstat:
Mschiff/hooks/00-extract-archive.sh | 7+++++--
Mschiff/hooks/00-sign-archives.sh | 6++++--
Msolstice/hooks/00-extract-archive.sh | 7+++++--
Msolstice/hooks/00-sign-archives.sh | 6++++--
Mstardis/hooks/00-extract-archive.sh | 23+++++++++++++++--------
5 files changed, 33 insertions(+), 16 deletions(-)

diff --git a/schiff/hooks/00-extract-archive.sh b/schiff/hooks/00-extract-archive.sh @@ -19,5 +19,8 @@ set -e . "./config.sh.in" ->&2 printf 'Extracting %s\n' "${arch}" -tar -xz -f "${arch}" "${directory}/share/man" "${readme}" +if ! [ -d "${directory}/share/man" ] \ +|| ! [ -f "${readme}" ]; then + >&2 printf 'Extracting %s\n' "${arch}" + tar -xz -f "${arch}" "${directory}/share/man" "${readme}" +fi diff --git a/schiff/hooks/00-sign-archives.sh b/schiff/hooks/00-sign-archives.sh @@ -26,8 +26,10 @@ find downloads \ sign="${i}.sig" - >&2 printf 'Signing %s\n' "${i}" - gpg --yes -a -o "${sign}" --detach-sign "${i}" + if ! [ -f "${sign}" ]; then + >&2 printf 'Signing %s\n' "${i}" + gpg --yes -a -o "${sign}" --detach-sign "${i}" + fi # Write the generated files to standard output to inform the build # system which files it needs to handle during installation. diff --git a/solstice/hooks/00-extract-archive.sh b/solstice/hooks/00-extract-archive.sh @@ -19,5 +19,8 @@ set -e . "./config.sh.in" ->&2 printf 'Extracting %s\n' "${arch}" -tar -xz -f "${arch}" "${directory}/share/man" "${readme}" +if ! [ -d "${directory}/share/man" ] \ +|| ! [ -f "${readme}" ]; then + >&2 printf 'Extracting %s\n' "${arch}" + tar -xz -f "${arch}" "${directory}/share/man" "${readme}" +fi diff --git a/solstice/hooks/00-sign-archives.sh b/solstice/hooks/00-sign-archives.sh @@ -26,8 +26,10 @@ find downloads \ sign="${i}.sig" - >&2 printf 'Signing %s\n' "${i}" - gpg --yes -a -o "${sign}" --detach-sign "${i}" + if ! [ -f "${sign}" ]; then + >&2 printf 'Signing %s\n' "${i}" + gpg --yes -a -o "${sign}" --detach-sign "${i}" + fi # Write the generated files to standard output to inform the build # system which files it needs to handle during installation. diff --git a/stardis/hooks/00-extract-archive.sh b/stardis/hooks/00-extract-archive.sh @@ -19,12 +19,19 @@ set -e . "./config.sh.in" ->&2 printf 'Extracting %s\n' "${stardis_arch}" -tar -xz -f "${stardis_arch}" \ - "${stardis_dir}/share/man" \ - "${stardis_readme}" \ - "${solver_readme}" \ - "${sgreen_readme}" +if ! [ -d "${stardis_dir}/share/man" ] \ +|| ! [ -f "${stardis_readme}" ] \ +|| ! [ -f "${solver_readme}" ] \ +|| ! [ -f "${sgreen_readme}" ]; then + >&2 printf 'Extracting %s\n' "${stardis_arch}" + tar -xz -f "${stardis_arch}" \ + "${stardis_dir}/share/man" \ + "${stardis_readme}" \ + "${solver_readme}" \ + "${sgreen_readme}" +fi ->&2 printf 'Extracting %s\n' "${spk_arch}" -tar -xz -f "${spk_arch}" "${spk_readme}" +if ! [ -f "${spk_readme}" ]; then + >&2 printf 'Extracting %s\n' "${spk_arch}" + tar -xz -f "${spk_arch}" "${spk_readme}" +fi