summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2013-02-03 17:25:30 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-02-06 13:13:00 +0000
commit48f8eece276ae75dc3fdca02f8c3552042b4a6cc (patch)
tree086bf6e8b8a270d11a6a512fdc5e784bd40bcf72
parentee5e443dba2ee6b2bba318a58f710248894df7c5 (diff)
downloadpoky-48f8eece276ae75dc3fdca02f8c3552042b4a6cc.tar.gz
package.bbclass: Various minor performance tweaks
* Call getVar outside the loop * Drop unneeded PATH export (bitbake does this already) * Drop unused variable * Simplify if statement nesting * Simplify variable expandion to a getVar call (expand would just call getVar) (From OE-Core rev: 52b506145bcddc133ca93a8c9f7343de69d10907) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/package.bbclass14
1 files changed, 6 insertions, 8 deletions
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 760f245a52..6ec028b594 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -557,11 +557,12 @@ python fixup_perms () {
557 # paths are resolved via BBPATH 557 # paths are resolved via BBPATH
558 def get_fs_perms_list(d): 558 def get_fs_perms_list(d):
559 str = "" 559 str = ""
560 bbpath = d.getVar('BBPATH', True)
560 fs_perms_tables = d.getVar('FILESYSTEM_PERMS_TABLES', True) 561 fs_perms_tables = d.getVar('FILESYSTEM_PERMS_TABLES', True)
561 if not fs_perms_tables: 562 if not fs_perms_tables:
562 fs_perms_tables = 'files/fs-perms.txt' 563 fs_perms_tables = 'files/fs-perms.txt'
563 for conf_file in fs_perms_tables.split(): 564 for conf_file in fs_perms_tables.split():
564 str += " %s" % bb.which(d.getVar('BBPATH', True), conf_file) 565 str += " %s" % bb.utils.which(bbpath, conf_file)
565 return str 566 return str
566 567
567 568
@@ -892,11 +893,10 @@ python populate_packages () {
892 for pkg in packages.split(): 893 for pkg in packages.split():
893 if d.getVar('LICENSE_EXCLUSION-' + pkg, True): 894 if d.getVar('LICENSE_EXCLUSION-' + pkg, True):
894 bb.warn("%s has an incompatible license. Excluding from packaging." % pkg) 895 bb.warn("%s has an incompatible license. Excluding from packaging." % pkg)
896 elif pkg in package_list:
897 bb.error("%s is listed in PACKAGES multiple times, this leads to packaging errors." % pkg)
895 else: 898 else:
896 if pkg in package_list: 899 package_list.append(pkg)
897 bb.error("%s is listed in PACKAGES multiple times, this leads to packaging errors." % pkg)
898 else:
899 package_list.append(pkg)
900 d.setVar('PACKAGES', ' '.join(package_list)) 900 d.setVar('PACKAGES', ' '.join(package_list))
901 pkgdest = d.getVar('PKGDEST', True) 901 pkgdest = d.getVar('PKGDEST', True)
902 902
@@ -911,7 +911,6 @@ python populate_packages () {
911 bb.warn("FILES variable for package %s contains '//' which is invalid. Attempting to fix this but you should correct the metadata.\n" % pkg) 911 bb.warn("FILES variable for package %s contains '//' which is invalid. Attempting to fix this but you should correct the metadata.\n" % pkg)
912 filesvar.replace("//", "/") 912 filesvar.replace("//", "/")
913 files = filesvar.split() 913 files = filesvar.split()
914 file_links = {}
915 for file in files: 914 for file in files:
916 if os.path.isabs(file): 915 if os.path.isabs(file):
917 file = '.' + file 916 file = '.' + file
@@ -1195,7 +1194,7 @@ python package_do_filedeps() {
1195 1194
1196 pkgdest = d.getVar('PKGDEST', True) 1195 pkgdest = d.getVar('PKGDEST', True)
1197 packages = d.getVar('PACKAGES', True) 1196 packages = d.getVar('PACKAGES', True)
1198 rpmdeps = d.expand("${RPMDEPS}") 1197 rpmdeps = d.getVar('RPMDEPS', True)
1199 1198
1200 def chunks(files, n): 1199 def chunks(files, n):
1201 return [files[i:i+n] for i in range(0, len(files), n)] 1200 return [files[i:i+n] for i in range(0, len(files), n)]
@@ -1287,7 +1286,6 @@ python package_do_shlibs() {
1287 def linux_so(file): 1286 def linux_so(file):
1288 needs_ldconfig = False 1287 needs_ldconfig = False
1289 cmd = d.getVar('OBJDUMP', True) + " -p " + pipes.quote(file) + " 2>/dev/null" 1288 cmd = d.getVar('OBJDUMP', True) + " -p " + pipes.quote(file) + " 2>/dev/null"
1290 cmd = "PATH=\"%s\" %s" % (d.getVar('PATH', True), cmd)
1291 fd = os.popen(cmd) 1289 fd = os.popen(cmd)
1292 lines = fd.readlines() 1290 lines = fd.readlines()
1293 fd.close() 1291 fd.close()