summaryrefslogtreecommitdiffstats
path: root/support
diff options
context:
space:
mode:
authorYann E. MORIN <yann.morin.1998@free.fr>2014-06-08 16:03:51 +0200
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>2014-06-08 16:43:27 +0200
commit47aeebd95619e41f2d6bcb4af72acf958b2b1ef4 (patch)
treef728bb2c0ebe7aed3e780b872467646f228b50d2 /support
parent4a2db6d19322b46968e63df06b562ec0cbaa2d0c (diff)
downloadbuildroot-47aeebd95619e41f2d6bcb4af72acf958b2b1ef4.tar.gz
buildroot-47aeebd95619e41f2d6bcb4af72acf958b2b1ef4.zip
graph-depends: rename the mode constants
This is ugly, since Python does not have enum constructs, so by moving the 'type' of the constant ('MODE' here) to the beginning, we get an artificial 'namespace' for the constants. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Cc: Maxime Hadjinlian <maxime.hadjinlian@gmail.com> Cc: Samuel Martin <s.martin49@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'support')
-rwxr-xr-xsupport/scripts/graph-depends20
1 files changed, 8 insertions, 12 deletions
diff --git a/support/scripts/graph-depends b/support/scripts/graph-depends
index 07b9c22444..42a42a8542 100755
--- a/support/scripts/graph-depends
+++ b/support/scripts/graph-depends
@@ -25,13 +25,9 @@ import sys
import subprocess
import argparse
-# In FULL_MODE, we draw the full dependency graph for all selected
-# packages
-FULL_MODE = 1
-
-# In PKG_MODE, we only draw the dependency graph for a given package
-PKG_MODE = 2
-
+# Modes of operation:
+MODE_FULL = 1 # draw full dependency graph for all selected packages
+MODE_PKG = 2 # draw dependency graph for a given package
mode = 0
# Limit drawing the dependency graph to this depth. 0 means 'no limit'.
@@ -58,9 +54,9 @@ parser.add_argument("--no-transitive", dest="transitive", action='store_false',
args = parser.parse_args()
if args.package is None:
- mode = FULL_MODE
+ mode = MODE_FULL
else:
- mode = PKG_MODE
+ mode = MODE_PKG
rootpkg = args.package
max_depth = args.depth
@@ -183,7 +179,7 @@ TARGET_EXCEPTIONS = [
# In full mode, start with the result of get_targets() to get the main
# targets and then use get_all_depends() for all targets
-if mode == FULL_MODE:
+if mode == MODE_FULL:
targets = get_targets()
dependencies = []
allpkgs.append('all')
@@ -201,7 +197,7 @@ if mode == FULL_MODE:
# In pkg mode, start directly with get_all_depends() on the requested
# package
-elif mode == PKG_MODE:
+elif mode == MODE_PKG:
dependencies = get_all_depends([rootpkg])
# Make the dependencies a dictionnary { 'pkg':[dep1, dep2, ...] }
@@ -269,7 +265,7 @@ def print_attrs(pkg):
label = 'ALL'
else:
label = pkg
- if pkg == 'all' or (mode == PKG_MODE and pkg == rootpkg):
+ if pkg == 'all' or (mode == MODE_PKG and pkg == rootpkg):
color = root_colour
else:
if pkg.startswith('host') \
OpenPOWER on IntegriCloud