johnnyslt | 0f74433 | 2015-01-12 08:10:55 -0200 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
xyyx | 254e48a | 2020-09-23 07:16:56 +0000 | [diff] [blame] | 3 | Changelog=Changelog.txt |
| 4 | |
| 5 | DEVICE=$(echo $TARGET_PRODUCT | cut -d "_" -f2) |
johnnyslt | 0f74433 | 2015-01-12 08:10:55 -0200 | [diff] [blame] | 6 | |
| 7 | if [ -f $Changelog ]; |
| 8 | then |
| 9 | rm -f $Changelog |
| 10 | fi |
| 11 | |
| 12 | touch $Changelog |
| 13 | |
| 14 | # Print something to build output |
| 15 | echo ${bldppl}"Generating changelog..."${txtrst} |
| 16 | |
pimpmaneaton | 1420dfd | 2019-01-16 14:00:20 -0700 | [diff] [blame] | 17 | for i in $(seq 15); |
johnnyslt | 0f74433 | 2015-01-12 08:10:55 -0200 | [diff] [blame] | 18 | do |
Jon West | 6cd1f55 | 2021-05-10 11:05:32 -0400 | [diff] [blame] | 19 | export After_Date=`/bin/date --date="$i days ago" +%m-%d-%Y` |
johnnyslt | 0f74433 | 2015-01-12 08:10:55 -0200 | [diff] [blame] | 20 | k=$(expr $i - 1) |
Jon West | 6cd1f55 | 2021-05-10 11:05:32 -0400 | [diff] [blame] | 21 | export Until_Date=`/bin/date --date="$k days ago" +%m-%d-%Y` |
johnnyslt | 0f74433 | 2015-01-12 08:10:55 -0200 | [diff] [blame] | 22 | |
| 23 | # Line with after --- until was too long for a small ListView |
| 24 | echo '====================' >> $Changelog; |
| 25 | echo " "$Until_Date >> $Changelog; |
| 26 | echo '====================' >> $Changelog; |
johnnyslt | 0f74433 | 2015-01-12 08:10:55 -0200 | [diff] [blame] | 27 | |
DennySPB | 847afd4 | 2020-04-10 11:04:55 +0300 | [diff] [blame] | 28 | while read path; |
| 29 | do |
| 30 | Git_log=`git --git-dir ./${path}/.git log --after=$After_Date --until=$Until_Date --pretty=tformat:"%h %s [%an]" --abbrev-commit --abbrev=7` |
| 31 | if [ ! -z "${Git_log}" ]; then |
| 32 | echo "\n* ${path}\n${Git_log}\n" >> $Changelog; |
| 33 | fi |
| 34 | done < ./.repo/project.list; |
| 35 | |
johnnyslt | 0f74433 | 2015-01-12 08:10:55 -0200 | [diff] [blame] | 36 | done |
johnnyslt | 0f74433 | 2015-01-12 08:10:55 -0200 | [diff] [blame] | 37 | sed -i 's/project/ */g' $Changelog |
| 38 | |
xyyx | 254e48a | 2020-09-23 07:16:56 +0000 | [diff] [blame] | 39 | cp $Changelog ./out/target/product/$DEVICE/system/etc/ |
| 40 | mv $Changelog ./out/target/product/$DEVICE/ |