[oe-commits] org.oe.dev package_ipk.bbclass, sanity.conf: attemp to be compatible with bitbake 1.8.8 again

koen commit openembedded-commits at lists.openembedded.org
Fri Dec 7 16:56:59 UTC 2007


package_ipk.bbclass, sanity.conf: attemp to be compatible with bitbake 1.8.8 again

Author: koen at openembedded.org
Branch: org.openembedded.dev
Revision: b0dc261f9674aecabb4a43c73a328aaba4ec338a
ViewMTN: http://monotone.openembedded.org/revision/info/b0dc261f9674aecabb4a43c73a328aaba4ec338a
Files:
1
classes/package_ipk.bbclass
conf/sanity.conf
Diffs:

#
# mt diff -r9ac713756803b1db168d50fa2fc2999f3768b021 -rb0dc261f9674aecabb4a43c73a328aaba4ec338a
#
# 
# 
# patch "classes/package_ipk.bbclass"
#  from [fdf9fdf2855198b24b017026dd3777995b2977d2]
#    to [229c27cf2e464faca3930ca8626c1a6fdf5b51be]
# 
# patch "conf/sanity.conf"
#  from [0ca4f223707a3e2792c4eb0b4ab4ada4461ee385]
#    to [9ad5f1d9953217df59e03a3c6727b8246f383334]
# 
============================================================
--- classes/package_ipk.bbclass	fdf9fdf2855198b24b017026dd3777995b2977d2
+++ classes/package_ipk.bbclass	229c27cf2e464faca3930ca8626c1a6fdf5b51be
@@ -114,7 +114,7 @@ python do_package_ipk () {
 }
 
 python do_package_ipk () {
-	import sys, re, copy
+	import sys, re, copy, fcntl
 
 	workdir = bb.data.getVar('WORKDIR', d, 1)
 	if not workdir:
@@ -147,6 +147,16 @@ python do_package_ipk () {
 		bb.debug(1, "No packages; nothing to do")
 		return
 
+	def lockfile(name):
+		lf = open(name, "a+")
+		fcntl.flock(lf.fileno(), fcntl.LOCK_EX)
+		return lf
+
+	def unlockfile(lf):
+		fcntl.flock(lf.fileno(), fcntl.LOCK_UN)
+		lf.close
+
+
 	for pkg in packages.split():
 		localdata = bb.data.createCopy(d)
 		pkgdest = bb.data.getVar('PKGDEST', d, 1)
@@ -183,7 +193,7 @@ python do_package_ipk () {
 		if not g and bb.data.getVar('ALLOW_EMPTY', localdata) != "1":
 			from bb import note
 			note("Not creating empty archive for %s-%s-%s" % (pkg, bb.data.getVar('PV', localdata, 1), bb.data.getVar('PR', localdata, 1)))
-			bb.utils.unlockfile(lf)
+			unlockfile(lf)
 			continue
 
 		controldir = os.path.join(root, 'CONTROL')
@@ -191,7 +201,7 @@ python do_package_ipk () {
 		try:
 			ctrlfile = file(os.path.join(controldir, 'control'), 'w')
 		except OSError:
-			bb.utils.unlockfile(lf)
+			unlockfile(lf)
 			raise bb.build.FuncFailed("unable to open control file for writing.")
 
 		fields = []
@@ -225,7 +235,7 @@ python do_package_ipk () {
 		except KeyError:
 			(type, value, traceback) = sys.exc_info()
 			ctrlfile.close()
-			bb.utils.unlockfile(lf)
+			unlockfile(lf)
 			raise bb.build.FuncFailed("Missing field for ipk generation: %s" % value)
 		# more fields
 
@@ -262,7 +272,7 @@ python do_package_ipk () {
 			try:
 				scriptfile = file(os.path.join(controldir, script), 'w')
 			except OSError:
-				bb.utils.unlockfile(lf)
+				unlockfile(lf)
 				raise bb.build.FuncFailed("unable to open %s script file for writing." % script)
 			scriptfile.write(scriptvar)
 			scriptfile.close()
@@ -273,7 +283,7 @@ python do_package_ipk () {
 			try:
 				conffiles = file(os.path.join(controldir, 'conffiles'), 'w')
 			except OSError:
-				bb.utils.unlockfile(lf)
+				unlockfile(lf)
 				raise bb.build.FuncFailed("unable to open conffiles for writing.")
 			for f in conffiles_str.split():
 				conffiles.write('%s\n' % f)
@@ -283,7 +293,7 @@ python do_package_ipk () {
 		ret = os.system("PATH=\"%s\" %s %s %s" % (bb.data.getVar("PATH", localdata, 1), 
                                                           bb.data.getVar("IPKGBUILDCMD",d,1), pkg, pkgoutdir))
 		if ret != 0:
-			bb.utils.unlockfile(lf)
+			unlockfile(lf)
 			raise bb.build.FuncFailed("ipkg-build execution failed")
 
 		for script in ["preinst", "postinst", "prerm", "postrm", "control" ]:
@@ -296,7 +306,7 @@ python do_package_ipk () {
 			os.rmdir(controldir)
 		except OSError:
 			pass
-		bb.utils.unlockfile(lf)
+		unlockfile(lf)
 }
 
 python () {
============================================================
--- conf/sanity.conf	0ca4f223707a3e2792c4eb0b4ab4ada4461ee385
+++ conf/sanity.conf	9ad5f1d9953217df59e03a3c6727b8246f383334
@@ -1,8 +1,8 @@
 # Sanity checks for common user misconfigurations
 #
 # See sanity.bbclass
 #
 # Expert users can confirm their sanity with "touch conf/sanity.conf"
-BB_MIN_VERSION = "1.8.9"
+BB_MIN_VERSION = "1.8.8"
 INHERIT += "sanity"
 






More information about the Openembedded-commits mailing list