-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuildlog.sh
30 lines (25 loc) · 990 Bytes
/
buildlog.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
if [ -z "$CM_BUILD" ]; then
## Use jenkins' variable
CM_BUILD=$LUNCH
fi
MYPATH=$(dirname $0)
export CHANGESPATH=$WORKSPACE/archive/CHANGES.txt
rm $CHANGESPATH 2>/dev/null
prevts=
for ts in `python2 $MYPATH/getdates.py $CM_BUILD | sort -rn`; do
export ts
(echo "==================================="
echo -n "Since ";date -u -d @$ts
echo "==================================="
if [ -z "$prevts" ]; then
repo forall -c 'L=$(git log --oneline --since $ts -n 1); if [ "n$L" != "n" ]; then echo; echo " * $REPO_PATH"; git log --oneline --since $ts; fi' | tee >(wc -l > $WORKSPACE/changecount)
else
repo forall -c 'L=$(git log --oneline --since $ts --until $prevts -n 1); if [ "n$L" != "n" ]; then echo; echo " * $REPO_PATH"; git log --oneline --since $ts --until $prevts; fi'
fi
echo) >> $CHANGESPATH
export prevts=$ts
done
if [ -z "$prevts" ]; then
rm -f $WORKSPACE/changecount
echo "This is the first CyanogenMod build of this type for device $CM_BUILD" >> $CHANGESPATH
fi