@@ -42,13 +42,36 @@ if [ -n "$1" ]; then
42
42
VERSION=" $VERSIONPREFIX $1 "
43
43
fi
44
44
45
- # now let's see if the version string contains "rc", and strip it off if it does
46
- # and simultaneously add RCSUBDIR to BASEDIR, where we will look for SIGNATUREFILENAME
47
- if [[ $VERSION == * " $RCVERSIONSTRING " * ]] ; then
48
- BASEDIR= " $BASEDIR ${VERSION /% - $RCVERSIONSTRING * } / "
49
- BASEDIR=" $BASEDIR$RCSUBDIR . $RCVERSIONSTRING ${ VERSION: -1} /"
45
+ STRIPPEDLAST= " ${VERSION % - * } "
46
+
47
+ # now let's see if the version string contains "rc" or a platform name (e.g. "osx")
48
+ if [[ " $STRIPPEDLAST - " == " $VERSIONPREFIX " ]] ; then
49
+ BASEDIR=" $BASEDIR$VERSION /"
50
50
else
51
+ # let's examine the last part to see if it's rc and/or platform name
52
+ STRIPPEDNEXTTOLAST=" ${STRIPPEDLAST% -* } "
53
+ if [[ " $STRIPPEDNEXTTOLAST -" == " $VERSIONPREFIX " ]]; then
54
+
55
+ LASTSUFFIX=" ${VERSION##* -} "
56
+ VERSION=" $STRIPPEDLAST "
57
+
58
+ if [[ $LASTSUFFIX == * " $RCVERSIONSTRING " * ]]; then
59
+ RCVERSION=" $LASTSUFFIX "
60
+ else
61
+ PLATFORM=" $LASTSUFFIX "
62
+ fi
63
+
64
+ else
65
+ RCVERSION=" ${STRIPPEDLAST##* -} "
66
+ PLATFORM=" ${VERSION##* -} "
67
+
68
+ VERSION=" $STRIPPEDNEXTTOLAST "
69
+ fi
70
+
51
71
BASEDIR=" $BASEDIR$VERSION /"
72
+ if [[ $RCVERSION == * " $RCVERSIONSTRING " * ]]; then
73
+ BASEDIR=" $BASEDIR$RCSUBDIR .$RCVERSION /"
74
+ fi
52
75
fi
53
76
54
77
SIGNATUREFILE=" $BASEDIR$SIGNATUREFILENAME "
@@ -92,12 +115,22 @@ if [ $RET -ne 0 ]; then
92
115
exit " $RET "
93
116
fi
94
117
118
+ if [ -n " $PLATFORM " ]; then
119
+ grep $PLATFORM $TMPFILE > " $TMPFILE -plat"
120
+ TMPFILESIZE=$( stat -c%s " $TMPFILE -plat" )
121
+ if [ $TMPFILESIZE -eq 0 ]; then
122
+ echo " error: no files matched the platform specified" && exit 3
123
+ fi
124
+ mv " $TMPFILE -plat" $TMPFILE
125
+ fi
126
+
95
127
# here we extract the filenames from the signature file
96
128
FILES=$( awk ' {print $2}' " $TMPFILE " )
97
129
98
130
# and download these one by one
99
131
for file in $FILES
100
132
do
133
+ echo " Downloading $file "
101
134
wget --quiet -N " $BASEDIR$file "
102
135
done
103
136
0 commit comments