Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCHv3 1/3] buildhistory: remove duplicate entries from dot graph
@ 2012-03-22 15:25 Koen Kooi
  2012-03-22 15:25 ` [PATCHv3 2/3] buildhistory: record all builds Koen Kooi
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Koen Kooi @ 2012-03-22 15:25 UTC (permalink / raw)
  To: openembedded-core; +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 <koen@dominion.thruhere.net>
---
 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 f99aa7f..764e1e8 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
-- 
1.7.2.5




^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCHv3 2/3] buildhistory: record all builds
  2012-03-22 15:25 [PATCHv3 1/3] buildhistory: remove duplicate entries from dot graph Koen Kooi
@ 2012-03-22 15:25 ` Koen Kooi
  2012-03-23 14:33   ` Paul Eggleton
  2012-03-22 15:25 ` [PATCHv3 3/3] buildhistory: make seperate commits for every changed top level entry in the buildhistory dir Koen Kooi
  2012-03-22 15:41 ` [PATCHv3 1/3] buildhistory: remove duplicate entries from dot graph Chris Larson
  2 siblings, 1 reply; 10+ messages in thread
From: Koen Kooi @ 2012-03-22 15:25 UTC (permalink / raw)
  To: openembedded-core; +Cc: Koen Kooi

When nothing has changed an empty commit prefixed with "No changes" will get generated

Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
---
 meta/classes/buildhistory.bbclass |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass
index 764e1e8..2305b50 100644
--- a/meta/classes/buildhistory.bbclass
+++ b/meta/classes/buildhistory.bbclass
@@ -408,6 +408,8 @@ buildhistory_commit() {
 			if [ "${BUILDHISTORY_PUSH_REPO}" != "" ] ; then
 				git push -q ${BUILDHISTORY_PUSH_REPO}
 			fi
+		else
+			git commit ${BUILDHISTORY_DIR}/ --allow-empty -m "No changes: Build ${BUILDNAME} of ${DISTRO} ${DISTRO_VERSION} for machine ${MACHINE} on $HOSTNAME" --author "${BUILDHISTORY_COMMIT_AUTHOR}" > /dev/null
 		fi) || true
 }
 
-- 
1.7.2.5




^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCHv3 3/3] buildhistory: make seperate commits for every changed top level entry in the buildhistory dir
  2012-03-22 15:25 [PATCHv3 1/3] buildhistory: remove duplicate entries from dot graph Koen Kooi
  2012-03-22 15:25 ` [PATCHv3 2/3] buildhistory: record all builds Koen Kooi
@ 2012-03-22 15:25 ` Koen Kooi
  2012-03-22 15:41 ` [PATCHv3 1/3] buildhistory: remove duplicate entries from dot graph Chris Larson
  2 siblings, 0 replies; 10+ messages in thread
From: Koen Kooi @ 2012-03-22 15:25 UTC (permalink / raw)
  To: openembedded-core; +Cc: Koen Kooi

This seperates out image changes from package changes making the image diffs a lot easier to read.

Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
---
 meta/classes/buildhistory.bbclass |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass
index 2305b50..fad51bc 100644
--- a/meta/classes/buildhistory.bbclass
+++ b/meta/classes/buildhistory.bbclass
@@ -404,7 +404,10 @@ buildhistory_commit() {
 		if [ "$repostatus" != "" ] ; then
 			git add ${BUILDHISTORY_DIR}/*
 			HOSTNAME=`hostname 2>/dev/null || echo unknown`
-			git commit ${BUILDHISTORY_DIR}/ -m "Build ${BUILDNAME} of ${DISTRO} ${DISTRO_VERSION} for machine ${MACHINE} on $HOSTNAME" --author "${BUILDHISTORY_COMMIT_AUTHOR}" > /dev/null
+			# porcelain output looks like "?? packages/foo/bar"
+			for entry in `echo $repostatus | awk '{print $2}' | awk -F/ '{print $1}' | sort | uniq` ; do
+				git commit ${BUILDHISTORY_DIR}/$entry -m "$entry: Build ${BUILDNAME} of ${DISTRO} ${DISTRO_VERSION} for machine ${MACHINE} on $HOSTNAME" --author "${BUILDHISTORY_COMMIT_AUTHOR}" > /dev/null
+			done
 			if [ "${BUILDHISTORY_PUSH_REPO}" != "" ] ; then
 				git push -q ${BUILDHISTORY_PUSH_REPO}
 			fi
-- 
1.7.2.5




^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCHv3 1/3] buildhistory: remove duplicate entries from dot graph
  2012-03-22 15:25 [PATCHv3 1/3] buildhistory: remove duplicate entries from dot graph Koen Kooi
  2012-03-22 15:25 ` [PATCHv3 2/3] buildhistory: record all builds Koen Kooi
  2012-03-22 15:25 ` [PATCHv3 3/3] buildhistory: make seperate commits for every changed top level entry in the buildhistory dir Koen Kooi
@ 2012-03-22 15:41 ` Chris Larson
  2 siblings, 0 replies; 10+ messages in thread
From: Chris Larson @ 2012-03-22 15:41 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer; +Cc: Koen Kooi

On Thu, Mar 22, 2012 at 8:25 AM, Koen Kooi <koen@dominion.thruhere.net> wrote:
> -               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

{
    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'
    done
    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'
    done
} | sort | uniq >> ${BUILDHISTORY_DIR_IMAGE}/depends.dot
-- 
Christopher Larson



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCHv3 2/3] buildhistory: record all builds
  2012-03-22 15:25 ` [PATCHv3 2/3] buildhistory: record all builds Koen Kooi
@ 2012-03-23 14:33   ` Paul Eggleton
  2012-03-23 14:46     ` Koen Kooi
  0 siblings, 1 reply; 10+ messages in thread
From: Paul Eggleton @ 2012-03-23 14:33 UTC (permalink / raw)
  To: Koen Kooi; +Cc: openembedded-core

On Thursday 22 March 2012 16:25:40 Koen Kooi wrote:
> When nothing has changed an empty commit prefixed with "No changes" will get
> generated

So I guess what's missing from this commit message is an explanation of why 
you want this.

Cheers,
Paul

-- 

Paul Eggleton
Intel Open Source Technology Centre



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCHv3 2/3] buildhistory: record all builds
  2012-03-23 14:33   ` Paul Eggleton
@ 2012-03-23 14:46     ` Koen Kooi
  2012-03-23 15:24       ` Paul Eggleton
  0 siblings, 1 reply; 10+ messages in thread
From: Koen Kooi @ 2012-03-23 14:46 UTC (permalink / raw)
  To: Paul Eggleton; +Cc: openembedded-core


Op 23 mrt. 2012, om 15:33 heeft Paul Eggleton het volgende geschreven:

> On Thursday 22 March 2012 16:25:40 Koen Kooi wrote:
>> When nothing has changed an empty commit prefixed with "No changes" will get
>> generated
> 
> So I guess what's missing from this commit message is an explanation of why 
> you want this.

Drat, I had assumed the commit title would be enough for that :)




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCHv3 2/3] buildhistory: record all builds
  2012-03-23 14:46     ` Koen Kooi
@ 2012-03-23 15:24       ` Paul Eggleton
  2012-03-23 15:48         ` Koen Kooi
  0 siblings, 1 reply; 10+ messages in thread
From: Paul Eggleton @ 2012-03-23 15:24 UTC (permalink / raw)
  To: Koen Kooi; +Cc: openembedded-core

On Friday 23 March 2012 15:46:23 Koen Kooi wrote:
> Op 23 mrt. 2012, om 15:33 heeft Paul Eggleton het volgende geschreven:
> > On Thursday 22 March 2012 16:25:40 Koen Kooi wrote:
> >> When nothing has changed an empty commit prefixed with "No changes" will
> >> get generated
> > 
> > So I guess what's missing from this commit message is an explanation of
> > why
> > you want this.
> 
> Drat, I had assumed the commit title would be enough for that :)

My personal opinion (probably backed up by the commit policy, I haven't 
refreshed my memory on it recently) is that commit messages should explain the 
reasoning behind a change and not just be a restatement of the change in 
human-readable form - although that is often useful in addition.

Cheers,
Paul

-- 

Paul Eggleton
Intel Open Source Technology Centre



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCHv3 2/3] buildhistory: record all builds
  2012-03-23 15:24       ` Paul Eggleton
@ 2012-03-23 15:48         ` Koen Kooi
  2012-03-23 15:53           ` Paul Eggleton
  0 siblings, 1 reply; 10+ messages in thread
From: Koen Kooi @ 2012-03-23 15:48 UTC (permalink / raw)
  To: Paul Eggleton; +Cc: openembedded-core


Op 23 mrt. 2012, om 16:24 heeft Paul Eggleton het volgende geschreven:

> On Friday 23 March 2012 15:46:23 Koen Kooi wrote:
>> Op 23 mrt. 2012, om 15:33 heeft Paul Eggleton het volgende geschreven:
>>> On Thursday 22 March 2012 16:25:40 Koen Kooi wrote:
>>>> When nothing has changed an empty commit prefixed with "No changes" will
>>>> get generated
>>> 
>>> So I guess what's missing from this commit message is an explanation of
>>> why
>>> you want this.
>> 
>> Drat, I had assumed the commit title would be enough for that :)
> 
> My personal opinion (probably backed up by the commit policy, I haven't 
> refreshed my memory on it recently) is that commit messages should explain the 
> reasoning behind a change and not just be a restatement of the change in 
> human-readable form - although that is often useful in addition.

I get that, but I'm having trouble coming up with something that isn't already covered but the "record all builds" statement :(

regards,

Koen


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCHv3 2/3] buildhistory: record all builds
  2012-03-23 15:48         ` Koen Kooi
@ 2012-03-23 15:53           ` Paul Eggleton
  2012-03-23 16:24             ` Koen Kooi
  0 siblings, 1 reply; 10+ messages in thread
From: Paul Eggleton @ 2012-03-23 15:53 UTC (permalink / raw)
  To: Koen Kooi; +Cc: openembedded-core

On Friday 23 March 2012 16:48:35 Koen Kooi wrote:
> I get that, but I'm having trouble coming up with something that isn't
> already covered but the "record all builds" statement :(

I know what you mean, but I think that just stating its "so that the commit 
log of the buildhistory repo provides a complete log of all builds performed, 
not just those that resulted in changes" would be sufficient.

Cheers,
Paul

-- 

Paul Eggleton
Intel Open Source Technology Centre



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCHv3 2/3] buildhistory: record all builds
  2012-03-23 15:53           ` Paul Eggleton
@ 2012-03-23 16:24             ` Koen Kooi
  0 siblings, 0 replies; 10+ messages in thread
From: Koen Kooi @ 2012-03-23 16:24 UTC (permalink / raw)
  To: Paul Eggleton; +Cc: openembedded-core


Op 23 mrt. 2012, om 16:53 heeft Paul Eggleton het volgende geschreven:

> On Friday 23 March 2012 16:48:35 Koen Kooi wrote:
>> I get that, but I'm having trouble coming up with something that isn't
>> already covered but the "record all builds" statement :(
> 
> I know what you mean, but I think that just stating its "so that the commit 
> log of the buildhistory repo provides a complete log of all builds performed, 
> not just those that resulted in changes" would be sufficient.

Added that, thanks!

I'll respin 3/3 with Chris' feedback as well.

regards,

Koen


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2012-03-23 16:33 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-22 15:25 [PATCHv3 1/3] buildhistory: remove duplicate entries from dot graph Koen Kooi
2012-03-22 15:25 ` [PATCHv3 2/3] buildhistory: record all builds Koen Kooi
2012-03-23 14:33   ` Paul Eggleton
2012-03-23 14:46     ` Koen Kooi
2012-03-23 15:24       ` Paul Eggleton
2012-03-23 15:48         ` Koen Kooi
2012-03-23 15:53           ` Paul Eggleton
2012-03-23 16:24             ` Koen Kooi
2012-03-22 15:25 ` [PATCHv3 3/3] buildhistory: make seperate commits for every changed top level entry in the buildhistory dir Koen Kooi
2012-03-22 15:41 ` [PATCHv3 1/3] buildhistory: remove duplicate entries from dot graph Chris Larson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox