From 9e9eb89f3b86c6c81af68db761e21187e7cab2e7 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Sun, 17 Oct 2010 20:15:48 -0300 Subject: [PATCH] Make boom-config complain about usage errors. - boom/Makefile, boom/boom-config.in: add a warning to boom-config that the file is machine-generated - boom/boom-config.in (usage): complain about unrecognized keywords --- boom/Makefile | 3 ++- boom/boom-config.in | 12 ++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/boom/Makefile b/boom/Makefile index 3b7b4e7..a5805f2 100644 --- a/boom/Makefile +++ b/boom/Makefile @@ -14,7 +14,8 @@ DB = $(EQU) $(INV) $(DSC) $(CHR) all: boom-config boom-config: boom-config.in Makefile - sed 's/##DIST##/$(DIST)/;s/##MANU##/$(MANU)/' boom-config.in \ + sed -e 's/##WARN##/*** MACHINE-GENERATED. DO NOT EDIT ! ***/' \ + -e 's/##DIST##/$(DIST)/;s/##MANU##/$(MANU)/' boom-config.in \ >$@ || { rm -f $@; exit 1; } chmod 755 boom-config diff --git a/boom/boom-config.in b/boom/boom-config.in index 256aa08..d0efe01 100644 --- a/boom/boom-config.in +++ b/boom/boom-config.in @@ -1,8 +1,18 @@ #!/bin/sh +# ##WARN## + DIST="##DIST##" MANU="##MANU##" + +usage() +{ + echo "usage: $0 equ|inv|dsc|chr ..." 1>&2 + exit 1 +} + + base=`which "$0"` base=`dirname "$base"` [ "$base" = "${base#/}" ] && base=`pwd`/$base @@ -18,6 +28,8 @@ while [ "$1" ]; do for n in $DIST; do echo "$base/dist/$n/db/all.dsc"; done;; chr) for n in $MANU; do echo "$base/manu/$n/$n.chr"; done;; + *) + usage;; esac shift done