-
-
Notifications
You must be signed in to change notification settings - Fork 204
/
package_full.sh
executable file
·48 lines (35 loc) · 1.06 KB
/
package_full.sh
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
#Get version from git(hub) tag
export VERSION="4.2.1"
FLAVOURS=`ls *.variables`
cp extras/package_index.json.NewTag.template /tmp/json
for flavour in $FLAVOURS; do
# Hack, clean everything from known positions and restart
rm -rf /tmp/mbed-os-program
git reset --hard
git clean -dxf
# Clone ArduinoCore-api in parent folder and create symlinks
git clone [email protected]:arduino/ArduinoCore-API.git ../api/
ln -s ../../../api/api cores/arduino/api
./package.sh $flavour
echo "Creating json"
source /tmp/env
CHKSUM=`sha256sum ../$FILENAME | awk '{ print $1 }'`
SIZE=`wc -c ../$FILENAME | awk '{ print $1 }'`
source ${flavour}
FLAVOUR=${FLAVOUR^^}
if [ x$FLAVOUR != x ]; then
FLAVOUR=${FLAVOUR}_
fi
echo FILENAME=$FILENAME
echo CHKSUM=$CHKSUM
echo SIZE=$SIZE
echo VERSION=$VERSION
echo FLAVOUR=$FLAVOUR
cat /tmp/json |
sed "s/%%VERSION%%/${VERSION}/" |
sed "s/%%${FLAVOUR}FILENAME%%/${FILENAME}/" |
sed "s/%%${FLAVOUR}CHECKSUM%%/${CHKSUM}/" |
sed "s/%%${FLAVOUR}SIZE%%/${SIZE}/" > /tmp/json2
mv /tmp/json2 /tmp/json
done
cp /tmp/json package_${CORE_NAME}_${VERSION}_index.json