Skip to contentSkip to conversation

Error message fixes / cleanup

PATCH Applied Paul Eggleton 2 participants 6 messages Jan 13, 2012 – Jan 17, 2012

lore
Share & tools
lore
#0 lore raw

cover Error message fixes / cleanup

A trio of of minor improvements to error messages as well as the removal of packagehistory.bbclass.

The following changes since commit bd047935305c872b565f30b46c94b7077e5fb3a2:

patch.bbclass: Ensure the DATE and SRCDATE variable exclusions apply to the correct function (2012-01-13 16:56:20 +0000)

are available in the git repository at:
git://git.openembedded.org/openembedded-core-contrib paule/fixes10
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=paule/fixes10

Paul Eggleton (4):
classes/base: note variable name in COMPATIBLE_* skip messages conf/bitbake.conf: allow wget to output error messages classes/package: remove out-of-date notice referring to the OE
bugtracker
classes/packagehistory: remove now obsolete class

 meta/classes/base.bbclass           |    4 +-
 meta/classes/package.bbclass        |    3 -
 meta/classes/packagehistory.bbclass |  249 -----------------------------------
 meta/conf/bitbake.conf              |    6 +-
 4 files changed, 5 insertions(+), 257 deletions(-)
 delete mode 100644 meta/classes/packagehistory.bbclass
Signature · 1 line
1.7.5.4
#1 lore raw

PATCH 1/4 classes/base: note variable name in COMPATIBLE_* skip messages

When raising SkipPackage for COMPATIBLE_MACHINE and COMPATIBLE_HOST exceptions, include the name of the variable as a hint to the user.

---
 meta/classes/base.bbclass |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
meta/classes/base.bbclass +2 -2
index f0c358e..091e965 100644
@@ -379,7 +379,7 @@ python () {
             import re
             this_host = d.getVar('HOST_SYS', 1)
             if not re.match(need_host, this_host):
-                raise bb.parse.SkipPackage("incompatible with host %s" % this_host)
+                raise bb.parse.SkipPackage("incompatible with host %s (not in COMPATIBLE_HOST)" % this_host)
 
         need_machine = d.getVar('COMPATIBLE_MACHINE', 1)
         if need_machine:
@@ -388,7 +388,7 @@ python () {
             if this_machine and not re.match(need_machine, this_machine):
                 this_soc_family = d.getVar('SOC_FAMILY', 1)
                 if (this_soc_family and not re.match(need_machine, this_soc_family)) or not this_soc_family:
-                    raise bb.parse.SkipPackage("incompatible with machine %s" % this_machine)
+                    raise bb.parse.SkipPackage("incompatible with machine %s (not in COMPATIBLE_MACHINE)" % this_machine)
 
 
         dont_want_license = d.getVar('INCOMPATIBLE_LICENSE', 1)
Signature · 1 line
1.7.5.4
#2 lore raw

PATCH 2/4 conf/bitbake.conf: allow wget to output error messages

In reply to Paul Eggleton

Use the -nv instead of -q command line option for wget so that if fetching from a URL that the wget fetcher handles (e.g. http) fails, we get a possibly useful error message (but it still remains relatively quiet when the fetch succeeds.)

---
 meta/conf/bitbake.conf |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
meta/conf/bitbake.conf +3 -3
index 43eedad..d047338 100644
@@ -556,17 +556,17 @@ XORG_MIRROR = "http://xorg.freedesktop.org/releases"
 
 FETCHCMD_svn = "/usr/bin/env svn"
 FETCHCMD_cvs = "/usr/bin/env cvs"
-FETCHCMD_wget = "/usr/bin/env wget -t 5 -q --no-check-certificate"
+FETCHCMD_wget = "/usr/bin/env wget -t 5 -nv --no-check-certificate"
 FETCHCMD_bzr = "/usr/bin/env bzr"
 FETCHCMD_hg = "/usr/bin/env hg"
 
 FETCHCOMMAND = "ERROR, this must be a BitBake bug"
-FETCHCOMMAND_wget = "/usr/bin/env wget -t 5 -q --passive-ftp --no-check-certificate -P ${DL_DIR} '${URI}'"
+FETCHCOMMAND_wget = "/usr/bin/env wget -t 5 -nv --passive-ftp --no-check-certificate -P ${DL_DIR} '${URI}'"
 FETCHCOMMAND_cvs = "/usr/bin/env cvs '-d${CVSROOT}' co ${CVSCOOPTS} ${CVSMODULE}"
 FETCHCOMMAND_svn = "/usr/bin/env svn co ${SVNCOOPTS} ${SVNROOT} ${SVNMODULE}"
 CHECKCOMMAND_wget = "/usr/bin/env wget --spider -t 5 --passive-ftp --no-check-certificate -P ${DL_DIR} '${URI}'"
 RESUMECOMMAND = "ERROR, this must be a BitBake bug"
-RESUMECOMMAND_wget = "/usr/bin/env wget -c -t 5 -q --passive-ftp --no-check-certificate -P ${DL_DIR} '${URI}'"
+RESUMECOMMAND_wget = "/usr/bin/env wget -c -t 5 -nv --passive-ftp --no-check-certificate -P ${DL_DIR} '${URI}'"
 UPDATECOMMAND = "ERROR, this must be a BitBake bug"
 UPDATECOMMAND_cvs = "/usr/bin/env cvs -d${CVSROOT} update -d -P ${CVSCOOPTS}"
 UPDATECOMMAND_svn = "/usr/bin/env svn update ${SVNCOOPTS}"
Signature · 1 line
1.7.5.4
#3 lore raw

PATCH 3/4 classes/package: remove out-of-date notice referring to the OE bugtracker

In reply to Paul Eggleton

OpenEmbedded doesn't officially use a bug tracker anymore, and a message asking the user to fix the metadata could be applied to almost any error that occurs, so just remove the whole message.

---
 meta/classes/package.bbclass |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)
meta/classes/package.bbclass +0 -3
index f8f0a12..f06bf92 100644
@@ -887,10 +887,7 @@ python populate_packages () {
 	package_list = []
 	for pkg in packages.split():
 		if pkg in package_list:
-			bb.error("-------------------")
 			bb.error("%s is listed in PACKAGES multiple times, this leads to packaging errors." % pkg)
-			bb.error("Please fix the metadata/report this as bug to OE bugtracker.")
-			bb.error("-------------------")
 		else:
 			package_list.append(pkg)
 
Signature · 1 line
1.7.5.4
#4 lore raw

PATCH 4/4 classes/packagehistory: remove now obsolete class

In reply to Paul Eggleton

packagehistory.bbclass has been superseded by buildhistory.bbclass, which gives more detailed output (including information on produced images) as well as other enhanced functionality.

---
 meta/classes/packagehistory.bbclass |  249 -----------------------------------
 1 files changed, 0 insertions(+), 249 deletions(-)
 delete mode 100644 meta/classes/packagehistory.bbclass
meta/classes/packagehistory.bbclass deleted +0 -249
deleted file mode 100644
index 5a1c846..0000000
@@ -1,249 +0,0 @@
-# Must inherit package first before changing PACKAGEFUNCS
-inherit package
-PACKAGEFUNCS += "emit_pkghistory"
-
-PKGHIST_DIR = "${TMPDIR}/pkghistory/${MULTIMACH_TARGET_SYS}/"
-
-#
-# Called during do_package to write out metadata about this package
-# for comparision when writing future packages
-#
-python emit_pkghistory() {
-	import re
-
-	pkghistdir = os.path.join(d.getVar('PKGHIST_DIR', True), d.getVar('PN', True))
-
-	class RecipeInfo:
-		def __init__(self, name):
-			self.name = name
-			self.pe = "0"
-			self.pv = "0"
-			self.pr = "r0"
-			self.depends = ""
-			self.packages = ""
-
-	class PackageInfo:
-		def __init__(self, name):
-			self.name = name
-			self.pe = "0"
-			self.pv = "0"
-			self.pr = "r0"
-			self.size = 0
-			self.depends = ""
-			self.rdepends = ""
-			self.rrecommends = ""
-			self.files = ""
-			self.filelist = ""
-
-	# Should check PACKAGES here to see if anything removed
-
-	def getpkgvar(pkg, var):
-		val = d.getVar('%s_%s' % (var, pkg), True)
-		if val:
-			return val
-		val = d.getVar(var, True)
-
-		return val
-
-	def readRecipeInfo(pn, histfile):
-		rcpinfo = RecipeInfo(pn)
-		f = open(histfile, "r")
-		try:
-			for line in f:
-				lns = line.split('=')
-				name = lns[0].strip()
-				value = lns[1].strip(" \t\r\n").strip('"')
-				if name == "PE":
-					rcpinfo.pe = value
-				elif name == "PV":
-					rcpinfo.pv = value
-				elif name == "PR":
-					rcpinfo.pr = value
-				elif name == "DEPENDS":
-					rcpinfo.depends = value
-				elif name == "PACKAGES":
-					rcpinfo.packages = value
-		finally:
-			f.close()
-		return rcpinfo
-
-	def readPackageInfo(pkg, histfile):
-		pkginfo = PackageInfo(pkg)
-		f = open(histfile, "r")
-		try:
-			for line in f:
-				lns = line.split('=')
-				name = lns[0].strip()
-				value = lns[1].strip(" \t\r\n").strip('"')
-				if name == "PE":
-					pkginfo.pe = value
-				elif name == "PV":
-					pkginfo.pv = value
-				elif name == "PR":
-					pkginfo.pr = value
-				elif name == "RDEPENDS":
-					pkginfo.rdepends = value
-				elif name == "RRECOMMENDS":
-					pkginfo.rrecommends = value
-				elif name == "PKGSIZE":
-					pkginfo.size = long(value)
-				elif name == "FILES":
-					pkginfo.files = value
-				elif name == "FILELIST":
-					pkginfo.filelist = value
-		finally:
-			f.close()
-		return pkginfo
-
-	def getlastrecipeversion(pn):
-		try:
-			histfile = os.path.join(pkghistdir, "latest")
-			return readRecipeInfo(pn, histfile)
-		except EnvironmentError:
-			return None
-
-	def getlastpkgversion(pkg):
-		try:
-			histfile = os.path.join(pkghistdir, pkg, "latest")
-			return readPackageInfo(pkg, histfile)
-		except EnvironmentError:
-			return None
-
-	def squashspaces(string):
-		return re.sub("\s+", " ", string)
-
-	pn = d.getVar('PN', True)
-	pe = d.getVar('PE', True) or "0"
-	pv = d.getVar('PV', True)
-	pr = d.getVar('PR', True)
-	packages = squashspaces(d.getVar('PACKAGES', True))
-
-	rcpinfo = RecipeInfo(pn)
-	rcpinfo.pe = pe
-	rcpinfo.pv = pv
-	rcpinfo.pr = pr
-	rcpinfo.depends = squashspaces(d.getVar('DEPENDS', True) or "")
-	rcpinfo.packages = packages
-	write_recipehistory(rcpinfo, d)
-	write_latestlink(None, pe, pv, pr, d)
-
-	# Apparently the version can be different on a per-package basis (see Python)
-	pkgdest = d.getVar('PKGDEST', True)
-	for pkg in packages.split():
-		pe = getpkgvar(pkg, 'PE') or "0"
-		pv = getpkgvar(pkg, 'PV')
-		pr = getpkgvar(pkg, 'PR')
-		#
-		# Find out what the last version was
-		# Make sure the version did not decrease
-		#
-		lastversion = getlastpkgversion(pkg)
-		if lastversion:
-			last_pe = lastversion.pe
-			last_pv = lastversion.pv
-			last_pr = lastversion.pr
-			r = bb.utils.vercmp((pe, pv, pr), (last_pe, last_pv, last_pr))
-			if r < 0:
-				bb.fatal("Package version for package %s went backwards which would break package feeds from (%s:%s-%s to %s:%s-%s)" % (pkg, last_pe, last_pv, last_pr, pe, pv, pr))
-
-		pkginfo = PackageInfo(pkg)
-		pkginfo.pe = pe
-		pkginfo.pv = pv
-		pkginfo.pr = pr
-		pkginfo.rdepends = squashspaces(getpkgvar(pkg, 'RDEPENDS') or "")
-		pkginfo.rrecommends = squashspaces(getpkgvar(pkg, 'RRECOMMENDS') or "")
-		pkginfo.files = squashspaces(getpkgvar(pkg, 'FILES') or "")
-
-		# Gather information about packaged files
-		pkgdestpkg = os.path.join(pkgdest, pkg)
-		filelist = []
-		pkginfo.size = 0
-		for root, dirs, files in os.walk(pkgdestpkg):
-			relpth = os.path.relpath(root, pkgdestpkg)
-			for f in files:
-				fstat = os.lstat(os.path.join(root, f))
-				pkginfo.size += fstat.st_size
-				filelist.append(os.sep + os.path.join(relpth, f))
-		pkginfo.filelist = " ".join(filelist)
-
-		write_pkghistory(pkginfo, d)
-
-		if lastversion:
-			check_pkghistory(pkginfo, lastversion)
-
-		write_latestlink(pkg, pe, pv, pr, d)
-}
-
-
-def check_pkghistory(pkginfo, lastversion):
-
-	bb.debug(2, "Checking package history")
-	# RDEPENDS removed?
-	# PKG changed?
-	# Each file list of each package for file removals?
-
-
-def write_recipehistory(rcpinfo, d):
-	bb.debug(2, "Writing recipe history")
-
-	pkghistdir = os.path.join(d.getVar('PKGHIST_DIR', True), d.getVar('PN', True))
-
-	if not os.path.exists(pkghistdir):
-		os.makedirs(pkghistdir)
-
-	verfile = os.path.join(pkghistdir, "%s:%s-%s" % (rcpinfo.pe, rcpinfo.pv, rcpinfo.pr))
-	f = open(verfile, "w")
-	try:
-		if rcpinfo.pe != "0":
-			f.write("PE = %s\n" %  rcpinfo.pe)
-		f.write("PV = %s\n" %  rcpinfo.pv)
-		f.write("PR = %s\n" %  rcpinfo.pr)
-		f.write("DEPENDS = %s\n" %  rcpinfo.depends)
-		f.write("PACKAGES = %s\n" %  rcpinfo.packages)
-	finally:
-		f.close()
-
-
-def write_pkghistory(pkginfo, d):
-	bb.debug(2, "Writing package history")
-
-	pkghistdir = os.path.join(d.getVar('PKGHIST_DIR', True), d.getVar('PN', True))
-
-	verpath = os.path.join(pkghistdir, pkginfo.name)
-	if not os.path.exists(verpath):
-		os.makedirs(verpath)
-
-	verfile = os.path.join(verpath, "%s:%s-%s" % (pkginfo.pe, pkginfo.pv, pkginfo.pr))
-	f = open(verfile, "w")
-	try:
-		if pkginfo.pe != "0":
-			f.write("PE = %s\n" %  pkginfo.pe)
-		f.write("PV = %s\n" %  pkginfo.pv)
-		f.write("PR = %s\n" %  pkginfo.pr)
-		f.write("RDEPENDS = %s\n" %  pkginfo.rdepends)
-		f.write("RRECOMMENDS = %s\n" %  pkginfo.rrecommends)
-		f.write("PKGSIZE = %d\n" %  pkginfo.size)
-		f.write("FILES = %s\n" %  pkginfo.files)
-		f.write("FILELIST = %s\n" %  pkginfo.filelist)
-	finally:
-		f.close()
-
-
-def write_latestlink(pkg, pe, pv, pr, d):
-	import shutil
-
-	pkghistdir = os.path.join(d.getVar('PKGHIST_DIR', True), d.getVar('PN', True))
-
-	def rm_link(path):
-		try: 
-			os.unlink(path)
-		except OSError:
-			return
-
-	if pkg:
-		filedir = os.path.join(pkghistdir, pkg)
-	else:
-		filedir = pkghistdir
-	rm_link(os.path.join(filedir, "latest"))
-	shutil.copy(os.path.join(filedir, "%s:%s-%s" % (pe, pv, pr)), os.path.join(filedir, "latest"))
-
Signature · 1 line
1.7.5.4
Applied
#5 lore raw
In reply to Paul Eggleton
Quoted 18 lines · Paul Eggleton

A trio of of minor improvements to error messages as well as the removal of packagehistory.bbclass.

The following changes since commit bd047935305c872b565f30b46c94b7077e5fb3a2:

patch.bbclass: Ensure the DATE and SRCDATE variable exclusions apply to the correct function (2012-01-13 16:56:20 +0000)

are available in the git repository at:
git://git.openembedded.org/openembedded-core-contrib paule/fixes10
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=paule/fixes10

Paul Eggleton (4):
classes/base: note variable name in COMPATIBLE_* skip messages conf/bitbake.conf: allow wget to output error messages classes/package: remove out-of-date notice referring to the OE
bugtracker
classes/packagehistory: remove now obsolete class

Quoted 7 lines
  meta/classes/base.bbclass           |    4 +-
  meta/classes/package.bbclass        |    3 -
  meta/classes/packagehistory.bbclass |  249 -----------------------------------
  meta/conf/bitbake.conf              |    6 +-
  4 files changed, 5 insertions(+), 257 deletions(-)

delete mode 100644 meta/classes/packagehistory.bbclass

Merged into OE-Core

Thanks
Sau!