scripts/graph-build-time: properly warn about missing modules
Currently the graph-build-time script prints a python exception if a needed module cannot be imported. Catch the exception and tell the user which packages are missing, as we do for other missing dependencies. Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
This commit is contained in:
parent
96183af9af
commit
9722381c0d
|
@ -49,8 +49,14 @@
|
||||||
# * argparse (by default in Python 2.7, requires python-argparse if
|
# * argparse (by default in Python 2.7, requires python-argparse if
|
||||||
# Python 2.6 is used)
|
# Python 2.6 is used)
|
||||||
|
|
||||||
import matplotlib as mpl
|
import sys
|
||||||
import numpy
|
|
||||||
|
try:
|
||||||
|
import matplotlib as mpl
|
||||||
|
import numpy
|
||||||
|
except ImportError:
|
||||||
|
sys.stderr.write("You need python-matplotlib and python-numpy to generate build graphs\n")
|
||||||
|
exit(1)
|
||||||
|
|
||||||
# Use the Agg backend (which produces a PNG output, see
|
# Use the Agg backend (which produces a PNG output, see
|
||||||
# http://matplotlib.org/faq/usage_faq.html#what-is-a-backend),
|
# http://matplotlib.org/faq/usage_faq.html#what-is-a-backend),
|
||||||
|
@ -62,7 +68,6 @@ import matplotlib.pyplot as plt
|
||||||
import matplotlib.font_manager as fm
|
import matplotlib.font_manager as fm
|
||||||
import csv
|
import csv
|
||||||
import argparse
|
import argparse
|
||||||
import sys
|
|
||||||
|
|
||||||
steps = [ 'extract', 'patch', 'configure', 'build',
|
steps = [ 'extract', 'patch', 'configure', 'build',
|
||||||
'install-target', 'install-staging', 'install-images',
|
'install-target', 'install-staging', 'install-images',
|
||||||
|
|
Loading…
Reference in New Issue
Block a user