diff options
author | Daniel Baumann <daniel@debian.org> | 2007-09-23 10:04:46 +0200 |
---|---|---|
committer | Daniel Baumann <daniel@debian.org> | 2011-03-09 18:14:51 +0100 |
commit | fe6eb1c593e2df135c8807bf94df614984b4d6ec (patch) | |
tree | 693b803dcc6473a8699f0c605c92b10c24755e28 /functions/stagefile.sh | |
parent | 470cf1764bf56b32addff591cfe3fd69af0e5760 (diff) | |
download | vyos-live-build-fe6eb1c593e2df135c8807bf94df614984b4d6ec.tar.gz vyos-live-build-fe6eb1c593e2df135c8807bf94df614984b4d6ec.zip |
Adding live-helper 1.0~a1-1.
Diffstat (limited to 'functions/stagefile.sh')
-rwxr-xr-x | functions/stagefile.sh | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/functions/stagefile.sh b/functions/stagefile.sh new file mode 100755 index 000000000..23c3a3429 --- /dev/null +++ b/functions/stagefile.sh @@ -0,0 +1,46 @@ +#!/bin/sh + +# stagefile.sh - handle stage files + +set -e + +Check_stagefile () +{ + STAGEFILE="${1}" + STAGENAME="`basename ${1}`" + + # Checking stage file + if [ -f "${STAGEFILE}" ] + then + echo "W: skipping ${STAGENAME}" + exit 0 + fi +} + +Create_stagefile () +{ + STAGEFILE="${1}" + STAGEDIRECTORY="`dirname ${1}`" + + # Creating stage directory + if [ ! -d "${STAGEDIRECTORY}" ] + then + mkdir -p "${STAGEDIRECTORY}" + fi + + # Creating stage file + touch "${STAGEFILE}" +} + +Require_stagefile () +{ + STAGEFILE="${1}" + STAGENAME="`basename ${1}`" + + # Checking stage file + if [ ! -f "${STAGEFILE}" ] + then + echo "E: ${STAGENAME} missing" + exit 1 + fi +} |