Skip to contentSkip to conversation

support/graph-depends: fix package names starting with a non-char

PATCH New Yann E. MORIN 3 participants 3 messages Nov 24, 2018 – Nov 26, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 support/graph-depends: fix package names starting with a non-char

Graphviz' dot utility does not like nodes which names does not start with an ^[[:alpha:]], i.e. 18xx-ti-utils would cause grievance:

Warning: syntax ambiguity - badly delimited number '18x' in line 4 [...]/graph-depends.dot splits into two tokens
Warning: syntax ambiguity - badly delimited number '18x' in line 5 [...]/graph-depends.dot splits into two tokens
Warning: syntax ambiguity - badly delimited number '18x' in line 6 [...]/graph-depends.dot splits into two tokens
Warning: syntax ambiguity - badly delimited number '18x' in line 7 [...]/graph-depends.dot splits into two tokens

Prefix nodes with an underscore to fix that.

Cc Thomas Petazzoni <[email protected]>
---
 support/scripts/graph-depends | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
support/scripts/graph-depends +3 -2
index 621e603278..3c091da5e0 100755
@@ -94,9 +94,10 @@ def get_all_depends(pkgs, get_depends_func):
 
 
 # The Graphviz "dot" utility doesn't like dashes in node names. So for
-# node names, we strip all dashes.
+# node names, we strip all dashes. Also, nodes can't start with a number,
+# so we prepend an underscore.
 def pkg_node_name(pkg):
-    return pkg.replace("-", "")
+    return "_" + pkg.replace("-", "")
 
 
 TARGET_EXCEPTIONS = [
Signature · 1 line
2.14.1
#1 lore raw

PATCH 1/1 support/graph-depends: fix package names starting with a non-char

Hello,

Quoted 8 lines · Yann E. MORIN

Graphviz' dot utility does not like nodes which names does not start with an ^[[:alpha:]], i.e. 18xx-ti-utils would cause grievance:

Warning: syntax ambiguity - badly delimited number '18x' in line 4 [...]/graph-depends.dot splits into two tokens
Warning: syntax ambiguity - badly delimited number '18x' in line 5 [...]/graph-depends.dot splits into two tokens
Warning: syntax ambiguity - badly delimited number '18x' in line 6 [...]/graph-depends.dot splits into two tokens
Warning: syntax ambiguity - badly delimited number '18x' in line 7 [...]/graph-depends.dot splits into two tokens

Quoted 7 lines

Prefix nodes with an underscore to fix that.

Cc Thomas Petazzoni <[email protected]>
---
 support/scripts/graph-depends | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Applied to master after changing "non-char" to "non-alpha" in the commit title. Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#2 lore raw

PATCH 1/1 support/graph-depends: fix package names starting with a non-char

In reply to Yann E. MORIN
Quoted 10 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Yann" == Yann E MORIN <[email protected]> writes:

Graphviz' dot utility does not like nodes which names does not start with an ^[[:alpha:]], i.e. 18xx-ti-utils would cause grievance:

Warning: syntax ambiguity - badly delimited number '18x' in line 4 [...]/graph-depends.dot splits into two tokens
Warning: syntax ambiguity - badly delimited number '18x' in line 5 [...]/graph-depends.dot splits into two tokens
Warning: syntax ambiguity - badly delimited number '18x' in line 6 [...]/graph-depends.dot splits into two tokens
Warning: syntax ambiguity - badly delimited number '18x' in line 7 [...]/graph-depends.dot splits into two tokens

Quoted 4 lines

Prefix nodes with an underscore to fix that.

Cc Thomas Petazzoni <[email protected]>

Committed to 2018.02.x and 2018.08.x, thanks.

Signature · 1 line
Bye, Peter Korsgaard