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
This commit is contained in:
Harry Youd
2017-05-14 14:46:30 +01:00
parent ceb8610b53
commit e0f5ea8f53

View File

@@ -6,6 +6,7 @@
updaterrepolocation="../updater" updaterrepolocation="../updater"
wikirepolocation="../wiki" wikirepolocation="../wiki"
jenkinsrepolocation="../jenkins" jenkinsrepolocation="../jenkins"
cverepolocation="../cve"
showallmaintainers=false showallmaintainers=false
if ! [ -z $1 ]; then showallmaintainers=true; fi if ! [ -z $1 ]; then showallmaintainers=true; fi
if ! [ -d $wikirepolocation ]; then if ! [ -d $wikirepolocation ]; then
@@ -85,15 +86,33 @@ printf "\n"
# Check that devices have an update page # Check that devices have an update page
echo "## Devices present in hudson, but don't have an update page:" echo "## Devices present in hudson, but don't have an update page:"
updaterfail=0 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 if ! grep -q "model\": \"$codename\"" $updaterrepolocation/devices.json; then
echo $codename echo $codename
((updaterfail++)) ((updaterfail++))
fi fi
done
else else
echo "$updaterrepolocation/devices.json doesn't exist" echo "$updaterrepolocation/devices.json doesn't exist"
((updaterfail++)) ((updaterfail++))
fi fi
done
if [ $updaterfail = 0 ]; then echo "none"; else echo "total = $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