summaryrefslogtreecommitdiff
path: root/meta/classes/package_deb.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes/package_deb.bbclass')
-rw-r--r--meta/classes/package_deb.bbclass465
1 files changed, 186 insertions, 279 deletions
diff --git a/meta/classes/package_deb.bbclass b/meta/classes/package_deb.bbclass
index 48511dfe90..eacabcdb61 100644
--- a/meta/classes/package_deb.bbclass
+++ b/meta/classes/package_deb.bbclass
@@ -6,88 +6,39 @@ inherit package
IMAGE_PKGTYPE ?= "deb"
-DPKG_ARCH ?= "${TARGET_ARCH}"
+DPKG_ARCH ?= "${@debian_arch_map(d.getVar('TARGET_ARCH'), d.getVar('TUNE_FEATURES'))}"
+DPKG_ARCH[vardepvalue] = "${DPKG_ARCH}"
PKGWRITEDIRDEB = "${WORKDIR}/deploy-debs"
-python package_deb_fn () {
- d.setVar('PKGFN', d.getVar('PKG'))
-}
-
-addtask package_deb_install
-python do_package_deb_install () {
- pkg = d.getVar('PKG', True)
- pkgfn = d.getVar('PKGFN', True)
- rootfs = d.getVar('IMAGE_ROOTFS', True)
- debdir = d.getVar('DEPLOY_DIR_DEB', True)
- apt_config = d.expand('${STAGING_ETCDIR_NATIVE}/apt/apt.conf')
- stagingbindir = d.getVar('STAGING_BINDIR_NATIVE', True)
- tmpdir = d.getVar('TMPDIR', True)
-
- if None in (pkg,pkgfn,rootfs):
- raise bb.build.FuncFailed("missing variables (one or more of PKG, PKGFN, IMAGE_ROOTFS)")
- try:
- if not os.exists(rootfs):
- os.makedirs(rootfs)
- os.chdir(rootfs)
- except OSError:
- import sys
- raise bb.build.FuncFailed(str(sys.exc_value))
-
- # update packages file
- (exitstatus, output) = commands.getstatusoutput('dpkg-scanpackages %s > %s/Packages' % (debdir, debdir))
- if (exitstatus != 0 ):
- raise bb.build.FuncFailed(output)
-
- f = open(os.path.join(tmpdir, "stamps", "DEB_PACKAGE_INDEX_CLEAN"), "w")
- f.close()
-
- # NOTE: this env stuff is racy at best, we need something more capable
- # than 'commands' for command execution, which includes manipulating the
- # env of the fork+execve'd processs
-
- # Set up environment
- apt_config_backup = os.getenv('APT_CONFIG')
- os.putenv('APT_CONFIG', apt_config)
- path = os.getenv('PATH')
- os.putenv('PATH', '%s:%s' % (stagingbindir, os.getenv('PATH')))
-
- # install package
- commands.getstatusoutput('apt-get update')
- commands.getstatusoutput('apt-get install -y %s' % pkgfn)
-
- # revert environment
- os.putenv('APT_CONFIG', apt_config_backup)
- os.putenv('PATH', path)
-}
-
-#
-# Update the Packages index files in ${DEPLOY_DIR_DEB}
-#
-package_update_index_deb () {
-
- local debarchs=""
-
- if [ ! -z "${DEPLOY_KEEP_PACKAGES}" ]; then
- return
- fi
-
- for arch in ${PACKAGE_ARCHS} ${SDK_PACKAGE_ARCHS}; do
- if [ -e ${DEPLOY_DIR_DEB}/$arch ]; then
- debarchs="$debarchs $arch"
- fi
- done
-
- for arch in $debarchs; do
- if [ ! -d ${DEPLOY_DIR_DEB}/$arch ]; then
- continue;
- fi
- cd ${DEPLOY_DIR_DEB}/$arch
- dpkg-scanpackages . | gzip > Packages.gz
- echo "Label: $arch" > Release
- done
-}
-
+APTCONF_TARGET = "${WORKDIR}"
+
+APT_ARGS = "${@['', '--no-install-recommends'][d.getVar("NO_RECOMMENDATIONS") == "1"]}"
+
+def debian_arch_map(arch, tune):
+ tune_features = tune.split()
+ if arch == "allarch":
+ return "all"
+ if arch in ["i586", "i686"]:
+ return "i386"
+ if arch == "x86_64":
+ if "mx32" in tune_features:
+ return "x32"
+ return "amd64"
+ if arch.startswith("mips"):
+ endian = ["el", ""]["bigendian" in tune_features]
+ if "n64" in tune_features:
+ return "mips64" + endian
+ if "n32" in tune_features:
+ return "mipsn32" + endian
+ return "mips" + endian
+ if arch == "powerpc":
+ return arch + ["", "spe"]["spe" in tune_features]
+ if arch == "aarch64":
+ return "arm64"
+ if arch == "arm":
+ return arch + ["el", "hf"]["callconvention-hard" in tune_features]
+ return arch
#
# install a bunch of packages using apt
# the following shell variables needs to be set before calling this func:
@@ -95,134 +46,35 @@ package_update_index_deb () {
# INSTALL_BASEARCH_DEB - install base architecutre
# INSTALL_ARCHS_DEB - list of available archs
# INSTALL_PACKAGES_NORMAL_DEB - packages to be installed
-# INSTALL_PACKAGES_ATTEMPTONLY_DEB - packages attemped to be installed only
+# INSTALL_PACKAGES_ATTEMPTONLY_DEB - packages attempted to be installed only
# INSTALL_PACKAGES_LINGUAS_DEB - additional packages for uclibc
# INSTALL_TASK_DEB - task name
-package_install_internal_deb () {
-
- local target_rootfs="${INSTALL_ROOTFS_DEB}"
- local dpkg_arch="${INSTALL_BASEARCH_DEB}"
- local archs="${INSTALL_ARCHS_DEB}"
- local package_to_install="${INSTALL_PACKAGES_NORMAL_DEB}"
- local package_attemptonly="${INSTALL_PACKAGES_ATTEMPTONLY_DEB}"
- local package_linguas="${INSTALL_PACKAGES_LINGUAS_DEB}"
- local task="${INSTALL_TASK_DEB}"
-
- rm -f ${STAGING_ETCDIR_NATIVE}/apt/sources.list.rev
- rm -f ${STAGING_ETCDIR_NATIVE}/apt/preferences
-
- priority=1
- for arch in $archs; do
- if [ ! -d ${DEPLOY_DIR_DEB}/$arch ]; then
- continue;
- fi
-
- echo "deb file:${DEPLOY_DIR_DEB}/$arch/ ./" >> ${STAGING_ETCDIR_NATIVE}/apt/sources.list.rev
- (echo "Package: *"
- echo "Pin: release l=$arch"
- echo "Pin-Priority: $(expr 800 + $priority)"
- echo) >> ${STAGING_ETCDIR_NATIVE}/apt/preferences
- priority=$(expr $priority + 5)
- done
-
- tac ${STAGING_ETCDIR_NATIVE}/apt/sources.list.rev > ${STAGING_ETCDIR_NATIVE}/apt/sources.list
-
- cat "${STAGING_ETCDIR_NATIVE}/apt/apt.conf.sample" \
- | sed -e "s#Architecture \".*\";#Architecture \"${dpkg_arch}\";#" \
- | sed -e "s:#ROOTFS#:${target_rootfs}:g" \
- > "${STAGING_ETCDIR_NATIVE}/apt/apt-${task}.conf"
-
- export APT_CONFIG="${STAGING_ETCDIR_NATIVE}/apt/apt-${task}.conf"
-
- mkdir -p ${target_rootfs}/var/lib/dpkg/info
- mkdir -p ${target_rootfs}/var/lib/dpkg/updates
-
- > ${target_rootfs}/var/lib/dpkg/status
- > ${target_rootfs}/var/lib/dpkg/available
-
- apt-get update
-
- # Uclibc builds don't provide this stuff..
- if [ x${TARGET_OS} = "xlinux" ] || [ x${TARGET_OS} = "xlinux-gnueabi" ] ; then
- if [ ! -z "${package_linguas}" ]; then
- apt-get install glibc-localedata-i18n --force-yes --allow-unauthenticated
- if [ $? -ne 0 ]; then
- exit 1
- fi
- for i in ${package_linguas}; do
- apt-get install $i --force-yes --allow-unauthenticated
- if [ $? -ne 0 ]; then
- exit 1
- fi
- done
- fi
- fi
-
- # normal install
- for i in ${package_to_install}; do
- apt-get install $i --force-yes --allow-unauthenticated
- if [ $? -ne 0 ]; then
- exit 1
- fi
- done
-
- rm -f `dirname ${BB_LOGFILE}`/log.do_${task}-attemptonly.${PID}
- if [ ! -z "${package_attemptonly}" ]; then
- for i in ${package_attemptonly}; do
- apt-get install $i --force-yes --allow-unauthenticated >> `dirname ${BB_LOGFILE}`/log.do_${task}-attemptonly.${PID} 2>&1 || true
- done
- fi
-
- find ${target_rootfs} -name \*.dpkg-new | for i in `cat`; do
- mv $i `echo $i | sed -e's,\.dpkg-new$,,'`
- done
-
- # Mark all packages installed
- sed -i -e "s/Status: install ok unpacked/Status: install ok installed/;" ${target_rootfs}/var/lib/dpkg/status
-}
-
-deb_log_check() {
- target="$1"
- lf_path="$2"
-
- lf_txt="`cat $lf_path`"
- for keyword_die in "^E:"
- do
- if (echo "$lf_txt" | grep -v log_check | grep "$keyword_die") >/dev/null 2>&1
- then
- echo "log_check: There were error messages in the logfile"
- echo -e "log_check: Matched keyword: [$keyword_die]\n"
- echo "$lf_txt" | grep -v log_check | grep -C 5 -i "$keyword_die"
- echo ""
- do_exit=1
- fi
- done
- test "$do_exit" = 1 && exit 1
- true
-}
-
python do_package_deb () {
import re, copy
import textwrap
import subprocess
+ import collections
+ import codecs
+
+ oldcwd = os.getcwd()
- workdir = d.getVar('WORKDIR', True)
+ workdir = d.getVar('WORKDIR')
if not workdir:
bb.error("WORKDIR not defined, unable to package")
return
- outdir = d.getVar('PKGWRITEDIRDEB', True)
+ outdir = d.getVar('PKGWRITEDIRDEB')
if not outdir:
bb.error("PKGWRITEDIRDEB not defined, unable to package")
return
- packages = d.getVar('PACKAGES', True)
+ packages = d.getVar('PACKAGES')
if not packages:
bb.debug(1, "PACKAGES not defined, nothing to package")
return
- tmpdir = d.getVar('TMPDIR', True)
+ tmpdir = d.getVar('TMPDIR')
if os.access(os.path.join(tmpdir, "stamps", "DEB_PACKAGE_INDEX_CLEAN"),os.R_OK):
os.unlink(os.path.join(tmpdir, "stamps", "DEB_PACKAGE_INDEX_CLEAN"))
@@ -231,7 +83,13 @@ python do_package_deb () {
bb.debug(1, "No packages; nothing to do")
return
- pkgdest = d.getVar('PKGDEST', True)
+ pkgdest = d.getVar('PKGDEST')
+
+ 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)
@@ -241,45 +99,35 @@ python do_package_deb () {
localdata.setVar('ROOT', '')
localdata.setVar('ROOT_%s' % pkg, root)
- pkgname = localdata.getVar('PKG_%s' % pkg, True)
+ pkgname = localdata.getVar('PKG_%s' % pkg)
if not pkgname:
pkgname = pkg
localdata.setVar('PKG', pkgname)
- localdata.setVar('OVERRIDES', pkg)
+ localdata.setVar('OVERRIDES', d.getVar("OVERRIDES", False) + ":" + pkg)
- bb.data.update_data(localdata)
basedir = os.path.join(os.path.dirname(root))
- pkgoutdir = os.path.join(outdir, localdata.getVar('PACKAGE_ARCH', True))
- bb.mkdirhier(pkgoutdir)
+ pkgoutdir = os.path.join(outdir, localdata.getVar('PACKAGE_ARCH'))
+ bb.utils.mkdirhier(pkgoutdir)
os.chdir(root)
+ cleanupcontrol(root)
from glob import glob
g = glob('*')
- try:
- del g[g.index('DEBIAN')]
- del g[g.index('./DEBIAN')]
- except ValueError:
- pass
- if not g and localdata.getVar('ALLOW_EMPTY') != "1":
- bb.note("Not creating empty archive for %s-%s-%s" % (pkg, localdata.getVar('PKGV', True), localdata.getVar('PKGR', True)))
+ 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, 'DEBIAN')
- bb.mkdirhier(controldir)
- os.chmod(controldir, 0755)
- try:
- ctrlfile = file(os.path.join(controldir, 'control'), 'wb')
- # import codecs
- # ctrlfile = codecs.open("someFile", "w", "utf-8")
- except OSError:
- bb.utils.unlockfile(lf)
- raise bb.build.FuncFailed("unable to open control file for writing.")
+ bb.utils.mkdirhier(controldir)
+ os.chmod(controldir, 0o755)
+
+ ctrlfile = codecs.open(os.path.join(controldir, 'control'), 'w', 'utf-8')
fields = []
- pe = d.getVar('PKGE', True)
+ pe = d.getVar('PKGE')
if pe and int(pe) > 0:
fields.append(["Version: %s:%s-%s\n", ['PKGE', 'PKGV', 'PKGR']])
else:
@@ -291,7 +139,8 @@ python do_package_deb () {
fields.append(["Architecture: %s\n", ['DPKG_ARCH']])
fields.append(["OE: %s\n", ['PN']])
fields.append(["PackageArch: %s\n", ['PACKAGE_ARCH']])
- fields.append(["Homepage: %s\n", ['HOMEPAGE']])
+ if d.getVar('HOMEPAGE'):
+ fields.append(["Homepage: %s\n", ['HOMEPAGE']])
# Package, Version, Maintainer, Description - mandatory
# Section, Priority, Essential, Architecture, Source, Depends, Pre-Depends, Recommends, Suggests, Conflicts, Replaces, Provides - Optional
@@ -300,122 +149,177 @@ python do_package_deb () {
def pullData(l, d):
l2 = []
for i in l:
- data = d.getVar(i, True)
+ data = d.getVar(i)
if data is None:
- raise KeyError(f)
- if i == 'DPKG_ARCH' and d.getVar('PACKAGE_ARCH', True) == 'all':
+ raise KeyError(i)
+ if i == 'DPKG_ARCH' and d.getVar('PACKAGE_ARCH') == 'all':
data = 'all'
+ elif i == 'PACKAGE_ARCH' or i == 'DPKG_ARCH':
+ # The params in deb package control don't allow character
+ # `_', so change the arch's `_' to `-'. Such as `x86_64'
+ # -->`x86-64'
+ data = data.replace('_', '-')
l2.append(data)
return l2
ctrlfile.write("Package: %s\n" % pkgname)
+ if d.getVar('PACKAGE_ARCH') == "all":
+ ctrlfile.write("Multi-Arch: foreign\n")
# check for required fields
- try:
- for (c, fs) in fields:
- for f in fs:
- if localdata.getVar(f) is None:
- raise KeyError(f)
- # Special behavior for description...
- if 'DESCRIPTION' in fs:
- summary = localdata.getVar('SUMMARY', True) or localdata.getVar('DESCRIPTION', True) or "."
- description = localdata.getVar('DESCRIPTION', True) or "."
- description = textwrap.dedent(description).strip()
- ctrlfile.write('Description: %s\n' % unicode(summary))
- ctrlfile.write('%s\n' % unicode(textwrap.fill(description, width=74, initial_indent=' ', subsequent_indent=' ')))
- else:
- ctrlfile.write(unicode(c % tuple(pullData(fs, localdata))))
- except KeyError:
- import sys
- (type, value, traceback) = sys.exc_info()
- bb.utils.unlockfile(lf)
- ctrlfile.close()
- raise bb.build.FuncFailed("Missing field for deb generation: %s" % value)
+ for (c, fs) in fields:
+ # 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'):
+ ctrlfile.write(' %s\n' % (t.strip() or '.'))
+ else:
+ # Auto indent
+ ctrlfile.write('%s\n' % textwrap.fill(description.strip(), width=74, initial_indent=' ', subsequent_indent=' '))
+
+ else:
+ ctrlfile.write(c % tuple(pullData(fs, localdata)))
+
# more fields
+ custom_fields_chunk = get_package_additional_metadata("deb", localdata)
+ if custom_fields_chunk:
+ ctrlfile.write(custom_fields_chunk)
+ ctrlfile.write("\n")
+
mapping_rename_hook(localdata)
- rdepends = bb.utils.explode_dep_versions(localdata.getVar("RDEPENDS", True) or "")
- for dep in rdepends:
+ def debian_cmp_remap(var):
+ # dpkg does not allow for '(' or ')' in a dependency name
+ # replace these instances with '__' and '__'
+ #
+ # 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:
+ if '(' in dep:
+ newdep = dep.replace('(', '__')
+ newdep = newdep.replace(')', '__')
+ if newdep != dep:
+ var[newdep] = var[dep]
+ del var[dep]
+ 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)
+ for dep in list(rdepends.keys()):
+ if dep == pkg:
+ del rdepends[dep]
+ continue
if '*' in dep:
del rdepends[dep]
- rrecommends = bb.utils.explode_dep_versions(localdata.getVar("RRECOMMENDS", True) or "")
- for dep in rrecommends:
+ rrecommends = bb.utils.explode_dep_versions2(localdata.getVar("RRECOMMENDS") or "")
+ debian_cmp_remap(rrecommends)
+ for dep in list(rrecommends.keys()):
if '*' in dep:
del rrecommends[dep]
- rsuggests = bb.utils.explode_dep_versions(localdata.getVar("RSUGGESTS", True) or "")
- rprovides = bb.utils.explode_dep_versions(localdata.getVar("RPROVIDES", True) or "")
- rreplaces = bb.utils.explode_dep_versions(localdata.getVar("RREPLACES", True) or "")
- rconflicts = bb.utils.explode_dep_versions(localdata.getVar("RCONFLICTS", True) or "")
+ rsuggests = bb.utils.explode_dep_versions2(localdata.getVar("RSUGGESTS") or "")
+ debian_cmp_remap(rsuggests)
+ # Deliberately drop version information here, not wanted/supported by deb
+ rprovides = dict.fromkeys(bb.utils.explode_dep_versions2(localdata.getVar("RPROVIDES") or ""), [])
+ # Remove file paths if any from rprovides, debian does not support custom providers
+ for key in list(rprovides.keys()):
+ if key.startswith('/'):
+ del rprovides[key]
+ 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" % unicode(bb.utils.join_deps(rdepends)))
+ ctrlfile.write("Depends: %s\n" % bb.utils.join_deps(rdepends))
if rsuggests:
- ctrlfile.write("Suggests: %s\n" % unicode(bb.utils.join_deps(rsuggests)))
+ ctrlfile.write("Suggests: %s\n" % bb.utils.join_deps(rsuggests))
if rrecommends:
- ctrlfile.write("Recommends: %s\n" % unicode(bb.utils.join_deps(rrecommends)))
+ ctrlfile.write("Recommends: %s\n" % bb.utils.join_deps(rrecommends))
if rprovides:
- ctrlfile.write("Provides: %s\n" % unicode(bb.utils.join_deps(rprovides)))
+ ctrlfile.write("Provides: %s\n" % bb.utils.join_deps(rprovides))
if rreplaces:
- ctrlfile.write("Replaces: %s\n" % unicode(bb.utils.join_deps(rreplaces)))
+ ctrlfile.write("Replaces: %s\n" % bb.utils.join_deps(rreplaces))
if rconflicts:
- ctrlfile.write("Conflicts: %s\n" % unicode(bb.utils.join_deps(rconflicts)))
+ ctrlfile.write("Conflicts: %s\n" % bb.utils.join_deps(rconflicts))
ctrlfile.close()
for script in ["preinst", "postinst", "prerm", "postrm"]:
- scriptvar = localdata.getVar('pkg_%s' % script, True)
+ scriptvar = localdata.getVar('pkg_%s' % script)
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("#!/bin/sh\n")
- scriptfile.write(scriptvar)
+ scriptvar = scriptvar.strip()
+ scriptfile = open(os.path.join(controldir, script), 'w')
+
+ if scriptvar.startswith("#!"):
+ pos = scriptvar.find("\n") + 1
+ scriptfile.write(scriptvar[:pos])
+ else:
+ pos = 0
+ scriptfile.write("#!/bin/sh\n")
+
+ # Prevent the prerm/postrm scripts from being run during an upgrade
+ if script in ('prerm', 'postrm'):
+ scriptfile.write('[ "$1" != "upgrade" ] || exit 0\n')
+
+ scriptfile.write(scriptvar[pos:])
+ scriptfile.write('\n')
scriptfile.close()
- os.chmod(os.path.join(controldir, script), 0755)
+ os.chmod(os.path.join(controldir, script), 0o755)
- conffiles_str = localdata.getVar("CONFFILES", True)
+ conffiles_str = ' '.join(get_conffiles(pkg, d))
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.")
+ conffiles = open(os.path.join(controldir, 'conffiles'), 'w')
for f in conffiles_str.split():
- conffiles.write('%s\n' % f)
+ if os.path.exists(oe.path.join(root, f)):
+ conffiles.write('%s\n' % f)
conffiles.close()
os.chdir(basedir)
- ret = subprocess.call("PATH=\"%s\" dpkg-deb -b %s %s" % (localdata.getVar("PATH", True), root, pkgoutdir), shell=True)
- if ret != 0:
- bb.utils.prunedir(controldir)
- bb.utils.unlockfile(lf)
- raise bb.build.FuncFailed("dpkg-deb execution failed")
+ subprocess.check_output("PATH=\"%s\" dpkg-deb -b %s %s" % (localdata.getVar("PATH"), root, pkgoutdir), shell=True)
- bb.utils.prunedir(controldir)
+ cleanupcontrol(root)
bb.utils.unlockfile(lf)
+ os.chdir(oldcwd)
}
+# Indirect references to these vars
+do_package_write_deb[vardeps] += "PKGV PKGR PKGV DESCRIPTION SECTION PRIORITY MAINTAINER DPKG_ARCH PN HOMEPAGE"
+# Otherwise allarch packages may change depending on override configuration
+do_package_deb[vardepsexclude] = "OVERRIDES"
+
SSTATETASKS += "do_package_write_deb"
-do_package_write_deb[sstate-name] = "deploy-deb"
do_package_write_deb[sstate-inputdirs] = "${PKGWRITEDIRDEB}"
do_package_write_deb[sstate-outputdirs] = "${DEPLOY_DIR_DEB}"
python do_package_write_deb_setscene () {
+ tmpdir = d.getVar('TMPDIR')
+
+ if os.access(os.path.join(tmpdir, "stamps", "DEB_PACKAGE_INDEX_CLEAN"),os.R_OK):
+ os.unlink(os.path.join(tmpdir, "stamps", "DEB_PACKAGE_INDEX_CLEAN"))
+
sstate_setscene(d)
}
addtask do_package_write_deb_setscene
python () {
- if d.getVar('PACKAGES', True) != '':
+ if d.getVar('PACKAGES') != '':
deps = ' dpkg-native:do_populate_sysroot virtual/fakeroot-native:do_populate_sysroot'
d.appendVarFlag('do_package_write_deb', 'depends', deps)
d.setVarFlag('do_package_write_deb', 'fakeroot', "1")
- d.setVarFlag('do_package_write_deb_setscene', 'fakeroot', "1")
-
- # Map TARGET_ARCH to Debian's ideas about architectures
- if d.getVar('DPKG_ARCH', True) in ["x86", "i486", "i586", "i686", "pentium"]:
- d.setVar('DPKG_ARCH', 'i386')
}
python do_package_write_deb () {
@@ -423,10 +327,13 @@ python do_package_write_deb () {
bb.build.exec_func("do_package_deb", d)
}
do_package_write_deb[dirs] = "${PKGWRITEDIRDEB}"
+do_package_write_deb[cleandirs] = "${PKGWRITEDIRDEB}"
do_package_write_deb[umask] = "022"
-addtask package_write_deb before do_package_write after do_package
+do_package_write_deb[depends] += "${@oe.utils.build_depends_string(d.getVar('PACKAGE_WRITE_DEPS'), 'do_populate_sysroot')}"
+addtask package_write_deb after do_packagedata do_package
-PACKAGEINDEXES += "package_update_index_deb;"
PACKAGEINDEXDEPS += "dpkg-native:do_populate_sysroot"
PACKAGEINDEXDEPS += "apt-native:do_populate_sysroot"
+
+do_build[recrdeptask] += "do_package_write_deb"