Revision 80ccd6de

b/.gitignore
39 39
_gitstats
40 40
*.aquarium.properties
41 41
sshfs
42
aquarium-dist
43
aquarium-dist.tar.gz
b/make-dist.sh
48 48
P_BUILD="normal"
49 49
P_KEEPDIST="no"
50 50
P_FAKEIT="no"
51
P_ARCHIVE=""
51 52

  
52 53
verbose() {
53 54
  if [ "$P_VERBOSE" = "yes" ]; then
......
59 60
  verbose "Build type          :" $P_BUILD
60 61
  verbose "Custom configuration:" $P_PROPS
61 62
  verbose "Keep dist/ folder   :" $P_KEEPDIST
63
  verbose "Custom achive name  :" $P_ARCHIVE
62 64
  verbose "Fake it             :" $P_FAKEIT
63 65
}
64 66

  
......
67 69
    exit 1
68 70
}
69 71

  
72
makedistname() {
73
  if [ -n "$P_ARCHIVE" ]; then
74
    DIST="$P_ARCHIVE"
75
  fi
76
}
77

  
70 78
removedist() {
71 79
  local KEEP=$1
72 80
  if [ "$KEEP" = "no" -a -e $DIST ]; then
......
152 160
}
153 161

  
154 162
archive() {
155
  ARC=$DIST.tar.gz
163
  ARC="${DIST}.tar.gz"
164

  
156 165
  if [ -e "$ARC" ]; then
157 166
    echo
158 167
    echo Removing previous $ARC
168
    rm "$ARC"
159 169
  fi
160 170
  echo
161 171
  echo "Creating archive"
162
  tar zcvf $ARC $DIST/ || fail "creating archive"
172
  tar zcvf "$ARC" $DIST/ || fail "creating archive"
163 173
  echo "File $ARC created succesfully"
164 174
  echo "Cleaning up"
165
  ls -al $ARC
175
  ls -al "$ARC"
166 176
}
167 177

  
168 178
usage() {
169 179
  echo "Usage: $0 [options]"
170 180
  echo ""
171 181
  echo "OPTIONS:"
182
  echo "  -a NAME   Use archive NAME."
183
  echo "            The full name will be NAME.tar.gz."
172 184
  echo "  -b TYPE   Use build TYPE. One of 'normal', 'fast'."
173 185
  echo "            'normal' is the default and can be omitted."
174 186
  echo "            'fast' means that it will not run mvn clean."
......
181 193
  exit 0
182 194
}
183 195

  
184
while getopts ":b:hkc:nv" opt
196
while getopts ":a:b:hkc:nv" opt
185 197
do
186 198
  case $opt in
199
    a) P_ARCHIVE=$OPTARG
200
    ;;
187 201
    b) P_BUILD=$OPTARG
188 202
    ;;
189 203
    c) P_PROPS=$OPTARG
......
224 238
fi
225 239

  
226 240
verbose_p         && \
241
makedistname      && \
227 242
removedist     no && \
228 243
createdist        && \
229 244
clean             && \

Also available in: Unified diff