From patchwork Tue Mar 20 13:38:54 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [RFC,v2,3/3] buildhistory: remove duplicate entries from dot graph Date: Tue, 20 Mar 2012 13:38:54 -0000 From: Koen Kooi X-Patchwork-Id: 23863 Message-Id: <1332250734-14660-3-git-send-email-koen@dominion.thruhere.net> To: openembedded-core@lists.openembedded.org Cc: Koen Kooi There are various conditions that lead to duplicate entries in the dot graph which need to get fixed, but this patch is a catchall. A previous attempt to address this only works on rpm which gives a \n seperated output, opkg doesn't. Another benefit is that the sort order is now know, leading to less spurious diffs in buildhistory commits. Signed-off-by: Koen Kooi --- Changes since v1: remove sort | uniq in the for loop, that only works with RPM meta/classes/buildhistory.bbclass | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-) diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass index 3aec325..49d1982 100644 --- a/meta/classes/buildhistory.bbclass +++ b/meta/classes/buildhistory.bbclass @@ -291,6 +291,7 @@ buildhistory_get_image_installed() { # Produce installed package file and size lists and dependency graph echo -n > ${BUILDHISTORY_DIR_IMAGE}/installed-packages.txt echo -n > ${BUILDHISTORY_DIR_IMAGE}/installed-package-sizes.tmp + echo -n > ${BUILDHISTORY_DIR_IMAGE}/depends.tmp echo -e "digraph depends {\n node [shape=plaintext]" > ${BUILDHISTORY_DIR_IMAGE}/depends.dot for pkg in $INSTALLED_PKGS; do pkgfile=`get_package_filename $pkg` @@ -300,16 +301,18 @@ buildhistory_get_image_installed() { echo $pkgsize $pkg >> ${BUILDHISTORY_DIR_IMAGE}/installed-package-sizes.tmp fi - deps=`list_package_depends $pkg | sort | uniq` + deps=`list_package_depends $pkg` for dep in $deps ; do - echo "$pkg OPP $dep;" | sed -e 's:-:_:g' -e 's:\.:_:g' -e 's:+::g' | sed 's:OPP:->:g' >> ${BUILDHISTORY_DIR_IMAGE}/depends.dot + echo "$pkg OPP $dep;" | sed -e 's:-:_:g' -e 's:\.:_:g' -e 's:+::g' | sed 's:OPP:->:g' >> ${BUILDHISTORY_DIR_IMAGE}/depends.tmp done - recs=`list_package_recommends $pkg | sort | uniq` + recs=`list_package_recommends $pkg` for rec in $recs ; do - echo "$pkg OPP $rec [style=dotted];" | sed -e 's:-:_:g' -e 's:\.:_:g' -e 's:+::g' | sed 's:OPP:->:g' >> ${BUILDHISTORY_DIR_IMAGE}/depends.dot + echo "$pkg OPP $rec [style=dotted];" | sed -e 's:-:_:g' -e 's:\.:_:g' -e 's:+::g' | sed 's:OPP:->:g' >> ${BUILDHISTORY_DIR_IMAGE}/depends.tmp done done + cat ${BUILDHISTORY_DIR_IMAGE}/depends.tmp | sort | uniq >> ${BUILDHISTORY_DIR_IMAGE}/depends.dot + rm ${BUILDHISTORY_DIR_IMAGE}/depends.tmp echo "}" >> ${BUILDHISTORY_DIR_IMAGE}/depends.dot cat ${BUILDHISTORY_DIR_IMAGE}/installed-package-sizes.tmp | sort -n -r | awk '{print $1 "\tKiB " $2}' > ${BUILDHISTORY_DIR_IMAGE}/installed-package-sizes.txt