[rtems-testing commit] release.sh: refactor checks for executable dependencies

Gedare Bloom gedare at rtems.org
Thu May 14 17:33:38 UTC 2015


Module:    rtems-testing
Branch:    master
Commit:    62bfc7999f62ff698ec24477b424bbb9d68aa35b
Changeset: http://git.rtems.org/rtems-testing/commit/?id=62bfc7999f62ff698ec24477b424bbb9d68aa35b

Author:    Gedare Bloom <gedare at rtems.org>
Date:      Thu May 14 13:33:32 2015 -0400

release.sh: refactor checks for executable dependencies

---

 release-helpers/release.sh | 26 ++++++++++++--------------
 1 file changed, 12 insertions(+), 14 deletions(-)

diff --git a/release-helpers/release.sh b/release-helpers/release.sh
index f760cc5..0b473cb 100755
--- a/release-helpers/release.sh
+++ b/release-helpers/release.sh
@@ -77,6 +77,12 @@ vecho()
   fi
 }
 
+check_dep()
+{
+  type $1 > /dev/null 2>&1
+  check_error $? "$1 is not in your PATH"
+}
+
 #  Set up variables which control the scripts behavior
 verbose=yes
 VERSION=NOT_SET
@@ -99,14 +105,9 @@ done
 test -r aclocal/version.m4
 check_error $? "Not at the top of an RTEMS tree"
 
-type sb-bootstrap >/dev/null 2>&1
-check_error $? "sb-bootstrap is not in your PATH"
-
-type doxygen > /dev/null 2>&1
-check_error $? "doxygen is not in your PATH"
-
-type mscgen > /dev/null 2>&1
-check_error $? "mscgen is not in your PATH"
+check_dep sb-bootstrap
+check_dep doxygen
+check_dep mscgen
 
 if [ ${bump_dot_release} = "no" -a ${bump_major_version} = "no" ] ; then
   fatal "Must select an action: bump major or dot release"
@@ -168,10 +169,8 @@ if [ ${bump_dot_release} = "yes" ] ; then
 
   # We need to have access to various texi tools to build documentation
   # For CentOS, the RPMs are texinfo-tex and texi2html
-  type texi2dvi >/dev/null 2>&1
-  check_error $? "texi2dvi is not in your PATH"
-  type texi2pdf >/dev/null 2>&1
-  check_error $? "texi2pdf is not in your PATH"
+  check_dep texi2dvi
+  check_dep texi2pdf
   # main tool varies based on texinfo version
   type texi2any >/dev/null 2>&1
   ta=$?
@@ -181,8 +180,7 @@ if [ ${bump_dot_release} = "yes" ] ; then
   fi
 
   # We need to have access to SPARC tools to build Doxygen.
-  type sparc-rtems${MAJOR}-gcc >/dev/null 2>&1
-  check_error $? "sparc-rtems${MAJOR}-gcc is not in your PATH"
+  check_dep sparc-rtems${MAJOR}-gcc
 fi
 
 ##### END OF ERROR CHECKING



More information about the vc mailing list