| [1] | 1 | #########################################################################
 | 
|---|
 | 2 | #
 | 
|---|
 | 3 | # Setup test Subroutines
 | 
|---|
 | 4 | #
 | 
|---|
 | 5 | #########################################################################
 | 
|---|
| [27] | 6 | #
 | 
|---|
 | 7 | # Copyright Rainer Wichmann (2005)
 | 
|---|
 | 8 | #
 | 
|---|
 | 9 | # License Information:
 | 
|---|
 | 10 | # This program is free software; you can redistribute it and/or modify
 | 
|---|
 | 11 | # it under the terms of the GNU General Public License as published by
 | 
|---|
 | 12 | # the Free Software Foundation; either version 2 of the License, or
 | 
|---|
 | 13 | # (at your option) any later version.
 | 
|---|
 | 14 | #
 | 
|---|
 | 15 | # This program is distributed in the hope that it will be useful,
 | 
|---|
 | 16 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
|---|
 | 17 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | 
|---|
 | 18 | # GNU General Public License for more details.
 | 
|---|
 | 19 | #
 | 
|---|
 | 20 | # You should have received a copy of the GNU General Public License
 | 
|---|
 | 21 | # along with this program; if not, write to the Free Software
 | 
|---|
 | 22 | # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 | 
|---|
 | 23 | #
 | 
|---|
| [1] | 24 | 
 | 
|---|
 | 25 | # test setup
 | 
|---|
 | 26 | #
 | 
|---|
 | 27 | testSETUP1() {
 | 
|---|
 | 28 |     test -d "$basedir" || printFATAL "Basedir $basedir does not exist"
 | 
|---|
 | 29 |     test -d "$basedir/tmp" || printFATAL "Tmpdir $basedir/tmp does not exist"
 | 
|---|
 | 30 |     tmpdir="$basedir/tmp"; export tmpdir
 | 
|---|
 | 31 |     return 0
 | 
|---|
 | 32 | }
 | 
|---|
 | 33 | 
 | 
|---|
 | 34 | # test setup
 | 
|---|
 | 35 | #
 | 
|---|
 | 36 | testSETUP2() {
 | 
|---|
 | 37 |     test -z "$action" && 
 | 
|---|
 | 38 |         { 
 | 
|---|
 | 39 |           promptMENU "Which action do you want to perform" "install" "build" "download" "checksrc" "clean" "info" "uninstall"; 
 | 
|---|
 | 40 |           action="$MENU"; export action; 
 | 
|---|
 | 41 |         }
 | 
|---|
 | 42 |     if (test x"$action" = xbuild || test x"$action" = xinstall || test x"$action" = xuninstall)
 | 
|---|
 | 43 |     then
 | 
|---|
 | 44 |         test -z "$host"   && 
 | 
|---|
 | 45 |             { 
 | 
|---|
 | 46 |                 promptINPUT "On which host do you want to $action"; 
 | 
|---|
 | 47 |                 host="$INPUT"; export host; 
 | 
|---|
 | 48 |             }
 | 
|---|
 | 49 |     fi
 | 
|---|
 | 50 |     return 0
 | 
|---|
 | 51 | }
 | 
|---|
 | 52 | 
 | 
|---|
 | 53 | setupFORMAT() {
 | 
|---|
 | 54 | 
 | 
|---|
 | 55 |     tmp_format=`echo "${1}" | sed '/^\(.*\)\.\([0-9a-zA-Z]*\)$/{ s//\2/; q; }'`
 | 
|---|
 | 56 |     echo "${tmp_format}"
 | 
|---|
 | 57 | }
 | 
|---|
 | 58 | 
 | 
|---|
 | 59 | setupVERSION() {
 | 
|---|
 | 60 |     tmp_version=`echo ${DB_version} | sed s%\.run%% | sed s%\.rpm%% | sed s%\.depot%% | sed s%\.deb%% | sed s%\.tbz2%% | sed s%\.pkg%%`
 | 
|---|
 | 61 |     echo "${tmp_version}"
 | 
|---|
 | 62 | 
 | 
|---|
 | 63 | }
 | 
|---|