org.openmoko.zecke.april-update: d3d7ab3edec9ca8ebe1ce14f808db3cc4005a00c

oe at monotone.openmoko.org oe at monotone.openmoko.org
Tue Apr 29 11:32:31 CEST 2008


revision:            d3d7ab3edec9ca8ebe1ce14f808db3cc4005a00c
date:                2008-04-26T14:13:51
author:              freyther at openembedded.org
branch:              org.openmoko.zecke.april-update
changelog:
base.bbclass: Begin to generate PREFERRED_VERSION, SRCREV, SRCDATE to lock down
    A call to bitbake -clockdown my-image will generate three files, one with
    SRCDATE entries, one with SRCREV and one with the PREFERRED_VERSION. This
    requires support from Bitbake to yield a better result. It is a start
    though.

manifest:
format_version "1"

new_manifest [29034f64e1e314c391c139baca54994314035303]

old_revision [24467385bd33bb1f557c5902bf1bd3c570bfaf81]

patch "classes/base.bbclass"
 from [a459170ff0695f560caefdf45ec3c44a2c5b8b2a]
   to [cd60397772e252868dc7d3f64e52c62e9cc35a54]
-------------- next part --------------
#
#
# patch "classes/base.bbclass"
#  from [a459170ff0695f560caefdf45ec3c44a2c5b8b2a]
#    to [cd60397772e252868dc7d3f64e52c62e9cc35a54]
#
============================================================
--- classes/base.bbclass	a459170ff0695f560caefdf45ec3c44a2c5b8b2a
+++ classes/base.bbclass	cd60397772e252868dc7d3f64e52c62e9cc35a54
@@ -426,6 +426,48 @@ oe_machinstall() {
 	fi
 }
 
+
+addtask show_versions
+do_show_versions[nostamp] = "1"
+python do_show_versions() {
+	import sys
+
+	localdata = bb.data.createCopy(d)
+	bb.data.update_data(localdata)
+
+	src_uri = bb.data.getVar('SRC_URI', localdata, 1)
+	if not src_uri:
+		return 1
+
+	try:
+		bb.fetch.init(src_uri.split(),d)
+	except bb.fetch.NoMethodError:
+		(type, value, traceback) = sys.exc_info()
+		raise bb.build.FuncFailed("No method: %s" % value)
+
+
+	src_uri = bb.data.getVar("SRC_URI", d, False)
+	pn = bb.data.getVar("PN", d, True)
+	src_revs = open("%s/src_revs.inc" % bb.data.getVar("TMPDIR", d, 1), "a")
+	src_dates = open("%s/src_dates.inc" % bb.data.getVar("TMPDIR", d, 1), "a")
+	pref_versions = open("%s/preferred_versions.inc" % bb.data.getVar("TMPDIR", d, 1), "a")
+	if "SRCREV" in bb.data.getVar("PV", d, False):
+		print >> src_revs, 'SRCREV_pn-%(pn)s ?= "%(rev)s"' % { 'pn' : pn, 'rev' : bb.data.getVar("SRCREV", d, True) }
+	elif "cvs://" in src_uri or "svn://" in src_uri or "git://" in src_uri:
+		print >> src_dates, 'SRCDATE_pn-%(pn)s ?= "%(date)s"' % { 'pn' : pn, 'date' : bb.data.getVar("SRCDATE", d, True) }
+
+	print >> pref_versions, 'PREFERRED_VERSION_%(pn)s = "%(version)s"' % { "pn" : pn, 'version' : bb.data.getVar("PV", d, False) }
+	src_revs.close()
+	src_dates.close()
+	pref_versions.close()
+}
+
+addtask lockdown
+do_lockdown[nostamp] = "1"
+do_lockdown[recrdeptask] = "do_show_versions"
+python do_lockdown() {
+}
+
 addtask listtasks
 do_listtasks[nostamp] = "1"
 python do_listtasks() {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.openmoko.org/pipermail/commitlog/attachments/20080429/6be2adf6/attachment.htm 


More information about the commitlog mailing list