summaryrefslogtreecommitdiff
path: root/meta/classes
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/autotools.bbclass38
-rw-r--r--meta/classes/base.bbclass227
-rw-r--r--meta/classes/boot-directdisk.bbclass4
-rw-r--r--meta/classes/bootimg.bbclass26
-rw-r--r--meta/classes/cpan-base.bbclass38
-rw-r--r--meta/classes/debian.bbclass184
-rw-r--r--meta/classes/gconf.bbclass56
-rw-r--r--meta/classes/gnomebase.bbclass6
-rw-r--r--meta/classes/gtk-icon-cache.bbclass52
-rw-r--r--meta/classes/image.bbclass30
-rw-r--r--meta/classes/image_types.bbclass2
-rw-r--r--meta/classes/kernel-arch.bbclass42
-rw-r--r--meta/classes/kernel-yocto.bbclass52
-rw-r--r--meta/classes/kernel.bbclass342
-rw-r--r--meta/classes/libc-common.bbclass18
-rw-r--r--meta/classes/libc-package.bbclass526
-rw-r--r--meta/classes/license.bbclass2
-rw-r--r--meta/classes/metadata_scm.bbclass102
-rw-r--r--meta/classes/mime.bbclass54
-rw-r--r--meta/classes/package.bbclass2930
-rw-r--r--meta/classes/package_deb.bbclass4
-rw-r--r--meta/classes/package_rpm.bbclass1180
-rw-r--r--meta/classes/packagedata.bbclass16
-rw-r--r--meta/classes/patch.bbclass274
-rw-r--r--meta/classes/pkg_metainfo.bbclass36
-rw-r--r--meta/classes/populate_sdk_base.bbclass34
-rw-r--r--meta/classes/qemu.bbclass14
-rw-r--r--meta/classes/sstate.bbclass104
-rw-r--r--meta/classes/staging.bbclass2
-rw-r--r--meta/classes/syslinux.bbclass278
-rw-r--r--meta/classes/update-alternatives.bbclass286
-rw-r--r--meta/classes/update-rc.d.bbclass68
-rw-r--r--meta/classes/useradd.bbclass86
-rw-r--r--meta/classes/utility-tasks.bbclass56
-rw-r--r--meta/classes/utils.bbclass126
35 files changed, 3647 insertions, 3648 deletions
diff --git a/meta/classes/autotools.bbclass b/meta/classes/autotools.bbclass
index 02b984db63..4c4bf8775d 100644
--- a/meta/classes/autotools.bbclass
+++ b/meta/classes/autotools.bbclass
@@ -1,23 +1,23 @@
def autotools_dep_prepend(d):
- if d.getVar('INHIBIT_AUTOTOOLS_DEPS', True):
- return ''
+ if d.getVar('INHIBIT_AUTOTOOLS_DEPS', True):
+ return ''
- pn = d.getVar('PN', True)
- deps = ''
+ pn = d.getVar('PN', True)
+ deps = ''
- if pn in ['autoconf-native', 'automake-native', 'help2man-native']:
- return deps
- deps += 'autoconf-native automake-native '
+ if pn in ['autoconf-native', 'automake-native', 'help2man-native']:
+ return deps
+ deps += 'autoconf-native automake-native '
- if not pn in ['libtool', 'libtool-native'] and not pn.endswith("libtool-cross"):
- deps += 'libtool-native '
- if not bb.data.inherits_class('native', d) \
+ if not pn in ['libtool', 'libtool-native'] and not pn.endswith("libtool-cross"):
+ deps += 'libtool-native '
+ if not bb.data.inherits_class('native', d) \
and not bb.data.inherits_class('nativesdk', d) \
and not bb.data.inherits_class('cross', d) \
and not d.getVar('INHIBIT_DEFAULT_DEPS', True):
- deps += 'libtool-cross '
+ deps += 'libtool-cross '
- return deps + 'gnu-config-native '
+ return deps + 'gnu-config-native '
EXTRA_OEMAKE = ""
@@ -35,15 +35,15 @@ EXTRA_AUTORECONF = "--exclude=autopoint"
export lt_cv_sys_lib_dlsearch_path_spec = "${libdir} ${base_libdir}"
def autotools_set_crosscompiling(d):
- if not bb.data.inherits_class('native', d):
- return " cross_compiling=yes"
- return ""
+ if not bb.data.inherits_class('native', d):
+ return " cross_compiling=yes"
+ return ""
def append_libtool_sysroot(d):
- # Only supply libtool sysroot option for non-native packages
- if not bb.data.inherits_class('native', d):
- return '--with-libtool-sysroot=${STAGING_DIR_HOST}'
- return ""
+ # Only supply libtool sysroot option for non-native packages
+ if not bb.data.inherits_class('native', d):
+ return '--with-libtool-sysroot=${STAGING_DIR_HOST}'
+ return ""
# EXTRA_OECONF_append = "${@autotools_set_crosscompiling(d)}"
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index f69179943b..f3587bcbef 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -33,7 +33,7 @@ def oe_import(d):
python oe_import_eh () {
if isinstance(e, bb.event.ConfigParsed):
- oe_import(e.data)
+ oe_import(e.data)
}
addhandler oe_import_eh
@@ -50,21 +50,20 @@ oe_runmake() {
def base_dep_prepend(d):
- #
- # Ideally this will check a flag so we will operate properly in
- # the case where host == build == target, for now we don't work in
- # that case though.
- #
-
- deps = ""
- # INHIBIT_DEFAULT_DEPS doesn't apply to the patch command. Whether or not
- # we need that built is the responsibility of the patch function / class, not
- # the application.
- if not d.getVar('INHIBIT_DEFAULT_DEPS'):
- if (d.getVar('HOST_SYS', True) !=
- d.getVar('BUILD_SYS', True)):
- deps += " virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}compilerlibs virtual/libc "
- return deps
+ #
+ # Ideally this will check a flag so we will operate properly in
+ # the case where host == build == target, for now we don't work in
+ # that case though.
+ #
+
+ deps = ""
+ # INHIBIT_DEFAULT_DEPS doesn't apply to the patch command. Whether or not
+ # we need that built is the responsibility of the patch function / class, not
+ # the application.
+ if not d.getVar('INHIBIT_DEFAULT_DEPS'):
+ if (d.getVar('HOST_SYS', True) != d.getVar('BUILD_SYS', True)):
+ deps += " virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}compilerlibs virtual/libc "
+ return deps
BASEDEPENDS = "${@base_dep_prepend(d)}"
@@ -80,61 +79,61 @@ do_fetch[dirs] = "${DL_DIR}"
do_fetch[file-checksums] = "${@bb.fetch.get_checksum_file_list(d)}"
python base_do_fetch() {
- src_uri = (d.getVar('SRC_URI', True) or "").split()
- if len(src_uri) == 0:
- return
+ src_uri = (d.getVar('SRC_URI', True) or "").split()
+ if len(src_uri) == 0:
+ return
- localdata = bb.data.createCopy(d)
- bb.data.update_data(localdata)
+ localdata = bb.data.createCopy(d)
+ bb.data.update_data(localdata)
- try:
- fetcher = bb.fetch2.Fetch(src_uri, localdata)
- fetcher.download()
- except bb.fetch2.BBFetchException, e:
- raise bb.build.FuncFailed(e)
+ try:
+ fetcher = bb.fetch2.Fetch(src_uri, localdata)
+ fetcher.download()
+ except bb.fetch2.BBFetchException, e:
+ raise bb.build.FuncFailed(e)
}
addtask unpack after do_fetch
do_unpack[dirs] = "${WORKDIR}"
do_unpack[cleandirs] = "${S}/patches"
python base_do_unpack() {
- src_uri = (d.getVar('SRC_URI', True) or "").split()
- if len(src_uri) == 0:
- return
+ src_uri = (d.getVar('SRC_URI', True) or "").split()
+ if len(src_uri) == 0:
+ return
- localdata = bb.data.createCopy(d)
- bb.data.update_data(localdata)
+ localdata = bb.data.createCopy(d)
+ bb.data.update_data(localdata)
- rootdir = localdata.getVar('WORKDIR', True)
+ rootdir = localdata.getVar('WORKDIR', True)
- try:
- fetcher = bb.fetch2.Fetch(src_uri, localdata)
- fetcher.unpack(rootdir)
- except bb.fetch2.BBFetchException, e:
- raise bb.build.FuncFailed(e)
+ try:
+ fetcher = bb.fetch2.Fetch(src_uri, localdata)
+ fetcher.unpack(rootdir)
+ except bb.fetch2.BBFetchException, e:
+ raise bb.build.FuncFailed(e)
}
GIT_CONFIG_PATH = "${STAGING_DIR_NATIVE}/etc"
GIT_CONFIG = "${GIT_CONFIG_PATH}/gitconfig"
def generate_git_config(e):
- from bb import data
+ from bb import data
- if data.getVar('GIT_CORE_CONFIG', e.data, True):
- gitconfig_path = e.data.getVar('GIT_CONFIG', True)
- proxy_command = " gitProxy = %s\n" % data.getVar('OE_GIT_PROXY_COMMAND', e.data, True)
+ if data.getVar('GIT_CORE_CONFIG', e.data, True):
+ gitconfig_path = e.data.getVar('GIT_CONFIG', True)
+ proxy_command = " gitProxy = %s\n" % data.getVar('OE_GIT_PROXY_COMMAND', e.data, True)
- bb.mkdirhier(e.data.expand("${GIT_CONFIG_PATH}"))
- if (os.path.exists(gitconfig_path)):
- os.remove(gitconfig_path)
+ bb.mkdirhier(e.data.expand("${GIT_CONFIG_PATH}"))
+ if (os.path.exists(gitconfig_path)):
+ os.remove(gitconfig_path)
- f = open(gitconfig_path, 'w')
- f.write("[core]\n")
- ignore_hosts = data.getVar('GIT_PROXY_IGNORE', e.data, True).split()
- for ignore_host in ignore_hosts:
- f.write(" gitProxy = none for %s\n" % ignore_host)
- f.write(proxy_command)
- f.close
+ f = open(gitconfig_path, 'w')
+ f.write("[core]\n")
+ ignore_hosts = data.getVar('GIT_PROXY_IGNORE', e.data, True).split()
+ for ignore_host in ignore_hosts:
+ f.write(" gitProxy = none for %s\n" % ignore_host)
+ f.write(proxy_command)
+ f.close
def pkgarch_mapping(d):
# Compatibility mappings of TUNE_PKGARCH (opt in)
@@ -205,69 +204,69 @@ def preferred_ml_updates(d):
def get_layers_branch_rev(d):
- layers = (d.getVar("BBLAYERS", True) or "").split()
- layers_branch_rev = ["%-17s = \"%s:%s\"" % (os.path.basename(i), \
- base_get_metadata_git_branch(i, None).strip(), \
- base_get_metadata_git_revision(i, None)) \
- for i in layers]
- i = len(layers_branch_rev)-1
- p1 = layers_branch_rev[i].find("=")
- s1 = layers_branch_rev[i][p1:]
- while i > 0:
- p2 = layers_branch_rev[i-1].find("=")
- s2= layers_branch_rev[i-1][p2:]
- if s1 == s2:
- layers_branch_rev[i-1] = layers_branch_rev[i-1][0:p2]
- i -= 1
- else:
- i -= 1
- p1 = layers_branch_rev[i].find("=")
- s1= layers_branch_rev[i][p1:]
- return layers_branch_rev
+ layers = (d.getVar("BBLAYERS", True) or "").split()
+ layers_branch_rev = ["%-17s = \"%s:%s\"" % (os.path.basename(i), \
+ base_get_metadata_git_branch(i, None).strip(), \
+ base_get_metadata_git_revision(i, None)) \
+ for i in layers]
+ i = len(layers_branch_rev)-1
+ p1 = layers_branch_rev[i].find("=")
+ s1 = layers_branch_rev[i][p1:]
+ while i > 0:
+ p2 = layers_branch_rev[i-1].find("=")
+ s2= layers_branch_rev[i-1][p2:]
+ if s1 == s2:
+ layers_branch_rev[i-1] = layers_branch_rev[i-1][0:p2]
+ i -= 1
+ else:
+ i -= 1
+ p1 = layers_branch_rev[i].find("=")
+ s1= layers_branch_rev[i][p1:]
+ return layers_branch_rev
BUILDCFG_FUNCS ??= "buildcfg_vars get_layers_branch_rev buildcfg_neededvars"
BUILDCFG_FUNCS[type] = "list"
def buildcfg_vars(d):
- statusvars = oe.data.typed_value('BUILDCFG_VARS', d)
- for var in statusvars:
- value = d.getVar(var, True)
- if value is not None:
- yield '%-17s = "%s"' % (var, value)
+ statusvars = oe.data.typed_value('BUILDCFG_VARS', d)
+ for var in statusvars:
+ value = d.getVar(var, True)
+ if value is not None:
+ yield '%-17s = "%s"' % (var, value)
def buildcfg_neededvars(d):
- needed_vars = oe.data.typed_value("BUILDCFG_NEEDEDVARS", d)
- pesteruser = []
- for v in needed_vars:
- val = d.getVar(v, True)
- if not val or val == 'INVALID':
- pesteruser.append(v)
+ needed_vars = oe.data.typed_value("BUILDCFG_NEEDEDVARS", d)
+ pesteruser = []
+ for v in needed_vars:
+ val = d.getVar(v, True)
+ if not val or val == 'INVALID':
+ pesteruser.append(v)
- if pesteruser:
- bb.fatal('The following variable(s) were not set: %s\nPlease set them directly, or choose a MACHINE or DISTRO that sets them.' % ', '.join(pesteruser))
+ if pesteruser:
+ bb.fatal('The following variable(s) were not set: %s\nPlease set them directly, or choose a MACHINE or DISTRO that sets them.' % ', '.join(pesteruser))
addhandler base_eventhandler
python base_eventhandler() {
- if isinstance(e, bb.event.ConfigParsed):
- e.data.setVar('BB_VERSION', bb.__version__)
- generate_git_config(e)
- pkgarch_mapping(e.data)
- preferred_ml_updates(e.data)
-
- if isinstance(e, bb.event.BuildStarted):
- statuslines = []
- for func in oe.data.typed_value('BUILDCFG_FUNCS', e.data):
- g = globals()
- if func not in g:
- bb.warn("Build configuration function '%s' does not exist" % func)
- else:
- flines = g[func](e.data)
- if flines:
- statuslines.extend(flines)
-
- statusheader = e.data.getVar('BUILDCFG_HEADER', True)
- bb.plain('\n%s\n%s\n' % (statusheader, '\n'.join(statuslines)))
+ if isinstance(e, bb.event.ConfigParsed):
+ e.data.setVar('BB_VERSION', bb.__version__)
+ generate_git_config(e)
+ pkgarch_mapping(e.data)
+ preferred_ml_updates(e.data)
+
+ if isinstance(e, bb.event.BuildStarted):
+ statuslines = []
+ for func in oe.data.typed_value('BUILDCFG_FUNCS', e.data):
+ g = globals()
+ if func not in g:
+ bb.warn("Build configuration function '%s' does not exist" % func)
+ else:
+ flines = g[func](e.data)
+ if flines:
+ statuslines.extend(flines)
+
+ statusheader = e.data.getVar('BUILDCFG_HEADER', True)
+ bb.plain('\n%s\n%s\n' % (statusheader, '\n'.join(statuslines)))
}
addtask configure after do_patch
@@ -546,18 +545,18 @@ python do_cleansstate() {
addtask cleanall after do_cleansstate
python do_cleanall() {
- src_uri = (d.getVar('SRC_URI', True) or "").split()
- if len(src_uri) == 0:
- return
-
- localdata = bb.data.createCopy(d)
- bb.data.update_data(localdata)
-
- try:
- fetcher = bb.fetch2.Fetch(src_uri, localdata)
- fetcher.clean()
- except bb.fetch2.BBFetchException, e:
- raise bb.build.FuncFailed(e)
+ src_uri = (d.getVar('SRC_URI', True) or "").split()
+ if len(src_uri) == 0:
+ return
+
+ localdata = bb.data.createCopy(d)
+ bb.data.update_data(localdata)
+
+ try:
+ fetcher = bb.fetch2.Fetch(src_uri, localdata)
+ fetcher.clean()
+ except bb.fetch2.BBFetchException, e:
+ raise bb.build.FuncFailed(e)
}
do_cleanall[nostamp] = "1"
diff --git a/meta/classes/boot-directdisk.bbclass b/meta/classes/boot-directdisk.bbclass
index 1c601c60c3..d265485bb7 100644
--- a/meta/classes/boot-directdisk.bbclass
+++ b/meta/classes/boot-directdisk.bbclass
@@ -92,8 +92,8 @@ build_boot_dd() {
}
python do_bootdirectdisk() {
- bb.build.exec_func('build_syslinux_cfg', d)
- bb.build.exec_func('build_boot_dd', d)
+ bb.build.exec_func('build_syslinux_cfg', d)
+ bb.build.exec_func('build_boot_dd', d)
}
addtask bootdirectdisk before do_build
diff --git a/meta/classes/bootimg.bbclass b/meta/classes/bootimg.bbclass
index a4c0e8d931..11a29cdf2b 100644
--- a/meta/classes/bootimg.bbclass
+++ b/meta/classes/bootimg.bbclass
@@ -42,15 +42,15 @@ EFI_CLASS = "${@base_contains("MACHINE_FEATURES", "efi", "grub-efi", "dummy", d)
# contain "efi". This way legacy is supported by default if neither is
# specified, maintaining the original behavior.
def pcbios(d):
- pcbios = base_contains("MACHINE_FEATURES", "pcbios", "1", "0", d)
- if pcbios == "0":
- pcbios = base_contains("MACHINE_FEATURES", "efi", "0", "1", d)
- return pcbios
+ pcbios = base_contains("MACHINE_FEATURES", "pcbios", "1", "0", d)
+ if pcbios == "0":
+ pcbios = base_contains("MACHINE_FEATURES", "efi", "0", "1", d)
+ return pcbios
def pcbios_class(d):
- if d.getVar("PCBIOS", True) == "1":
- return "syslinux"
- return "dummy"
+ if d.getVar("PCBIOS", True) == "1":
+ return "syslinux"
+ return "dummy"
PCBIOS = "${@pcbios(d)}"
PCBIOS_CLASS = "${@pcbios_class(d)}"
@@ -181,12 +181,12 @@ build_hddimg() {
}
python do_bootimg() {
- if d.getVar("PCBIOS", True) == "1":
- bb.build.exec_func('build_syslinux_cfg', d)
- if d.getVar("EFI", True) == "1":
- bb.build.exec_func('build_grub_cfg', d)
- bb.build.exec_func('build_hddimg', d)
- bb.build.exec_func('build_iso', d)
+ if d.getVar("PCBIOS", True) == "1":
+ bb.build.exec_func('build_syslinux_cfg', d)
+ if d.getVar("EFI", True) == "1":
+ bb.build.exec_func('build_grub_cfg', d)
+ bb.build.exec_func('build_hddimg', d)
+ bb.build.exec_func('build_iso', d)
}
addtask bootimg before do_build
diff --git a/meta/classes/cpan-base.bbclass b/meta/classes/cpan-base.bbclass
index b4b7b81d8d..660c15f549 100644
--- a/meta/classes/cpan-base.bbclass
+++ b/meta/classes/cpan-base.bbclass
@@ -11,28 +11,28 @@ PERL_OWN_DIR = "${@["", "/perl-native"][(bb.data.inherits_class('native', d))]}"
# Determine the staged version of perl from the perl configuration file
def get_perl_version(d):
- import re
- cfg = d.expand('${STAGING_LIBDIR}${PERL_OWN_DIR}/perl/config.sh')
- try:
- f = open(cfg, 'r')
- except IOError:
- return None
- l = f.readlines();
- f.close();
- r = re.compile("^version='(\d*\.\d*\.\d*)'")
- for s in l:
- m = r.match(s)
- if m:
- return m.group(1)
- return None
+ import re
+ cfg = d.expand('${STAGING_LIBDIR}${PERL_OWN_DIR}/perl/config.sh')
+ try:
+ f = open(cfg, 'r')
+ except IOError:
+ return None
+ l = f.readlines();
+ f.close();
+ r = re.compile("^version='(\d*\.\d*\.\d*)'")
+ for s in l:
+ m = r.match(s)
+ if m:
+ return m.group(1)
+ return None
# Determine where the library directories are
def perl_get_libdirs(d):
- libdir = d.getVar('libdir', True)
- if is_target(d) == "no":
- libdir += '/perl-native'
- libdir += '/perl'
- return libdir
+ libdir = d.getVar('libdir', True)
+ if is_target(d) == "no":
+ libdir += '/perl-native'
+ libdir += '/perl'
+ return libdir
def is_target(d):
if not bb.data.inherits_class('native', d):
diff --git a/meta/classes/debian.bbclass b/meta/classes/debian.bbclass
index bb4ae11eca..2484003e37 100644
--- a/meta/classes/debian.bbclass
+++ b/meta/classes/debian.bbclass
@@ -20,105 +20,105 @@ python () {
}
python debian_package_name_hook () {
- import glob, copy, stat, errno, re
+ import glob, copy, stat, errno, re
- pkgdest = d.getVar('PKGDEST', True)
- packages = d.getVar('PACKAGES', True)
- bin_re = re.compile(".*/s?" + os.path.basename(d.getVar("bindir", True)) + "$")
- lib_re = re.compile(".*/" + os.path.basename(d.getVar("libdir", True)) + "$")
- so_re = re.compile("lib.*\.so")
+ pkgdest = d.getVar('PKGDEST', True)
+ packages = d.getVar('PACKAGES', True)
+ bin_re = re.compile(".*/s?" + os.path.basename(d.getVar("bindir", True)) + "$")
+ lib_re = re.compile(".*/" + os.path.basename(d.getVar("libdir", True)) + "$")
+ so_re = re.compile("lib.*\.so")
- def socrunch(s):
- s = s.lower().replace('_', '-')
- m = re.match("^(.*)(.)\.so\.(.*)$", s)
- if m is None:
- return None
- if m.group(2) in '0123456789':
- bin = '%s%s-%s' % (m.group(1), m.group(2), m.group(3))
- else:
- bin = m.group(1) + m.group(2) + m.group(3)
- dev = m.group(1) + m.group(2)
- return (bin, dev)
+ def socrunch(s):
+ s = s.lower().replace('_', '-')
+ m = re.match("^(.*)(.)\.so\.(.*)$", s)
+ if m is None:
+ return None
+ if m.group(2) in '0123456789':
+ bin = '%s%s-%s' % (m.group(1), m.group(2), m.group(3))
+ else:
+ bin = m.group(1) + m.group(2) + m.group(3)
+ dev = m.group(1) + m.group(2)
+ return (bin, dev)
- def isexec(path):
- try:
- s = os.stat(path)
- except (os.error, AttributeError):
- return 0
- return (s[stat.ST_MODE] & stat.S_IEXEC)
+ def isexec(path):
+ try:
+ s = os.stat(path)
+ except (os.error, AttributeError):
+ return 0
+ return (s[stat.ST_MODE] & stat.S_IEXEC)
- def auto_libname(packages, orig_pkg):
- sonames = []
- has_bins = 0
- has_libs = 0
- pkg_dir = os.path.join(pkgdest, orig_pkg)
- for root, dirs, files in os.walk(pkg_dir):
- if bin_re.match(root) and files:
- has_bins = 1
- if lib_re.match(root) and files:
- has_libs = 1
- for f in files:
- if so_re.match(f):
- fp = os.path.join(root, f)
- cmd = (d.getVar('TARGET_PREFIX', True) or "") + "objdump -p " + fp + " 2>/dev/null"
- fd = os.popen(cmd)
- lines = fd.readlines()
- fd.close()
- for l in lines:
- m = re.match("\s+SONAME\s+([^\s]*)", l)
- if m and not m.group(1) in sonames:
- sonames.append(m.group(1))
+ def auto_libname(packages, orig_pkg):
+ sonames = []
+ has_bins = 0
+ has_libs = 0
+ pkg_dir = os.path.join(pkgdest, orig_pkg)
+ for root, dirs, files in os.walk(pkg_dir):
+ if bin_re.match(root) and files:
+ has_bins = 1
+ if lib_re.match(root) and files:
+ has_libs = 1
+ for f in files:
+ if so_re.match(f):
+ fp = os.path.join(root, f)
+ cmd = (d.getVar('TARGET_PREFIX', True) or "") + "objdump -p " + fp + " 2>/dev/null"
+ fd = os.popen(cmd)
+ lines = fd.readlines()
+ fd.close()
+ for l in lines:
+ m = re.match("\s+SONAME\s+([^\s]*)", l)
+ if m and not m.group(1) in sonames:
+ sonames.append(m.group(1))
- bb.debug(1, 'LIBNAMES: pkg %s libs %d bins %d sonames %s' % (orig_pkg, has_libs, has_bins, sonames))
- soname = None
- if len(sonames) == 1:
- soname = sonames[0]
- elif len(sonames) > 1:
- lead = d.getVar('LEAD_SONAME', True)
- if lead:
- r = re.compile(lead)
- filtered = []
- for s in sonames:
- if r.match(s):
- filtered.append(s)
- if len(filtered) == 1:
- soname = filtered[0]
- elif len(filtered) > 1:
- bb.note("Multiple matches (%s) for LEAD_SONAME '%s'" % (", ".join(filtered), lead))
- else:
- bb.note("Multiple libraries (%s) found, but LEAD_SONAME '%s' doesn't match any of them" % (", ".join(sonames), lead))
- else:
- bb.note("Multiple libraries (%s) found and LEAD_SONAME not defined" % ", ".join(sonames))
+ bb.debug(1, 'LIBNAMES: pkg %s libs %d bins %d sonames %s' % (orig_pkg, has_libs, has_bins, sonames))
+ soname = None
+ if len(sonames) == 1:
+ soname = sonames[0]
+ elif len(sonames) > 1:
+ lead = d.getVar('LEAD_SONAME', True)
+ if lead:
+ r = re.compile(lead)
+ filtered = []
+ for s in sonames:
+ if r.match(s):
+ filtered.append(s)
+ if len(filtered) == 1:
+ soname = filtered[0]
+ elif len(filtered) > 1:
+ bb.note("Multiple matches (%s) for LEAD_SONAME '%s'" % (", ".join(filtered), lead))
+ else:
+ bb.note("Multiple libraries (%s) found, but LEAD_SONAME '%s' doesn't match any of them" % (", ".join(sonames), lead))
+ else:
+ bb.note("Multiple libraries (%s) found and LEAD_SONAME not defined" % ", ".join(sonames))
- if has_libs and not has_bins and soname:
- soname_result = socrunch(soname)
- if soname_result:
- (pkgname, devname) = soname_result
- for pkg in packages.split():
- if (d.getVar('PKG_' + pkg) or d.getVar('DEBIAN_NOAUTONAME_' + pkg)):
- continue
- debian_pn = d.getVar('DEBIANNAME_' + pkg)
- if debian_pn:
- newpkg = debian_pn
- elif pkg == orig_pkg:
- newpkg = pkgname
- else:
- newpkg = pkg.replace(orig_pkg, devname, 1)
- mlpre=d.getVar('MLPREFIX', True)
- if mlpre:
- if not newpkg.find(mlpre) == 0:
- newpkg = mlpre + newpkg
- if newpkg != pkg:
- d.setVar('PKG_' + pkg, newpkg)
+ if has_libs and not has_bins and soname:
+ soname_result = socrunch(soname)
+ if soname_result:
+ (pkgname, devname) = soname_result
+ for pkg in packages.split():
+ if (d.getVar('PKG_' + pkg) or d.getVar('DEBIAN_NOAUTONAME_' + pkg)):
+ continue
+ debian_pn = d.getVar('DEBIANNAME_' + pkg)
+ if debian_pn:
+ newpkg = debian_pn
+ elif pkg == orig_pkg:
+ newpkg = pkgname
+ else:
+ newpkg = pkg.replace(orig_pkg, devname, 1)
+ mlpre=d.getVar('MLPREFIX', True)
+ if mlpre:
+ if not newpkg.find(mlpre) == 0:
+ newpkg = mlpre + newpkg
+ if newpkg != pkg:
+ d.setVar('PKG_' + pkg, newpkg)
- # reversed sort is needed when some package is substring of another
- # ie in ncurses we get without reverse sort:
- # DEBUG: LIBNAMES: pkgname libtic5 devname libtic pkg ncurses-libtic orig_pkg ncurses-libtic debian_pn None newpkg libtic5
- # and later
- # DEBUG: LIBNAMES: pkgname libtic5 devname libtic pkg ncurses-libticw orig_pkg ncurses-libtic debian_pn None newpkg libticw
- # so we need to handle ncurses-libticw->libticw5 before ncurses-libtic->libtic5
- for pkg in sorted((d.getVar('AUTO_LIBNAME_PKGS', True) or "").split(), reverse=True):
- auto_libname(packages, pkg)
+ # reversed sort is needed when some package is substring of another
+ # ie in ncurses we get without reverse sort:
+ # DEBUG: LIBNAMES: pkgname libtic5 devname libtic pkg ncurses-libtic orig_pkg ncurses-libtic debian_pn None newpkg libtic5
+ # and later
+ # DEBUG: LIBNAMES: pkgname libtic5 devname libtic pkg ncurses-libticw orig_pkg ncurses-libtic debian_pn None newpkg libticw
+ # so we need to handle ncurses-libticw->libticw5 before ncurses-libtic->libtic5
+ for pkg in sorted((d.getVar('AUTO_LIBNAME_PKGS', True) or "").split(), reverse=True):
+ auto_libname(packages, pkg)
}
EXPORT_FUNCTIONS package_name_hook
diff --git a/meta/classes/gconf.bbclass b/meta/classes/gconf.bbclass
index fb9f701b37..7a3ee3c28c 100644
--- a/meta/classes/gconf.bbclass
+++ b/meta/classes/gconf.bbclass
@@ -39,33 +39,33 @@ done
}
python populate_packages_append () {
- import re
- packages = d.getVar('PACKAGES', True).split()
- pkgdest = d.getVar('PKGDEST', True)
-
- for pkg in packages:
- schema_dir = '%s/%s/etc/gconf/schemas' % (pkgdest, pkg)
- schemas = []
- schema_re = re.compile(".*\.schemas$")
- if os.path.exists(schema_dir):
- for f in os.listdir(schema_dir):
- if schema_re.match(f):
- schemas.append(f)
- if schemas != []:
- bb.note("adding gconf postinst and prerm scripts to %s" % pkg)
- d.setVar('SCHEMA_FILES', " ".join(schemas))
- postinst = d.getVar('pkg_postinst_%s' % pkg, True) or d.getVar('pkg_postinst', True)
- if not postinst:
- postinst = '#!/bin/sh\n'
- postinst += d.getVar('gconf_postinst', True)
- d.setVar('pkg_postinst_%s' % pkg, postinst)
- prerm = d.getVar('pkg_prerm_%s' % pkg, True) or d.getVar('pkg_prerm', True)
- if not prerm:
- prerm = '#!/bin/sh\n'
- prerm += d.getVar('gconf_prerm', True)
- d.setVar('pkg_prerm_%s' % pkg, prerm)
- rdepends = d.getVar("RDEPENDS_%s" % pkg, True) or ""
- rdepends += ' ' + d.getVar('MLPREFIX') + 'gconf'
- d.setVar("RDEPENDS_%s" % pkg, rdepends)
+ import re
+ packages = d.getVar('PACKAGES', True).split()
+ pkgdest = d.getVar('PKGDEST', True)
+
+ for pkg in packages:
+ schema_dir = '%s/%s/etc/gconf/schemas' % (pkgdest, pkg)
+ schemas = []
+ schema_re = re.compile(".*\.schemas$")
+ if os.path.exists(schema_dir):
+ for f in os.listdir(schema_dir):
+ if schema_re.match(f):
+ schemas.append(f)
+ if schemas != []:
+ bb.note("adding gconf postinst and prerm scripts to %s" % pkg)
+ d.setVar('SCHEMA_FILES', " ".join(schemas))
+ postinst = d.getVar('pkg_postinst_%s' % pkg, True) or d.getVar('pkg_postinst', True)
+ if not postinst:
+ postinst = '#!/bin/sh\n'
+ postinst += d.getVar('gconf_postinst', True)
+ d.setVar('pkg_postinst_%s' % pkg, postinst)
+ prerm = d.getVar('pkg_prerm_%s' % pkg, True) or d.getVar('pkg_prerm', True)
+ if not prerm:
+ prerm = '#!/bin/sh\n'
+ prerm += d.getVar('gconf_prerm', True)
+ d.setVar('pkg_prerm_%s' % pkg, prerm)
+ rdepends = d.getVar("RDEPENDS_%s" % pkg, True) or ""
+ rdepends += ' ' + d.getVar('MLPREFIX') + 'gconf'
+ d.setVar("RDEPENDS_%s" % pkg, rdepends)