From bb2da21ef0c9bb401570dd6b7c8c22ac15fefd3b Mon Sep 17 00:00:00 2001 From: Michael Hanke Date: Thu, 3 Sep 2009 16:26:23 -0400 Subject: [PATCH] Move args checks into each script. --- tools/nd_adddist | 16 ++++++++++++++++ tools/nd_backport | 16 ++++++++++++++++ tools/nd_build | 15 +++++++++++++++ tools/nd_cmdsettings.sh | 10 ---------- tools/nd_gitbuild | 15 +++++++++++++++ tools/nd_updatedist | 15 +++++++++++++++ 6 files changed, 77 insertions(+), 10 deletions(-) diff --git a/tools/nd_adddist b/tools/nd_adddist index f31a29b..0d9ab92 100755 --- a/tools/nd_adddist +++ b/tools/nd_adddist @@ -1,5 +1,21 @@ #!/bin/bash +family=$1 +dist=$2 + +set -e + +if [ -z "$family" ]; then + echo "You need to provide a distribution family ('debian', 'ubuntu'); prefix with 'nd+' to enable the NeuroDebian repository." + exit 1 +fi + +if [ -z "$dist" ]; then + echo "You need to provide a distribution codename (e.g. 'lenny', 'squeeze')." + exit 1 +fi + + . /home/neurodebian/neurodebian.git/tools/nd_cmdsettings.sh # common options diff --git a/tools/nd_backport b/tools/nd_backport index 03ef786..039b1f4 100755 --- a/tools/nd_backport +++ b/tools/nd_backport @@ -1,5 +1,21 @@ #!/bin/bash +family=$1 +dist=$2 + +set -e + +if [ -z "$family" ]; then + echo "You need to provide a distribution family ('debian', 'ubuntu'); prefix with 'nd+' to enable the NeuroDebian repository." + exit 1 +fi + +if [ -z "$dist" ]; then + echo "You need to provide a distribution codename (e.g. 'lenny', 'squeeze')." + exit 1 +fi + + set -e set -u diff --git a/tools/nd_build b/tools/nd_build index 7fa26c3..08ac6e2 100755 --- a/tools/nd_build +++ b/tools/nd_build @@ -31,6 +31,21 @@ EOT exit 1 fi +family=$1 +dist=$2 + +set -e + +if [ -z "$family" ]; then + echo "You need to provide a distribution family ('debian', 'ubuntu'); prefix with 'nd+' to enable the NeuroDebian repository." + exit 1 +fi + +if [ -z "$dist" ]; then + echo "You need to provide a distribution codename (e.g. 'lenny', 'squeeze')." + exit 1 +fi + . /home/neurodebian/neurodebian.git/tools/nd_cmdsettings.sh # common options diff --git a/tools/nd_cmdsettings.sh b/tools/nd_cmdsettings.sh index 92871d4..3423933 100755 --- a/tools/nd_cmdsettings.sh +++ b/tools/nd_cmdsettings.sh @@ -3,16 +3,6 @@ dist=$2 set -e -if [ -z "$family" ]; then - echo "You need to provide a distribution family ('debian', 'ubuntu'); prefix with 'nd+' to enable the NeuroDebian repository." - exit 1 -fi - -if [ -z "$dist" ]; then - echo "You need to provide a distribution codename (e.g. 'lenny', 'squeeze')." - exit 1 -fi - # basic settings cowbuilderroot="/home/neurodebian" buildplace="${cowbuilderroot}/build" diff --git a/tools/nd_gitbuild b/tools/nd_gitbuild index 4fae395..ddec36d 100755 --- a/tools/nd_gitbuild +++ b/tools/nd_gitbuild @@ -1,5 +1,20 @@ #!/bin/bash +family=$1 +dist=$2 + +set -e + +if [ -z "$family" ]; then + echo "You need to provide a distribution family ('debian', 'ubuntu'); prefix with 'nd+' to enable the NeuroDebian repository." + exit 1 +fi + +if [ -z "$dist" ]; then + echo "You need to provide a distribution codename (e.g. 'lenny', 'squeeze')." + exit 1 +fi + . /home/neurodebian/neurodebian.git/tools/nd_cmdsettings.sh # common options diff --git a/tools/nd_updatedist b/tools/nd_updatedist index 432f9bc..e4cc9aa 100755 --- a/tools/nd_updatedist +++ b/tools/nd_updatedist @@ -1,5 +1,20 @@ #!/bin/bash +family=$1 +dist=$2 + +set -e + +if [ -z "$family" ]; then + echo "you need to provide a distribution family ('debian', 'ubuntu'); prefix with 'nd+' to enable the neurodebian repository." + exit 1 +fi + +if [ -z "$dist" ]; then + echo "you need to provide a distribution codename (e.g. 'lenny', 'squeeze')." + exit 1 +fi + . /home/neurodebian/neurodebian.git/tools/nd_cmdsettings.sh # common options -- 2.39.5