summaryrefslogtreecommitdiff
path: root/meta/classes/package_rpm.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2013-05-09 17:05:58 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-05-09 22:25:31 +0100
commita43e0a8ecd0441131e929daf998c3cd454d9c8f3 (patch)
tree69be538a129e3f9e985aa65d07005bf067371aa5 /meta/classes/package_rpm.bbclass
parent4808629faa1222b31f92a3e410e06adb8e081293 (diff)
downloadopenembedded-core-a43e0a8ecd0441131e929daf998c3cd454d9c8f3.tar.gz
openembedded-core-a43e0a8ecd0441131e929daf998c3cd454d9c8f3.tar.bz2
openembedded-core-a43e0a8ecd0441131e929daf998c3cd454d9c8f3.zip
class/lib: Fix up various file access methods
There are various bits of cruft that have built up around our file accesses. This patch cleans some of them up, specifically: * Remove pointless "from __builtin__ import file" * Use open(), not file() * Wrap file usage in a with container to ensure files are closed * Add missing .close() calls in some cases Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/package_rpm.bbclass')
-rw-r--r--meta/classes/package_rpm.bbclass9
1 files changed, 3 insertions, 6 deletions
diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index 3a2997637b..25b14dd79d 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -504,8 +504,7 @@ def write_rpm_perfiledata(srcname, d):
outdepends = workdir + "/" + srcname + ".requires"
try:
- from __builtin__ import file
- dependsfile = file(outdepends, 'w')
+ dependsfile = open(outdepends, 'w')
except OSError:
raise bb.build.FuncFailed("unable to open spec file for writing.")
@@ -518,8 +517,7 @@ def write_rpm_perfiledata(srcname, d):
outprovides = workdir + "/" + srcname + ".provides"
try:
- from __builtin__ import file
- providesfile = file(outprovides, 'w')
+ providesfile = open(outprovides, 'w')
except OSError:
raise bb.build.FuncFailed("unable to open spec file for writing.")
@@ -1005,8 +1003,7 @@ python write_specfile () {
# Write the SPEC file
try:
- from __builtin__ import file
- specfile = file(outspecfile, 'w')
+ specfile = open(outspecfile, 'w')
except OSError:
raise bb.build.FuncFailed("unable to open spec file for writing.")