Browse Source

aokp: changelog: Add license and output path

And do some cleanup.

Change-Id: Ibbb57d093e054b16e6e7451d10f8c116e88778e4
Tom Marshall 1 year ago
parent
commit
eb73b90baa
1 changed files with 29 additions and 22 deletions
  1. 29
    22
      tools/changelog

+ 29
- 22
tools/changelog View File

@@ -1,40 +1,47 @@
1 1
 #!/bin/sh
2 2
 
3
+# Copyright (C) 2018 AOKP
4
+#
5
+# Licensed under the Apache License, Version 2.0 (the "License");
6
+# you may not use this file except in compliance with the License.
7
+# You may obtain a copy of the License at
8
+#
9
+#      http://www.apache.org/licenses/LICENSE-2.0
10
+#
11
+# Unless required by applicable law or agreed to in writing, software
12
+# distributed under the License is distributed on an "AS IS" BASIS,
13
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+# See the License for the specific language governing permissions and
15
+# limitations under the License.
16
+
3 17
 # Exports
4 18
 
5 19
 . $ANDROID_BUILD_TOP/vendor/aokp/tools/colors
6 20
 
7
-export Changelog=Changelog.txt
8
-
9
-if [ -f $Changelog ];
10
-then
11
-	rm -f $Changelog
21
+if [ "$#" -ne 1 ]; then
22
+	echo "Usage: $0 <pathname>" >&2
23
+	exit 1
12 24
 fi
25
+f="$1"
13 26
 
14
-touch $Changelog
27
+touch "$f"
15 28
 
16 29
 # Print something to build output
17 30
 echo ${bldppl}"Generating changelog..."${txtrst}
18 31
 
19
-for i in $(seq 5);
20
-do
21
-export After_Date=`date --date="$i days ago" +%m-%d-%Y`
22
-k=$(expr $i - 1)
32
+for i in $(seq 5); do
33
+	export After_Date=`date --date="$i days ago" +%m-%d-%Y`
34
+	k=$(expr $i - 1)
23 35
 	export Until_Date=`date --date="$k days ago" +%m-%d-%Y`
24 36
 
25 37
 	# Line with after --- until was too long for a small ListView
26
-	echo '====================' >> $Changelog;
27
-	echo  "     "$Until_Date       >> $Changelog;
28
-	echo '===================='	>> $Changelog;
29
-	echo >> $Changelog;
38
+	echo '====================' >> "$f"
39
+	echo  "     "$Until_Date       >> "$f"
40
+	echo '===================='	>> "$f"
41
+	echo >> "$f"
30 42
 
31 43
 	# Cycle through every repo to find commits between 2 dates
32
-	repo forall -pc 'git log --oneline --after=$After_Date --until=$Until_Date' >> $Changelog
33
-	echo >> $Changelog;
44
+	repo forall -pc 'git log --oneline --after=$After_Date --until=$Until_Date' |
45
+		sed 's/^project/   */' >> "$f"
46
+	echo >> "$f"
34 47
 done
35
-
36
-sed -i 's/project/   */g' $Changelog
37
-
38
-cp $Changelog $OUT/system/etc/
39
-cp $Changelog $OUT/
40
-rm $Changelog