This repository has been archived by the owner on May 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdate-reproducibility-summary.sh
executable file
·98 lines (79 loc) · 3.85 KB
/
update-reproducibility-summary.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#!/bin/bash
cat <(echo "| groupId | artifactId (buildspec, Git) | latest release | master HEAD SNAPSHOT |"
echo "| ------- | ------------------------------ | ----------------- | ----------------- |"
count=0
countHEADOk=0
sumHEADOk=0
sumHEADKo=0
countLatest=0
countLatestOk=0
sumLatestOk=0
sumLatestKo=0
prevDist=""
for buildspec in `find maven -name *.buildspec -print | sort`
do
count=$(($count+1))
. $buildspec
dist="`dirname ${buildspec}`"
if [ "${prevDist}" != "${dist}" ]; then
echo -n "| "
echo "| **dist = [${dist}](https://downloads.apache.org/`dirname ${buildspec}`)** "
prevDist="${dist}"
fi
groupDir=$(echo ${groupId} | tr '.' '/')
echo -n "| [`echo ${groupId} | sed s/org.apache.maven/m/`](https://repo.maven.apache.org/maven2/${groupDir}) "
echo -n "| [${artifactId}](https://repo.maven.apache.org/maven2/${groupDir}/${artifactId}) "
echo -n "([spec](https://github.com/jvm-repo-rebuild/reproducible-maven-HEAD/tree/master/${buildspec}), "
echo -n "[Git](${gitRepo})) "
buildinfo="`dirname ${buildspec}`/`basename ${buildinfo}`"
b=`echo "${buildinfo}" | sed s/-SNAPSHOT//`
buildinfoLatestFilename="`ls ${b} | grep -v SNAPSHOT`"
buildinfoHEADFilename="`ls ${buildinfo} | grep SNAPSHOT`"
if [ "${buildinfoLatestFilename}" == "" ]
then
echo -n "| "
else
countLatest=$(($countLatest+1))
buildinfoLatest="`dirname ${buildspec}`/`basename ${buildinfoLatestFilename}`"
. ${buildinfoLatest}.compare
echo -n "| [${version}](https://github.com/jvm-repo-rebuild/reproducible-maven-HEAD/tree/master/${buildinfoLatest}): "
[ ${ok} -gt 0 ] && echo -n "${ok} :heavy_check_mark: "
[ ${ko} -gt 0 ] && echo -n " ${ko} [:warning:](https://github.com/jvm-repo-rebuild/reproducible-maven-HEAD/tree/master/${buildinfoLatest}.compare) "
[ ${ko} -eq 0 ] && countLatestOk=$(($countLatestOk + 1))
sumLatestOk=$(($sumLatestOk + ${ok}))
sumLatestKo=$(($sumLatestKo + ${ko}))
fi
buildinfoHEAD="`dirname ${buildspec}`/`basename ${buildinfoHEADFilename}`"
. ${buildinfoHEAD}.compare
version=`echo "${version}" | sed 's/-SNAPSHOT/-S/'`
echo -n "| [${version}](https://github.com/jvm-repo-rebuild/reproducible-maven-HEAD/tree/master/${buildinfoHEAD}): "
[ ${ok} -gt 0 ] && echo -n "${ok} :heavy_check_mark: "
[ ${ko} -gt 0 ] && echo -n " ${ko} [:warning:](https://github.com/jvm-repo-rebuild/reproducible-maven-HEAD/tree/master/${buildinfoHEAD}.compare) "
echo "|"
[ ${ko} -eq 0 ] && countHEADOk=$(($countHEADOk + 1))
sumHEADOk=$(($sumHEADOk + ${ok}))
sumHEADKo=$(($sumHEADKo + ${ko}))
done
echo -n "| | **${count}** "
echo -n "| **${countLatest}: ${countLatestOk} :heavy_check_mark: + $((${countLatest}-${countLatestOk})) :warning: = "
echo -n "$((${countLatestOk}*100/${countLatest}))% :heavy_check_mark:: "
echo -n "${sumLatestOk} :heavy_check_mark: ${sumLatestKo} :warning:** "
echo -n "| **${count}: ${countHEADOk} :heavy_check_mark: + $((${count}-${countHEADOk})) :warning: = "
echo -n "$((${countHEADOk}*100/${count}))% :heavy_check_mark:: "
echo "${sumHEADOk} :heavy_check_mark: ${sumHEADKo} :warning:** |"
echo "Apache Maven consists in ${count} sub-projects:
- **Latest release: on ${countLatest} releases, reproducibility status is ${countLatestOk} :heavy_check_mark: + $((${countLatest}-${countLatestOk})) :warning:
= $((${countLatestOk}*100/${countLatest}))% :heavy_check_mark:**
- **master HEAD SNAPSHOT: on ${count} SNAPSHOTs, reproducibility status is ${countHEADOk} :heavy_check_mark: + $((${count}-${countHEADOk})) :warning:
= $((${countHEADOk}*100/${count}))% :heavy_check_mark:**
sub-projects details:
" > summary.md
) > summary-table.md
lead='^<!-- BEGIN GENERATED CONTENT -->$'
tail='^<!-- END GENERATED CONTENT -->$'
sed -e "/$lead/,/$tail/{ /$lead/{p; r summary.md
r summary-table.md
}; /$tail/p; d }" README.md > README.md.tmp
mv README.md.tmp README.md
rm summary.md
rm summary-table.md