summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarry Youd <harry@harryyoud.co.uk>2017-05-14 14:46:30 +0100
committerHarry Youd <harry@harryyoud.co.uk>2017-05-14 14:49:10 +0100
commite0f5ea8f537df3864e2d14447b9074e0cbed2bc8 (patch)
treeef0e80477c40e7ebb7d67cc962e1e1b99b82bd22
parentceb8610b537bc7c15971ed8c8bc62eb1418c5362 (diff)
downloadscripts-e0f5ea8f537df3864e2d14447b9074e0cbed2bc8.tar.gz
scripts-e0f5ea8f537df3864e2d14447b9074e0cbed2bc8.tar.bz2
scripts-e0f5ea8f537df3864e2d14447b9074e0cbed2bc8.zip
Add capability for checking CVE json
* Add capability for checking CVE kernels.json * Stop spam of console when missing a file * Fix weird indentation in some places Change-Id: I6181649c604f2b46082257d4e021bd8dcee16937
-rwxr-xr-xmaintainers.sh37
1 files changed, 28 insertions, 9 deletions
diff --git a/maintainers.sh b/maintainers.sh
index db88448..980e9bd 100755
--- a/maintainers.sh
+++ b/maintainers.sh
@@ -6,6 +6,7 @@
updaterrepolocation="../updater"
wikirepolocation="../wiki"
jenkinsrepolocation="../jenkins"
+cverepolocation="../cve"
showallmaintainers=false
if ! [ -z $1 ]; then showallmaintainers=true; fi
if ! [ -d $wikirepolocation ]; then
@@ -24,7 +25,7 @@ hudsonlist=$(cat $jenkinsrepolocation/lineage-build-targets | cut -f1 -d ' ' | s
# Print list of maintainers if told to
if [ $showallmaintainers == true ]; then
-echo "## Maintainers of all devices in hudson according to the wiki:"
+ echo "## Maintainers of all devices in hudson according to the wiki:"
for codename in $hudsonlist; do
if [ -f $wikirepolocation/_data/devices/$codename.yml ]; then
wiki_maintainers=$(grep maintainer $wikirepolocation/_data/devices/$codename.yml | cut -d ':' -f2 | awk '{$1=$1};1')
@@ -35,7 +36,7 @@ echo "## Maintainers of all devices in hudson according to the wiki:"
printf "%-15s%-40s\n" "$codename:" "$wiki_maintainers"
fi
done
-printf "\n"
+ printf "\n"
fi
# Check if a wiki page exists for each device
@@ -85,15 +86,33 @@ printf "\n"
# Check that devices have an update page
echo "## Devices present in hudson, but don't have an update page:"
updaterfail=0
-for codename in $hudsonlist; do
- if [ -f $updaterrepolocation/devices.json ]; then
+if [ -f $updaterrepolocation/devices.json ]; then
+ for codename in $hudsonlist; do
if ! grep -q "model\": \"$codename\"" $updaterrepolocation/devices.json; then
echo $codename
((updaterfail++))
fi
- else
- echo "$updaterrepolocation/devices.json doesn't exist"
- ((updaterfail++))
- fi
-done
+ done
+else
+ echo "$updaterrepolocation/devices.json doesn't exist"
+ ((updaterfail++))
+fi
if [ $updaterfail = 0 ]; then echo "none"; else echo "total = $updaterfail"; fi
+printf "\n"
+
+# Check that devices are listed in CVE tracker
+echo "## Devices present in hudson, but don't have a kernel listed for them in CVE tracker:"
+cvefail=0
+if [ -f $cverepolocation/kernels.json ]; then
+ for codename in $hudsonlist; do
+ if ! grep -q "android_device_"'.*'"_$codename" $cverepolocation/kernels.json; then
+ echo $codename
+ ((cvefail++))
+ fi
+ done
+else
+ echo "$cverepolocation/kernels.json doesn't exist"
+ ((cvefail++))
+fi
+if [ $cvefail = 0 ]; then echo "none"; else echo "total = $cvefail"; fi
+