diff options
Diffstat (limited to 'meta/classes/package_ipk.bbclass')
| -rw-r--r-- | meta/classes/package_ipk.bbclass | 553 |
1 files changed, 252 insertions, 301 deletions
diff --git a/meta/classes/package_ipk.bbclass b/meta/classes/package_ipk.bbclass index 5ddd6c66ea..c7cec9d63d 100644 --- a/meta/classes/package_ipk.bbclass +++ b/meta/classes/package_ipk.bbclass @@ -7,324 +7,275 @@ IPKGCONF_SDK = "${WORKDIR}/opkg-sdk.conf" PKGWRITEDIRIPK = "${WORKDIR}/deploy-ipks" -python package_ipk_fn () { - bb.data.setVar('PKGFN', bb.data.getVar('PKG',d), d) -} - -python package_ipk_install () { - pkg = bb.data.getVar('PKG', d, 1) - pkgfn = bb.data.getVar('PKGFN', d, 1) - rootfs = bb.data.getVar('IMAGE_ROOTFS', d, 1) - ipkdir = bb.data.getVar('DEPLOY_DIR_IPK', d, 1) - stagingdir = bb.data.getVar('STAGING_DIR', d, 1) - tmpdir = bb.data.getVar('TMPDIR', d, 1) - - if None in (pkg,pkgfn,rootfs): - raise bb.build.FuncFailed("missing variables (one or more of PKG, PKGFN, IMAGEROOTFS)") - try: - bb.mkdirhier(rootfs) - os.chdir(rootfs) - except OSError: - import sys - (type, value, traceback) = sys.exc_info() - print value - raise bb.build.FuncFailed - - # Generate ipk.conf if it or the stamp doesnt exist - conffile = os.path.join(stagingdir,"ipkg.conf") - if not os.access(conffile, os.R_OK): - ipkg_archs = bb.data.getVar('PACKAGE_ARCHS',d) - if ipkg_archs is None: - bb.error("PACKAGE_ARCHS missing") - raise FuncFailed - ipkg_archs = ipkg_archs.split() - arch_priority = 1 - - f = open(conffile,"w") - for arch in ipkg_archs: - f.write("arch %s %s\n" % ( arch, arch_priority )) - arch_priority += 1 - f.write("src local file:%s" % ipkdir) - f.close() - - - if not os.access(os.path.join(ipkdir,"Packages"), os.R_OK) or not os.access(os.path.join(tmpdir, "stamps", "IPK_PACKAGE_INDEX_CLEAN"),os.R_OK): - ret = os.system('opkg-make-index -p %s %s ' % (os.path.join(ipkdir, "Packages"), ipkdir)) - if (ret != 0 ): - raise bb.build.FuncFailed - f = open(os.path.join(tmpdir, "stamps", "IPK_PACKAGE_INDEX_CLEAN"),"w") - f.close() - - ret = os.system('opkg-cl -o %s -f %s update' % (rootfs, conffile)) - ret = os.system('opkg-cl -o %s -f %s install %s' % (rootfs, conffile, pkgfn)) - if (ret != 0 ): - raise bb.build.FuncFailed -} +# Program to be used to build opkg packages +OPKGBUILDCMD ??= "opkg-build" -# -# Update the Packages index files in ${DEPLOY_DIR_IPK} -# -package_update_index_ipk () { - set -x - - ipkgarchs="${PACKAGE_ARCHS}" - - if [ ! -z "${DEPLOY_KEEP_PACKAGES}" ]; then - return - fi - - packagedirs="${DEPLOY_DIR_IPK}" - for arch in $ipkgarchs; do - sdkarch=`echo $arch | sed -e 's/${HOST_ARCH}/${SDK_ARCH}/'` - packagedirs="$packagedirs ${DEPLOY_DIR_IPK}/$arch ${DEPLOY_DIR_IPK}/$sdkarch-nativesdk" - done - - for pkgdir in $packagedirs; do - if [ -e $pkgdir/ ]; then - touch $pkgdir/Packages - flock $pkgdir/Packages.flock -c "opkg-make-index -r $pkgdir/Packages -p $pkgdir/Packages -l $pkgdir/Packages.filelist -m $pkgdir/" - fi - done -} - -# -# Generate an ipkg conf file ${IPKGCONF_TARGET} suitable for use against -# the target system and an ipkg conf file ${IPKGCONF_SDK} suitable for -# use against the host system in sdk builds -# -package_generate_ipkg_conf () { - package_generate_archlist - echo "src oe file:${DEPLOY_DIR_IPK}" >> ${IPKGCONF_TARGET} - echo "src oe file:${DEPLOY_DIR_IPK}" >> ${IPKGCONF_SDK} - ipkgarchs="${PACKAGE_ARCHS}" - for arch in $ipkgarchs; do - if [ -e ${DEPLOY_DIR_IPK}/$arch/Packages ] ; then - echo "src oe-$arch file:${DEPLOY_DIR_IPK}/$arch" >> ${IPKGCONF_TARGET} - fi - sdkarch=`echo $arch | sed -e 's/${HOST_ARCH}/${SDK_ARCH}/'` - extension=-nativesdk - if [ "$sdkarch" = "all" -o "$sdkarch" = "any" -o "$sdkarch" = "noarch" ]; then - extension="" - fi - if [ -e ${DEPLOY_DIR_IPK}/$sdkarch$extension/Packages ] ; then - echo "src oe-$sdkarch$extension file:${DEPLOY_DIR_IPK}/$sdkarch$extension" >> ${IPKGCONF_SDK} - fi - done -} +OPKG_ARGS += "--force_postinstall --prefer-arch-to-version" +OPKG_ARGS += "${@['', '--no-install-recommends'][d.getVar("NO_RECOMMENDATIONS") == "1"]}" +OPKG_ARGS += "${@['', '--add-exclude ' + ' --add-exclude '.join((d.getVar('PACKAGE_EXCLUDE') or "").split())][(d.getVar("PACKAGE_EXCLUDE") or "") != ""]}" -package_generate_archlist () { - ipkgarchs="${PACKAGE_ARCHS}" - priority=1 - for arch in $ipkgarchs; do - sdkarch=`echo $arch | sed -e 's/${HOST_ARCH}/${SDK_ARCH}/'` - echo "arch $arch $priority" >> ${IPKGCONF_TARGET} - extension=-nativesdk - if [ "$sdkarch" = "all" -o "$sdkarch" = "any" -o "$sdkarch" = "noarch" ]; then - extension="" - fi - echo "arch $sdkarch$extension $priority" >> ${IPKGCONF_SDK} - priority=$(expr $priority + 5) - done -} +OPKGLIBDIR = "${localstatedir}/lib" python do_package_ipk () { - import re, copy - import textwrap - - workdir = bb.data.getVar('WORKDIR', d, True) - outdir = bb.data.getVar('PKGWRITEDIRIPK', d, True) - dvar = bb.data.getVar('D', d, True) - tmpdir = bb.data.getVar('TMPDIR', d, True) - pkgdest = bb.data.getVar('PKGDEST', d, True) - if not workdir or not outdir or not dvar or not tmpdir: - bb.error("Variables incorrectly set, unable to package") - return - - if not os.path.exists(dvar): - bb.debug(1, "Nothing installed, nothing to do") - return - - packages = bb.data.getVar('PACKAGES', d, True) - if not packages or packages == '': - bb.debug(1, "No packages; nothing to do") - return - - # We're about to add new packages so the index needs to be checked - # so remove the appropriate stamp file. - if os.access(os.path.join(tmpdir, "stamps", "IPK_PACKAGE_INDEX_CLEAN"), os.R_OK): - os.unlink(os.path.join(tmpdir, "stamps", "IPK_PACKAGE_INDEX_CLEAN")) - - for pkg in packages.split(): - localdata = bb.data.createCopy(d) - root = "%s/%s" % (pkgdest, pkg) - - lf = bb.utils.lockfile(root + ".lock") - - bb.data.setVar('ROOT', '', localdata) - bb.data.setVar('ROOT_%s' % pkg, root, localdata) - pkgname = bb.data.getVar('PKG_%s' % pkg, localdata, 1) - if not pkgname: - pkgname = pkg - bb.data.setVar('PKG', pkgname, localdata) - - bb.data.setVar('OVERRIDES', pkg, localdata) - - bb.data.update_data(localdata) - basedir = os.path.join(os.path.dirname(root)) - arch = bb.data.getVar('PACKAGE_ARCH', localdata, 1) - pkgoutdir = "%s/%s" % (outdir, arch) - bb.mkdirhier(pkgoutdir) - os.chdir(root) - from glob import glob - g = glob('*') - try: - del g[g.index('CONTROL')] - del g[g.index('./CONTROL')] - except ValueError: - pass - if not g and bb.data.getVar('ALLOW_EMPTY', localdata) != "1": - bb.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) - continue - - controldir = os.path.join(root, 'CONTROL') - bb.mkdirhier(controldir) - try: - ctrlfile = file(os.path.join(controldir, 'control'), 'w') - except OSError: - bb.utils.unlockfile(lf) - raise bb.build.FuncFailed("unable to open control file for writing.") - - fields = [] - pe = bb.data.getVar('PE', d, 1) - if pe and int(pe) > 0: - fields.append(["Version: %s:%s-%s\n", ['PE', 'PV', 'PR']]) - else: - fields.append(["Version: %s-%s\n", ['PV', 'PR']]) - fields.append(["Description: %s\n", ['DESCRIPTION']]) - fields.append(["Section: %s\n", ['SECTION']]) - fields.append(["Priority: %s\n", ['PRIORITY']]) - fields.append(["Maintainer: %s\n", ['MAINTAINER']]) - fields.append(["Architecture: %s\n", ['PACKAGE_ARCH']]) - fields.append(["OE: %s\n", ['PN']]) - fields.append(["Homepage: %s\n", ['HOMEPAGE']]) - - def pullData(l, d): - l2 = [] - for i in l: - l2.append(bb.data.getVar(i, d, 1)) - return l2 - - ctrlfile.write("Package: %s\n" % pkgname) - # check for required fields - try: - for (c, fs) in fields: - for f in fs: - if bb.data.getVar(f, localdata) is None: - raise KeyError(f) - # Special behavior for description... - if 'DESCRIPTION' in fs: - summary = bb.data.getVar('SUMMARY', localdata, True) or bb.data.getVar('DESCRIPTION', localdata, True) or "." - description = bb.data.getVar('DESCRIPTION', localdata, True) or "." - description = textwrap.dedent(description).strip() - ctrlfile.write('Description: %s\n' % summary) - ctrlfile.write('%s\n' % textwrap.fill(description, width=74, initial_indent=' ', subsequent_indent=' ')) - else: - ctrlfile.write(c % tuple(pullData(fs, localdata))) - except KeyError: - import sys - (type, value, traceback) = sys.exc_info() - ctrlfile.close() - bb.utils.unlockfile(lf) - raise bb.build.FuncFailed("Missing field for ipk generation: %s" % value) - # more fields - - bb.build.exec_func("mapping_rename_hook", localdata) - - rdepends = bb.utils.explode_dep_versions(bb.data.getVar("RDEPENDS", localdata, 1) or "") - rrecommends = bb.utils.explode_dep_versions(bb.data.getVar("RRECOMMENDS", localdata, 1) or "") - rsuggests = bb.utils.explode_dep_versions(bb.data.getVar("RSUGGESTS", localdata, 1) or "") - rprovides = bb.utils.explode_dep_versions(bb.data.getVar("RPROVIDES", localdata, 1) or "") - rreplaces = bb.utils.explode_dep_versions(bb.data.getVar("RREPLACES", localdata, 1) or "") - rconflicts = bb.utils.explode_dep_versions(bb.data.getVar("RCONFLICTS", localdata, 1) or "") - - if rdepends: - ctrlfile.write("Depends: %s\n" % bb.utils.join_deps(rdepends)) - if rsuggests: - ctrlfile.write("Suggests: %s\n" % bb.utils.join_deps(rsuggests)) - if rrecommends: - ctrlfile.write("Recommends: %s\n" % bb.utils.join_deps(rrecommends)) - if rprovides: - ctrlfile.write("Provides: %s\n" % bb.utils.join_deps(rprovides)) - if rreplaces: - ctrlfile.write("Replaces: %s\n" % bb.utils.join_deps(rreplaces)) - if rconflicts: - ctrlfile.write("Conflicts: %s\n" % bb.utils.join_deps(rconflicts)) - src_uri = bb.data.getVar("SRC_URI", localdata, 1) - if src_uri: - src_uri = re.sub("\s+", " ", src_uri) - ctrlfile.write("Source: %s\n" % " ".join(src_uri.split())) - ctrlfile.close() - - for script in ["preinst", "postinst", "prerm", "postrm"]: - scriptvar = bb.data.getVar('pkg_%s' % script, localdata, 1) - if not scriptvar: - continue - try: - scriptfile = file(os.path.join(controldir, script), 'w') - except OSError: - bb.utils.unlockfile(lf) - raise bb.build.FuncFailed("unable to open %s script file for writing." % script) - scriptfile.write(scriptvar) - scriptfile.close() - os.chmod(os.path.join(controldir, script), 0755) - - conffiles_str = bb.data.getVar("CONFFILES", localdata, 1) - if conffiles_str: - try: - conffiles = file(os.path.join(controldir, 'conffiles'), 'w') - except OSError: - bb.utils.unlockfile(lf) - raise bb.build.FuncFailed("unable to open conffiles for writing.") - for f in conffiles_str.split(): - conffiles.write('%s\n' % f) - conffiles.close() - - os.chdir(basedir) - ret = os.system("PATH=\"%s\" %s %s %s" % (bb.data.getVar("PATH", localdata, 1), - bb.data.getVar("OPKGBUILDCMD",d,1), pkg, pkgoutdir)) - if ret != 0: - bb.utils.unlockfile(lf) - raise bb.build.FuncFailed("opkg-build execution failed") - - bb.utils.prunedir(controldir) - bb.utils.unlockfile(lf) - + import re, copy + import textwrap + import subprocess + import collections + + oldcwd = os.getcwd() + + workdir = d.getVar('WORKDIR') + outdir = d.getVar('PKGWRITEDIRIPK') + tmpdir = d.getVar('TMPDIR') + pkgdest = d.getVar('PKGDEST') + if not workdir or not outdir or not tmpdir: + bb.error("Variables incorrectly set, unable to package") + return + + packages = d.getVar('PACKAGES') + if not packages or packages == '': + bb.debug(1, "No packages; nothing to do") + return + + # We're about to add new packages so the index needs to be checked + # so remove the appropriate stamp file. + if os.access(os.path.join(tmpdir, "stamps", "IPK_PACKAGE_INDEX_CLEAN"), os.R_OK): + os.unlink(os.path.join(tmpdir, "stamps", "IPK_PACKAGE_INDEX_CLEAN")) + + def cleanupcontrol(root): + for p in ['CONTROL', 'DEBIAN']: + p = os.path.join(root, p) + if os.path.exists(p): + bb.utils.prunedir(p) + + for pkg in packages.split(): + localdata = bb.data.createCopy(d) + root = "%s/%s" % (pkgdest, pkg) + + lf = bb.utils.lockfile(root + ".lock") + + localdata.setVar('ROOT', '') + localdata.setVar('ROOT_%s' % pkg, root) + pkgname = localdata.getVar('PKG_%s' % pkg) + if not pkgname: + pkgname = pkg + localdata.setVar('PKG', pkgname) + + localdata.setVar('OVERRIDES', d.getVar("OVERRIDES", False) + ":" + pkg) + + basedir = os.path.join(os.path.dirname(root)) + arch = localdata.getVar('PACKAGE_ARCH') + + if localdata.getVar('IPK_HIERARCHICAL_FEED', False) == "1": + # Spread packages across subdirectories so each isn't too crowded + if pkgname.startswith('lib'): + pkg_prefix = 'lib' + pkgname[3] + else: + pkg_prefix = pkgname[0] + + # Keep -dbg, -dev, -doc, -staticdev, -locale and -locale-* packages + # together. These package suffixes are taken from the definitions of + # PACKAGES and PACKAGES_DYNAMIC in meta/conf/bitbake.conf + if pkgname[-4:] in ('-dbg', '-dev', '-doc'): + pkg_subdir = pkgname[:-4] + elif pkgname.endswith('-staticdev'): + pkg_subdir = pkgname[:-10] + elif pkgname.endswith('-locale'): + pkg_subdir = pkgname[:-7] + elif '-locale-' in pkgname: + pkg_subdir = pkgname[:pkgname.find('-locale-')] + else: + pkg_subdir = pkgname + + pkgoutdir = "%s/%s/%s/%s" % (outdir, arch, pkg_prefix, pkg_subdir) + else: + pkgoutdir = "%s/%s" % (outdir, arch) + + bb.utils.mkdirhier(pkgoutdir) + os.chdir(root) + cleanupcontrol(root) + from glob import glob + g = glob('*') + if not g and localdata.getVar('ALLOW_EMPTY', False) != "1": + bb.note("Not creating empty archive for %s-%s-%s" % (pkg, localdata.getVar('PKGV'), localdata.getVar('PKGR'))) + bb.utils.unlockfile(lf) + continue + + controldir = os.path.join(root, 'CONTROL') + bb.utils.mkdirhier(controldir) + ctrlfile = open(os.path.join(controldir, 'control'), 'w') + + fields = [] + pe = d.getVar('PKGE') + if pe and int(pe) > 0: + fields.append(["Version: %s:%s-%s\n", ['PKGE', 'PKGV', 'PKGR']]) + else: + fields.append(["Version: %s-%s\n", ['PKGV', 'PKGR']]) + fields.append(["Description: %s\n", ['DESCRIPTION']]) + fields.append(["Section: %s\n", ['SECTION']]) + fields.append(["Priority: %s\n", ['PRIORITY']]) + fields.append(["Maintainer: %s\n", ['MAINTAINER']]) + fields.append(["License: %s\n", ['LICENSE']]) + fields.append(["Architecture: %s\n", ['PACKAGE_ARCH']]) + fields.append(["OE: %s\n", ['PN']]) + if d.getVar('HOMEPAGE'): + fields.append(["Homepage: %s\n", ['HOMEPAGE']]) + + def pullData(l, d): + l2 = [] + for i in l: + l2.append(d.getVar(i)) + return l2 + + ctrlfile.write("Package: %s\n" % pkgname) + # check for required fields + for (c, fs) in fields: + for f in fs: + if localdata.getVar(f, False) is None: + raise KeyError(f) + # Special behavior for description... + if 'DESCRIPTION' in fs: + summary = localdata.getVar('SUMMARY') or localdata.getVar('DESCRIPTION') or "." + ctrlfile.write('Description: %s\n' % summary) + description = localdata.getVar('DESCRIPTION') or "." + description = textwrap.dedent(description).strip() + if '\\n' in description: + # Manually indent + for t in description.split('\\n'): + # We don't limit the width when manually indent, but we do + # need the textwrap.fill() to set the initial_indent and + # subsequent_indent, so set a large width + line = textwrap.fill(t.strip(), + width=100000, + initial_indent=' ', + subsequent_indent=' ') or '.' + ctrlfile.write('%s\n' % line) + else: + # Auto indent + ctrlfile.write('%s\n' % textwrap.fill(description, width=74, initial_indent=' ', subsequent_indent=' ')) + else: + ctrlfile.write(c % tuple(pullData(fs, localdata))) + # more fields + + custom_fields_chunk = get_package_additional_metadata("ipk", localdata) + if custom_fields_chunk is not None: + ctrlfile.write(custom_fields_chunk) + ctrlfile.write("\n") + + mapping_rename_hook(localdata) + + def debian_cmp_remap(var): + # In debian '>' and '<' do not mean what it appears they mean + # '<' = less or equal + # '>' = greater or equal + # adjust these to the '<<' and '>>' equivalents + # + for dep in var: + for i, v in enumerate(var[dep]): + if (v or "").startswith("< "): + var[dep][i] = var[dep][i].replace("< ", "<< ") + elif (v or "").startswith("> "): + var[dep][i] = var[dep][i].replace("> ", ">> ") + + rdepends = bb.utils.explode_dep_versions2(localdata.getVar("RDEPENDS") or "") + debian_cmp_remap(rdepends) + rrecommends = bb.utils.explode_dep_versions2(localdata.getVar("RRECOMMENDS") or "") + debian_cmp_remap(rrecommends) + rsuggests = bb.utils.explode_dep_versions2(localdata.getVar("RSUGGESTS") or "") + debian_cmp_remap(rsuggests) + # Deliberately drop version information here, not wanted/supported by ipk + rprovides = dict.fromkeys(bb.utils.explode_dep_versions2(localdata.getVar("RPROVIDES") or ""), []) + rprovides = collections.OrderedDict(sorted(rprovides.items(), key=lambda x: x[0])) + debian_cmp_remap(rprovides) + rreplaces = bb.utils.explode_dep_versions2(localdata.getVar("RREPLACES") or "") + debian_cmp_remap(rreplaces) + rconflicts = bb.utils.explode_dep_versions2(localdata.getVar("RCONFLICTS") or "") + debian_cmp_remap(rconflicts) + + if rdepends: + ctrlfile.write("Depends: %s\n" % bb.utils.join_deps(rdepends)) + if rsuggests: + ctrlfile.write("Suggests: %s\n" % bb.utils.join_deps(rsuggests)) + if rrecommends: + ctrlfile.write("Recommends: %s\n" % bb.utils.join_deps(rrecommends)) + if rprovides: + ctrlfile.write("Provides: %s\n" % bb.utils.join_deps(rprovides)) + if rreplaces: + ctrlfile.write("Replaces: %s\n" % bb.utils.join_deps(rreplaces)) + if rconflicts: + ctrlfile.write("Conflicts: %s\n" % bb.utils.join_deps(rconflicts)) + src_uri = localdata.getVar("SRC_URI").strip() or "None" + if src_uri: + src_uri = re.sub("\s+", " ", src_uri) + ctrlfile.write("Source: %s\n" % " ".join(src_uri.split())) + ctrlfile.close() + + for script in ["preinst", "postinst", "prerm", "postrm"]: + scriptvar = localdata.getVar('pkg_%s' % script) + if not scriptvar: + continue + scriptfile = open(os.path.join(controldir, script), 'w') + scriptfile.write(scriptvar) + scriptfile.close() + os.chmod(os.path.join(controldir, script), 0o755) + + conffiles_str = ' '.join(get_conffiles(pkg, d)) + if conffiles_str: + conffiles = open(os.path.join(controldir, 'conffiles'), 'w') + for f in conffiles_str.split(): + if os.path.exists(oe.path.join(root, f)): + conffiles.write('%s\n' % f) + conffiles.close() + + os.chdir(basedir) + subprocess.check_output("PATH=\"%s\" %s %s %s" % (localdata.getVar("PATH"), + d.getVar("OPKGBUILDCMD"), pkg, pkgoutdir), shell=True) + + if d.getVar('IPK_SIGN_PACKAGES') == '1': + ipkver = "%s-%s" % (d.getVar('PKGV'), d.getVar('PKGR')) + ipk_to_sign = "%s/%s_%s_%s.ipk" % (pkgoutdir, pkgname, ipkver, d.getVar('PACKAGE_ARCH')) + sign_ipk(d, ipk_to_sign) + + cleanupcontrol(root) + bb.utils.unlockfile(lf) + + os.chdir(oldcwd) } +# Otherwise allarch packages may change depending on override configuration +do_package_ipk[vardepsexclude] = "OVERRIDES" SSTATETASKS += "do_package_write_ipk" -do_package_write_ipk[sstate-name] = "deploy-ipk" do_package_write_ipk[sstate-inputdirs] = "${PKGWRITEDIRIPK}" do_package_write_ipk[sstate-outputdirs] = "${DEPLOY_DIR_IPK}" python do_package_write_ipk_setscene () { - sstate_setscene(d) + tmpdir = d.getVar('TMPDIR') + + if os.access(os.path.join(tmpdir, "stamps", "IPK_PACKAGE_INDEX_CLEAN"), os.R_OK): + os.unlink(os.path.join(tmpdir, "stamps", "IPK_PACKAGE_INDEX_CLEAN")) + + sstate_setscene(d) } addtask do_package_write_ipk_setscene python () { - if bb.data.getVar('PACKAGES', d, True) != '': - deps = (bb.data.getVarFlag('do_package_write_ipk', 'depends', d) or "").split() - deps.append('opkg-utils-native:do_populate_sysroot') - deps.append('virtual/fakeroot-native:do_populate_sysroot') - bb.data.setVarFlag('do_package_write_ipk', 'depends', " ".join(deps), d) - bb.data.setVarFlag('do_package_write_ipk', 'fakeroot', "1", d) - bb.data.setVarFlag('do_package_write_ipk_setscene', 'fakeroot', "1", d) + if d.getVar('PACKAGES') != '': + deps = ' opkg-utils-native:do_populate_sysroot virtual/fakeroot-native:do_populate_sysroot' + d.appendVarFlag('do_package_write_ipk', 'depends', deps) + d.setVarFlag('do_package_write_ipk', 'fakeroot', "1") } python do_package_write_ipk () { - bb.build.exec_func("read_subpackage_metadata", d) - bb.build.exec_func("do_package_ipk", d) + bb.build.exec_func("read_subpackage_metadata", d) + bb.build.exec_func("do_package_ipk", d) } do_package_write_ipk[dirs] = "${PKGWRITEDIRIPK}" -addtask package_write_ipk before do_package_write after do_package +do_package_write_ipk[cleandirs] = "${PKGWRITEDIRIPK}" +do_package_write_ipk[umask] = "022" +do_package_write_ipk[depends] += "${@oe.utils.build_depends_string(d.getVar('PACKAGE_WRITE_DEPS'), 'do_populate_sysroot')}" +addtask package_write_ipk after do_packagedata do_package + +PACKAGEINDEXDEPS += "opkg-utils-native:do_populate_sysroot" +PACKAGEINDEXDEPS += "opkg-native:do_populate_sysroot" + +do_build[recrdeptask] += "do_package_write_ipk" |
