-
Notifications
You must be signed in to change notification settings - Fork 78
/
gitrev.sh
46 lines (34 loc) · 1005 Bytes
/
gitrev.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
#! /bin/bash
#
rev_new=$(git rev-parse --short=7 HEAD)
rev_old=$(cat ./src/gitrev.c 2>/dev/null | tr -d '\n' | awk -F"\"" '{print $2}' | awk -F"\"" '{print $1}')
if [ "$rev_new" != "$rev_old" ] || [ ! -f ./src/gitrev.c ]; then
if [ -n "$rev_new" ]; then
echo "Changed Rev $rev_old to $rev_new" >&2
fi
cat <<EOF > ./src/gitrev.c
#define GIT_REV "$rev_new"
const char *GetRev()
{
return GIT_REV;
}
EOF
rev_date=`date -u +%Y%m%d%H%M%S`
cat <<EOF > ./meta/meta.xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<app version="1">
<name>Loadiine GX2</name>
<coder>Dimok, Maschell, n1ghty, dibas</coder>
<version>0.3 r$rev_new</version>
<release_date>$rev_date</release_date>
<short_description>WiiU game loader</short_description>
<long_description>Loads games from SD card.
Compatibility list:
http://wiki.gbatemp.net/wiki/Loadiine_compatibility_list
Sources:
https://github.com/dimok789/loadiine_gx2
</long_description>
</app>
EOF
fi
echo $rev_new