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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
|
#! /bin/bash
function prom_setup() {
local lrootdir=$1
shift
local ldest=$1
shift
local lthisdir=`pwd`
cd $lrootdir
rm -rf $ldest
mkdir $ldest
mkdir $ldest/javadoc
mkdir $ldest/jnlp-files
mkdir $ldest/archive
cd $lthisdir
}
function prom_lslatest() {
local pattern=$1
shift
ls -rt | grep $pattern | tail -1
}
function prom_buildnumber_2() {
local folder=$1
shift
echo $folder | awk -F '-' ' { print substr($2, 2); } '
}
function prom_buildnumber_3() {
local folder=$1
shift
echo $folder | awk -F '-' ' { print substr($3, 2); } '
}
function prom_buildnumber_4() {
local folder=$1
shift
echo $folder | awk -F '-' ' { print substr($4, 2); } '
}
function prom_verify_artifacts() {
local name=$1
shift
local artia=$1
shift
local artib=$1
shift
local OK=0
diff -w $artia $artib && OK=1
if [ $OK -eq 0 ] ; then
echo "ERROR: $name artifacts differ $artia and $artib"
fi
}
#
# #1 module name, IE gluegen, jogl, jocl or joal
# #2 source folder of artifacts
# #3 destination folder of artifacts
# #4-n submodule name within the 7z files
#
# Example:
# promote_files gluegen /builds/gluegen-b33 tmp-archive gluegen
# promote_files jogl /builds/jogl-b211 tmp-archive nativewindow jogl newt
#
function prom_promote_files() {
local module=$1
shift
local sourcedir=$1
shift
local destdir=$1
shift
local submodules=$*
local lthisdir=`pwd`
echo "INFO: Promoting files: $module, submodules <$submodules>, from $sourcedir"
# copy the platform 7z files
cp -a $sourcedir/$module*.7z $destdir/
cp -a $sourcedir/artifact.properties $destdir/$module.artifact.properties
cd $destdir
# unpack the platform 7z files
for i in $os_and_archs ; do
local zfile=`find . -name $module\*$i.7z`
if [ -z "$zfile" ] ; then
echo "ERROR: No platform 7z file for module $module, sub $sub, platform $i, sdir $sourcedir"
exit 1
fi
local zfolder=`basename $zfile .7z`
echo "INFO: extract $module $i - $zfile -> $zfolder"
prom_extract $zfile
prom_verify_artifacts $module $module.artifact.properties $zfolder/artifact.properties
done
# copy the platform JAR files from each platform 7z folder
for i in $os_and_archs_minus_one ; do
# 7z folder verfified above already
local zfile=`find . -name $module\*$i.7z`
local zfolder=`basename $zfile .7z`
for sub in $submodules ; do
jars=`find $zfolder -name $sub\*$i\*.jar`
if [ -z "$jars" ] ; then
echo "ERROR: No platform JAR file for module $module, sub $sub, platform $i, sdir $sourcedir"
exit 1
fi
for j in $jars ; do
cp -av $j .
done
done
done
# copy the master pic JAR files
# 7z folder verfified above already
local zfile=`find . -name $module\*$masterpick.7z`
local zfolder=`basename $zfile .7z`
for sub in $submodules ; do
local jars=`find $zfolder -name $sub\*$masterpick\*.jar`
if [ -z "$jars" ] ; then
echo "ERROR: No platform JAR file for module $module, sub $sub, masterpick platform $masterpick, sdir $sourcedir"
exit 1
fi
local jars=`find $zfolder -name $sub\*.jar`
if [ -z "$jars" ] ; then
echo "ERROR: No JAR files for module $module, sub $sub, masterpick $masterpick, sdir $sourcedir"
exit 1
fi
for j in $jars ; do
cp -av $j .
done
done
cp -av $zfolder/jnlp-files/* ./jnlp-files/
cd $lthisdir
}
function prom_extract() {
local zfile=$1
shift
local OK=0
7z x $zfile && OK=1
if [ $OK -eq 0 ] ; then
echo ERROR in 7z file $zfile
else
echo OK 7z file $zfile
fi
}
function prom_cleanup() {
local destdir=$1
shift
local lthisdir=`pwd`
cd $destdir
for i in $os_and_archs ; do
for j in *$i.7z ; do
local bname=`basename $j .7z`
if [ -d $bname ] ; then
echo "INFO: delete folder $bname"
rm -rf $bname
fi
done
done
mv *.7z archive/
cd $lthisdir
}
function prom_integrity_check() {
local destdir=$1
shift
local lthisdir=`pwd`
cd $destdir
mkdir dump
cd dump
for i in ../*.jar ; do
local bname=`basename $i`
echo -n "INFO: integrity check - $bname - "
local OK=0
jar xvf $i >& $bname.log && OK=1
if [ $OK -eq 0 ] ; then
echo ERROR
cat $bname.log
else
echo OK
fi
done
echo
cd ..
rm -rf dump
cd $lthisdir
}
|