summaryrefslogtreecommitdiff
path: root/databases/firebird-devel/files/buildBootDatabases
blob: 155f866b0830baada6e2ba0b5ca9e91e998b8796 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
#!/bin/sh
#
# $Id: buildBootDatabases,v 1.1 2000/09/29 16:26:39 tom Exp tom $
#
# Contributor(s):
#
# Reed Mideke <rfm@cruzers.com>
# Tom Coleman TMC Systems <tcoleman@autowares.com>
#
printUsage() {
   echo "usage is : 'buildBootDatabases'"
   echo "      or : 'buildBootDatabases <destDir>'"
   echo ""
   echo "usually as:"
   echo "sh builds/original/buildBootDatabases"
   echo "from the main interbase source directory"
   echo "where defaults are srcDir=. and destDir=../refDatabases"
   echo ""
}

checkVariables() {
     echo ""
     echo ""
     echo ""
     echo "- Firebird - Reference database build ------------------------"
     echo ""
     echo "Parameters :"
     echo ""
     echo "Source code dir root                   : $IBSrc"
     echo "Dest root dir where to build ref db's  : $IBRefDir"
     echo ""
     echo "If you wish to have different values please set them before running"
     echo "this script"
     echo "usage is : 'buildBootDatabases'"
     echo "      or : 'buildBootDatabases <destDir>'"
     echo ""
     echo "--------------------------------------------------------------"
     echo ""
     AskQuestion "Press return to continue"
}

#--------------------------------------------------------------------
# Ask the user a question.

Answer=""

AskQuestion() {
    Test=$1
    DefaultAns=$2
    echo -n "${1}"
    Answer="$DefaultAns"
#    read Answer
}

#--------------------------------------------------------------------
# Build the databases needed for a standard interbase build

buildStdDatabases() {
    echo "- building std databases"

# boot make will create this if it does not exist
#   (cd jrd; touch metadata.gdb)

# boot make will create this if it does not exist
#   touch msgs/msg.gdb

# boot make will create this if it does not exist
#   touch qli/help.gdb

    touch pyxis/forms.gdb

    touch utilities/rebuild.gdb
}

#------------------------------------------------------------------------

createRefDir() {
    if [ -d $IBRefDir ] 
      then
         echo "** Warning ** - The reference directory $IBRefDir already exists"
         AskQuestion "Press return to delete it and continue or ^C to abort"

         rm -rf $IBRefDir
    fi
 
    mkdir -p $IBRefDir
}


#== Main Program ==================================================


# Check parameters 

if [ $# = 0 ] 
  then
     export IBSrc=`pwd`
     export IBRefDir=../refDatabases

elif [ $# = 1 ]
  then
     export IBSrc=`pwd`
     export IBRefDir=$1

else
  printUsage
  exit
fi


checkVariables


createRefDir

cd $IBRefDir

mkdir -p msgs qli jrd utilities example4 example5 examples pyxis

buildStdDatabases