mirror of
https://git.yoctoproject.org/poky-contrib
synced 2025-05-08 23:52:25 +08:00
insane: micro-optimise the sweep of pkgfiles
Don't actively do more work: - Exit early if there are no packages being generated - Don't iterate repeatedly when removing CONTROL and DEBIAN - Extend a list with another list instead of appending item by item - Remove unused variables (From OE-Core rev: 79ffb8896d570dd935d3aea9d28ee20b52e1674a) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
827716ac0a
commit
68e5aa9b92
@ -1084,13 +1084,8 @@ parse_test_matrix[vardepsexclude] = "ERROR_QA WARN_QA"
|
||||
|
||||
# The PACKAGE FUNC to scan each package
|
||||
python do_package_qa () {
|
||||
import subprocess
|
||||
import oe.packagedata
|
||||
|
||||
bb.note("DO PACKAGE QA")
|
||||
|
||||
main_lic = d.getVar('LICENSE')
|
||||
|
||||
# Check for obsolete license references in main LICENSE (packages are checked below for any changes)
|
||||
main_licenses = oe.license.list_licenses(d.getVar('LICENSE'))
|
||||
obsolete = set(oe.license.obsolete_license_list()) & main_licenses
|
||||
@ -1106,27 +1101,27 @@ python do_package_qa () {
|
||||
pn = d.getVar('PN')
|
||||
|
||||
# Scan the packages...
|
||||
pkgdest = d.getVar('PKGDEST')
|
||||
packages = set((d.getVar('PACKAGES') or '').split())
|
||||
# no packages should be scanned
|
||||
if not packages:
|
||||
return
|
||||
|
||||
global pkgfiles
|
||||
pkgfiles = {}
|
||||
pkgdest = d.getVar('PKGDEST')
|
||||
for pkg in packages:
|
||||
pkgfiles[pkg] = []
|
||||
pkgdir = os.path.join(pkgdest, pkg)
|
||||
pkgfiles[pkg] = []
|
||||
for walkroot, dirs, files in os.walk(pkgdir):
|
||||
# Don't walk into top-level CONTROL or DEBIAN directories as these
|
||||
# are temporary directories created by do_package.
|
||||
if walkroot == pkgdir:
|
||||
for control in ("CONTROL", "DEBIAN"):
|
||||
if control in dirs:
|
||||
dirs.remove(control)
|
||||
for file in files:
|
||||
pkgfiles[pkg].append(os.path.join(walkroot, file))
|
||||
|
||||
# no packages should be scanned
|
||||
if not packages:
|
||||
return
|
||||
for removedir in ("CONTROL", "DEBIAN"):
|
||||
try:
|
||||
dirs.remove(removedir)
|
||||
except ValueError:
|
||||
pass
|
||||
pkgfiles[pkg].extend((os.path.join(walkroot, f) for f in files))
|
||||
|
||||
import re
|
||||
# The package name matches the [a-z0-9.+-]+ regular expression
|
||||
|
Loading…
x
Reference in New Issue
Block a user