aboutsummaryrefslogtreecommitdiffstats
path: root/meta/classes/buildhistory.bbclass
diff options
context:
space:
mode:
authorPeter Kjellerstedt <peter.kjellerstedt@axis.com>2017-06-09 21:34:27 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-06-12 15:17:50 +0100
commit37ea2c8b299483f0e12fad66efa789c6445571e0 (patch)
tree16374817138a13fb52074e0f336336871e2af81f /meta/classes/buildhistory.bbclass
parent2cbeb6edbfcbd9378a5a79b17f7d31a49e0356ff (diff)
downloadopenembedded-core-contrib-37ea2c8b299483f0e12fad66efa789c6445571e0.tar.gz
openembedded-core-contrib-37ea2c8b299483f0e12fad66efa789c6445571e0.tar.bz2
openembedded-core-contrib-37ea2c8b299483f0e12fad66efa789c6445571e0.zip
buildhistory.bbclass: Improve the generated depends.dot file
* Convert incorrectly formatted dependencies such as: "bar -> "foo" ">=" "1.2.3" into dependencies with edge labels: "bar -> "foo" [label=">= 1.2.3"] * Remove rpmlib() and config() dependencies such as: "foo" -> "rpmlib(CompressedFileNames)" [label="<= 3.0.4-1"] and: "base-files" -> "config(base-files)" [label="= 3.0.14-r89.49"] * Remove the trailing semicolon that was added to each line. It fills no purpose. Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/buildhistory.bbclass')
-rw-r--r--meta/classes/buildhistory.bbclass15
1 files changed, 11 insertions, 4 deletions
diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass
index 64cd31ae2b..c26dffc058 100644
--- a/meta/classes/buildhistory.bbclass
+++ b/meta/classes/buildhistory.bbclass
@@ -435,13 +435,20 @@ buildhistory_get_installed() {
# Produce dependency graph
# First, quote each name to handle characters that cause issues for dot
- sed 's:\([^| ]*\):"\1":g' ${WORKDIR}/bh_installed_pkgs_deps.txt > $1/depends.tmp && \
+ sed 's:\([^| ]*\):"\1":g' ${WORKDIR}/bh_installed_pkgs_deps.txt > $1/depends.tmp &&
rm ${WORKDIR}/bh_installed_pkgs_deps.txt
- # Change delimiter from pipe to -> and set style for recommend lines
- sed -i -e 's:|: -> :' -e 's:"\[REC\]":[style=dotted]:' -e 's:$:;:' $1/depends.tmp
+ # Remove lines with rpmlib(...) and config(...) dependencies, change the
+ # delimiter from pipe to "->", set the style for recommend lines and
+ # turn versioned dependencies into edge labels.
+ sed -i -e '/rpmlib(/d' \
+ -e '/config(/d' \
+ -e 's:|: -> :' \
+ -e 's:"\[REC\]":[style=dotted]:' \
+ -e 's:"\([<>=]\+\)" "\([^"]*\)":[label="\1 \2"]:' \
+ $1/depends.tmp
# Add header, sorted and de-duped contents and footer and then delete the temp file
printf "digraph depends {\n node [shape=plaintext]\n" > $1/depends.dot
- cat $1/depends.tmp | sort | uniq >> $1/depends.dot
+ cat $1/depends.tmp | sort -u >> $1/depends.dot
echo "}" >> $1/depends.dot
rm $1/depends.tmp