diff options
| author | Richard Qin <richard.qin.x@gmail.com> | 2026-10-16 02:39:56 +0800 |
|---|---|---|
| committer | Richard Qin <richard.qin.x@gmail.com> | 2026-10-16 02:39:56 +0800 |
| commit | 8cace3f05003c6cb4d38c36890055f03151c2ad4 (patch) | |
| tree | aa739deaac0266f17c4e91b333957501cb1ea2e9 /scripts/build/run-if-changed.sh | |
| parent | 3ad39e9878310e5317ee73c9b353c1e2c1c5c4ee (diff) | |
| download | lume-8cace3f05003c6cb4d38c36890055f03151c2ad4.tar.gz lume-8cace3f05003c6cb4d38c36890055f03151c2ad4.tar.xz | |
Remove old code
Signed-off-by: Richard Qin <richard.qin.x@gmail.com>
Diffstat (limited to 'scripts/build/run-if-changed.sh')
| -rwxr-xr-x | scripts/build/run-if-changed.sh | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/scripts/build/run-if-changed.sh b/scripts/build/run-if-changed.sh deleted file mode 100755 index 6cdc7c4..0000000 --- a/scripts/build/run-if-changed.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/sh -# SPDX-License-Identifier: GPL-2.0-or-later - -set -eu - -cmdfile=$1 -output=$2 -description=$3 -shift 3 - -rebuild=false -if [ ! -e "$output" ] || [ ! -e "$cmdfile" ]; then - rebuild=true -fi - -while [ "$#" -gt 0 ] && [ "$1" != "--" ]; do - prerequisite=$1 - shift - if [ "$prerequisite" != FORCE ] && [ -e "$prerequisite" ] && \ - [ "$prerequisite" -nt "$output" ]; then - rebuild=true - fi -done - -[ "$#" -gt 0 ] || { echo "run-if-changed: missing --" >&2; exit 2; } -shift - -signature=$(printf '%s\0' "$@" | cksum) -old_signature= -if [ -e "$cmdfile" ]; then - old_signature=$(cat "$cmdfile") -fi -if [ "$signature" != "$old_signature" ]; then - rebuild=true -fi - -if [ "$rebuild" = true ]; then - printf ' %s\n' "$description" - mkdir -p "$(dirname "$output")" "$(dirname "$cmdfile")" - "$@" - tmp="$cmdfile.tmp.$$" - printf '%s\n' "$signature" > "$tmp" - mv -f "$tmp" "$cmdfile" -fi - |
