1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-09-10 05:52:20 +08:00
Files
kubo/test/bin/checkflags
Tor Arne Vestbø d36a9eef2b Ensure IPFS-BUILD-OPTIONS build dependency is created
If the file doesn't exist, make will conclude that the missing
prerequisite should trigger a rebuild of the binaries.
2015-04-07 21:09:45 +02:00

26 lines
467 B
Bash
Executable File

#!/bin/sh
# Author: Christian Couder <chriscool@tuxfamily.org>
# MIT LICENSED
if test "$#" -lt 3
then
echo >&2 "usage $0 FILE VALUES MSG..."
exit 1
fi
FLAG_FILE="$1"
FLAG_VALS="$2"
shift
shift
FLAG_MSGS="$@"
test -f $FLAG_FILE || touch $FLAG_FILE
# Use x in front of tested values as flags could be
# interpreted by "test" to be for itself.
if test x"$FLAG_VALS" != x"$(cat "$FLAG_FILE")"
then
echo "$FLAG_MSGS"
echo "$FLAG_VALS" >"$FLAG_FILE"
fi