2007-08-07 14:34:33 +00:00
|
|
|
#
|
2008-05-20 14:58:34 +00:00
|
|
|
# Copyright 2006-2008 OpenedHand Ltd.
|
2007-08-07 14:34:33 +00:00
|
|
|
#
|
|
|
|
|
2006-09-19 09:04:09 +00:00
|
|
|
inherit package
|
2007-04-03 11:31:02 +00:00
|
|
|
|
2006-09-19 09:04:09 +00:00
|
|
|
IMAGE_PKGTYPE ?= "deb"
|
|
|
|
|
2007-09-27 20:26:26 +00:00
|
|
|
DPKG_ARCH ?= "${TARGET_ARCH}"
|
|
|
|
|
2010-08-05 09:52:10 +00:00
|
|
|
PKGWRITEDIRDEB = "${WORKDIR}/deploy-debs"
|
|
|
|
|
2013-08-13 15:50:55 +00:00
|
|
|
APTCONF_TARGET = "${WORKDIR}"
|
|
|
|
|
2013-08-13 00:47:11 +00:00
|
|
|
APT_ARGS = "${@['', '--no-install-recommends'][d.getVar("NO_RECOMMENDATIONS", True) == "1"]}"
|
|
|
|
|
2011-01-30 04:26:14 +00:00
|
|
|
#
|
|
|
|
# install a bunch of packages using apt
|
|
|
|
# the following shell variables needs to be set before calling this func:
|
|
|
|
# INSTALL_ROOTFS_DEB - install root dir
|
|
|
|
# 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_LINGUAS_DEB - additional packages for uclibc
|
|
|
|
# INSTALL_TASK_DEB - task name
|
|
|
|
|
2006-09-19 09:04:09 +00:00
|
|
|
python do_package_deb () {
|
2009-11-08 22:32:43 +00:00
|
|
|
import re, copy
|
2010-09-29 15:11:24 +00:00
|
|
|
import textwrap
|
2012-05-29 14:53:06 +00:00
|
|
|
import subprocess
|
2006-09-19 09:04:09 +00:00
|
|
|
|
Convert to use direct access to the data store (instead of bb.data.*Var*())
This is the result of running the following over the metadata:
sed \
-e 's:bb.data.\(setVar([^,()]*,[^,()]*\), *\([^ )]*\) *):\2.\1):g' \
-e 's:bb.data.\(setVarFlag([^,()]*,[^,()]*,[^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^() ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-i `grep -ril bb.data *`
(From OE-Core rev: b22831fd63164c4db9c0b72934d7d734a6585251)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-09 15:00:01 +00:00
|
|
|
workdir = d.getVar('WORKDIR', True)
|
2006-09-19 09:04:09 +00:00
|
|
|
if not workdir:
|
|
|
|
bb.error("WORKDIR not defined, unable to package")
|
|
|
|
return
|
|
|
|
|
Convert to use direct access to the data store (instead of bb.data.*Var*())
This is the result of running the following over the metadata:
sed \
-e 's:bb.data.\(setVar([^,()]*,[^,()]*\), *\([^ )]*\) *):\2.\1):g' \
-e 's:bb.data.\(setVarFlag([^,()]*,[^,()]*,[^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^() ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-i `grep -ril bb.data *`
(From OE-Core rev: b22831fd63164c4db9c0b72934d7d734a6585251)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-09 15:00:01 +00:00
|
|
|
outdir = d.getVar('PKGWRITEDIRDEB', True)
|
2006-09-19 09:04:09 +00:00
|
|
|
if not outdir:
|
2010-08-05 09:52:10 +00:00
|
|
|
bb.error("PKGWRITEDIRDEB not defined, unable to package")
|
2006-09-19 09:04:09 +00:00
|
|
|
return
|
|
|
|
|
Convert to use direct access to the data store (instead of bb.data.*Var*())
This is the result of running the following over the metadata:
sed \
-e 's:bb.data.\(setVar([^,()]*,[^,()]*\), *\([^ )]*\) *):\2.\1):g' \
-e 's:bb.data.\(setVarFlag([^,()]*,[^,()]*,[^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^() ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-i `grep -ril bb.data *`
(From OE-Core rev: b22831fd63164c4db9c0b72934d7d734a6585251)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-09 15:00:01 +00:00
|
|
|
packages = d.getVar('PACKAGES', True)
|
2006-09-19 09:04:09 +00:00
|
|
|
if not packages:
|
|
|
|
bb.debug(1, "PACKAGES not defined, nothing to package")
|
|
|
|
return
|
|
|
|
|
Convert to use direct access to the data store (instead of bb.data.*Var*())
This is the result of running the following over the metadata:
sed \
-e 's:bb.data.\(setVar([^,()]*,[^,()]*\), *\([^ )]*\) *):\2.\1):g' \
-e 's:bb.data.\(setVarFlag([^,()]*,[^,()]*,[^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^() ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-i `grep -ril bb.data *`
(From OE-Core rev: b22831fd63164c4db9c0b72934d7d734a6585251)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-09 15:00:01 +00:00
|
|
|
tmpdir = d.getVar('TMPDIR', True)
|
2007-09-27 11:48:36 +00:00
|
|
|
|
|
|
|
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"))
|
2006-09-19 09:04:09 +00:00
|
|
|
|
|
|
|
if packages == []:
|
|
|
|
bb.debug(1, "No packages; nothing to do")
|
|
|
|
return
|
|
|
|
|
Convert to use direct access to the data store (instead of bb.data.*Var*())
This is the result of running the following over the metadata:
sed \
-e 's:bb.data.\(setVar([^,()]*,[^,()]*\), *\([^ )]*\) *):\2.\1):g' \
-e 's:bb.data.\(setVarFlag([^,()]*,[^,()]*,[^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^() ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-i `grep -ril bb.data *`
(From OE-Core rev: b22831fd63164c4db9c0b72934d7d734a6585251)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-09 15:00:01 +00:00
|
|
|
pkgdest = d.getVar('PKGDEST', True)
|
2011-01-21 16:47:01 +00:00
|
|
|
|
2013-11-05 22:08:56 +00:00
|
|
|
def cleanupcontrol(root):
|
|
|
|
for p in ['CONTROL', 'DEBIAN']:
|
|
|
|
p = os.path.join(root, p)
|
|
|
|
if os.path.exists(p):
|
|
|
|
bb.utils.prunedir(p)
|
|
|
|
|
2006-09-19 09:04:09 +00:00
|
|
|
for pkg in packages.split():
|
|
|
|
localdata = bb.data.createCopy(d)
|
2007-11-24 23:05:05 +00:00
|
|
|
root = "%s/%s" % (pkgdest, pkg)
|
2006-09-19 09:04:09 +00:00
|
|
|
|
2007-11-24 14:55:57 +00:00
|
|
|
lf = bb.utils.lockfile(root + ".lock")
|
2007-08-24 16:50:56 +00:00
|
|
|
|
Convert to use direct access to the data store (instead of bb.data.*Var*())
This is the result of running the following over the metadata:
sed \
-e 's:bb.data.\(setVar([^,()]*,[^,()]*\), *\([^ )]*\) *):\2.\1):g' \
-e 's:bb.data.\(setVarFlag([^,()]*,[^,()]*,[^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^() ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-i `grep -ril bb.data *`
(From OE-Core rev: b22831fd63164c4db9c0b72934d7d734a6585251)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-09 15:00:01 +00:00
|
|
|
localdata.setVar('ROOT', '')
|
|
|
|
localdata.setVar('ROOT_%s' % pkg, root)
|
|
|
|
pkgname = localdata.getVar('PKG_%s' % pkg, True)
|
2006-09-19 09:04:09 +00:00
|
|
|
if not pkgname:
|
|
|
|
pkgname = pkg
|
Convert to use direct access to the data store (instead of bb.data.*Var*())
This is the result of running the following over the metadata:
sed \
-e 's:bb.data.\(setVar([^,()]*,[^,()]*\), *\([^ )]*\) *):\2.\1):g' \
-e 's:bb.data.\(setVarFlag([^,()]*,[^,()]*,[^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^() ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-i `grep -ril bb.data *`
(From OE-Core rev: b22831fd63164c4db9c0b72934d7d734a6585251)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-09 15:00:01 +00:00
|
|
|
localdata.setVar('PKG', pkgname)
|
2006-09-19 09:04:09 +00:00
|
|
|
|
Convert to use direct access to the data store (instead of bb.data.*Var*())
This is the result of running the following over the metadata:
sed \
-e 's:bb.data.\(setVar([^,()]*,[^,()]*\), *\([^ )]*\) *):\2.\1):g' \
-e 's:bb.data.\(setVarFlag([^,()]*,[^,()]*,[^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^() ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-i `grep -ril bb.data *`
(From OE-Core rev: b22831fd63164c4db9c0b72934d7d734a6585251)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-09 15:00:01 +00:00
|
|
|
localdata.setVar('OVERRIDES', pkg)
|
2006-09-19 09:04:09 +00:00
|
|
|
|
|
|
|
bb.data.update_data(localdata)
|
|
|
|
basedir = os.path.join(os.path.dirname(root))
|
|
|
|
|
Convert to use direct access to the data store (instead of bb.data.*Var*())
This is the result of running the following over the metadata:
sed \
-e 's:bb.data.\(setVar([^,()]*,[^,()]*\), *\([^ )]*\) *):\2.\1):g' \
-e 's:bb.data.\(setVarFlag([^,()]*,[^,()]*,[^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^() ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-i `grep -ril bb.data *`
(From OE-Core rev: b22831fd63164c4db9c0b72934d7d734a6585251)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-09 15:00:01 +00:00
|
|
|
pkgoutdir = os.path.join(outdir, localdata.getVar('PACKAGE_ARCH', True))
|
2013-09-01 07:52:40 +00:00
|
|
|
bb.utils.mkdirhier(pkgoutdir)
|
2006-09-19 09:04:09 +00:00
|
|
|
|
|
|
|
os.chdir(root)
|
2013-11-05 22:08:56 +00:00
|
|
|
cleanupcontrol(root)
|
2006-09-19 09:04:09 +00:00
|
|
|
from glob import glob
|
|
|
|
g = glob('*')
|
Convert to use direct access to the data store (instead of bb.data.*Var*())
This is the result of running the following over the metadata:
sed \
-e 's:bb.data.\(setVar([^,()]*,[^,()]*\), *\([^ )]*\) *):\2.\1):g' \
-e 's:bb.data.\(setVarFlag([^,()]*,[^,()]*,[^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^() ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-i `grep -ril bb.data *`
(From OE-Core rev: b22831fd63164c4db9c0b72934d7d734a6585251)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-09 15:00:01 +00:00
|
|
|
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)))
|
2007-11-24 14:55:57 +00:00
|
|
|
bb.utils.unlockfile(lf)
|
2006-09-19 09:04:09 +00:00
|
|
|
continue
|
2007-09-27 11:48:36 +00:00
|
|
|
|
2006-09-19 09:04:09 +00:00
|
|
|
controldir = os.path.join(root, 'DEBIAN')
|
2013-09-01 07:52:40 +00:00
|
|
|
bb.utils.mkdirhier(controldir)
|
2007-03-31 14:04:49 +00:00
|
|
|
os.chmod(controldir, 0755)
|
2006-09-19 09:04:09 +00:00
|
|
|
try:
|
2013-05-09 16:05:58 +00:00
|
|
|
ctrlfile = open(os.path.join(controldir, 'control'), 'w')
|
2006-09-19 09:04:09 +00:00
|
|
|
# import codecs
|
|
|
|
# ctrlfile = codecs.open("someFile", "w", "utf-8")
|
|
|
|
except OSError:
|
2007-11-24 14:55:57 +00:00
|
|
|
bb.utils.unlockfile(lf)
|
2006-09-19 09:04:09 +00:00
|
|
|
raise bb.build.FuncFailed("unable to open control file for writing.")
|
|
|
|
|
|
|
|
fields = []
|
Convert to use direct access to the data store (instead of bb.data.*Var*())
This is the result of running the following over the metadata:
sed \
-e 's:bb.data.\(setVar([^,()]*,[^,()]*\), *\([^ )]*\) *):\2.\1):g' \
-e 's:bb.data.\(setVarFlag([^,()]*,[^,()]*,[^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^() ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-i `grep -ril bb.data *`
(From OE-Core rev: b22831fd63164c4db9c0b72934d7d734a6585251)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-09 15:00:01 +00:00
|
|
|
pe = d.getVar('PKGE', True)
|
2007-05-31 22:51:19 +00:00
|
|
|
if pe and int(pe) > 0:
|
2011-05-19 02:17:43 +00:00
|
|
|
fields.append(["Version: %s:%s-%s\n", ['PKGE', 'PKGV', 'PKGR']])
|
2007-05-31 22:51:19 +00:00
|
|
|
else:
|
2011-05-19 02:17:43 +00:00
|
|
|
fields.append(["Version: %s-%s\n", ['PKGV', 'PKGR']])
|
2006-09-19 09:04:09 +00:00
|
|
|
fields.append(["Description: %s\n", ['DESCRIPTION']])
|
|
|
|
fields.append(["Section: %s\n", ['SECTION']])
|
|
|
|
fields.append(["Priority: %s\n", ['PRIORITY']])
|
|
|
|
fields.append(["Maintainer: %s\n", ['MAINTAINER']])
|
2007-09-27 20:26:26 +00:00
|
|
|
fields.append(["Architecture: %s\n", ['DPKG_ARCH']])
|
2007-05-31 22:51:19 +00:00
|
|
|
fields.append(["OE: %s\n", ['PN']])
|
2012-07-23 21:42:26 +00:00
|
|
|
fields.append(["PackageArch: %s\n", ['PACKAGE_ARCH']])
|
2014-02-06 13:33:45 +00:00
|
|
|
if d.getVar('HOMEPAGE', True):
|
|
|
|
fields.append(["Homepage: %s\n", ['HOMEPAGE']])
|
2006-09-19 09:04:09 +00:00
|
|
|
|
2010-08-25 14:40:34 +00:00
|
|
|
# Package, Version, Maintainer, Description - mandatory
|
|
|
|
# Section, Priority, Essential, Architecture, Source, Depends, Pre-Depends, Recommends, Suggests, Conflicts, Replaces, Provides - Optional
|
2006-09-19 09:04:09 +00:00
|
|
|
|
|
|
|
|
|
|
|
def pullData(l, d):
|
|
|
|
l2 = []
|
|
|
|
for i in l:
|
Convert to use direct access to the data store (instead of bb.data.*Var*())
This is the result of running the following over the metadata:
sed \
-e 's:bb.data.\(setVar([^,()]*,[^,()]*\), *\([^ )]*\) *):\2.\1):g' \
-e 's:bb.data.\(setVarFlag([^,()]*,[^,()]*,[^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^() ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-i `grep -ril bb.data *`
(From OE-Core rev: b22831fd63164c4db9c0b72934d7d734a6585251)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-09 15:00:01 +00:00
|
|
|
data = d.getVar(i, True)
|
2006-11-24 17:23:05 +00:00
|
|
|
if data is None:
|
|
|
|
raise KeyError(f)
|
Convert to use direct access to the data store (instead of bb.data.*Var*())
This is the result of running the following over the metadata:
sed \
-e 's:bb.data.\(setVar([^,()]*,[^,()]*\), *\([^ )]*\) *):\2.\1):g' \
-e 's:bb.data.\(setVarFlag([^,()]*,[^,()]*,[^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^() ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-i `grep -ril bb.data *`
(From OE-Core rev: b22831fd63164c4db9c0b72934d7d734a6585251)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-09 15:00:01 +00:00
|
|
|
if i == 'DPKG_ARCH' and d.getVar('PACKAGE_ARCH', True) == 'all':
|
2006-11-24 17:23:05 +00:00
|
|
|
data = 'all'
|
2013-03-02 09:12:58 +00:00
|
|
|
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('_', '-')
|
2006-11-24 17:23:05 +00:00
|
|
|
l2.append(data)
|
2006-09-19 09:04:09 +00:00
|
|
|
return l2
|
|
|
|
|
|
|
|
ctrlfile.write("Package: %s\n" % pkgname)
|
|
|
|
# check for required fields
|
|
|
|
try:
|
|
|
|
for (c, fs) in fields:
|
2010-09-29 15:11:24 +00:00
|
|
|
for f in fs:
|
Convert to use direct access to the data store (instead of bb.data.*Var*())
This is the result of running the following over the metadata:
sed \
-e 's:bb.data.\(setVar([^,()]*,[^,()]*\), *\([^ )]*\) *):\2.\1):g' \
-e 's:bb.data.\(setVarFlag([^,()]*,[^,()]*,[^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^() ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-i `grep -ril bb.data *`
(From OE-Core rev: b22831fd63164c4db9c0b72934d7d734a6585251)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-09 15:00:01 +00:00
|
|
|
if localdata.getVar(f) is None:
|
2010-09-29 15:11:24 +00:00
|
|
|
raise KeyError(f)
|
|
|
|
# Special behavior for description...
|
|
|
|
if 'DESCRIPTION' in fs:
|
Convert to use direct access to the data store (instead of bb.data.*Var*())
This is the result of running the following over the metadata:
sed \
-e 's:bb.data.\(setVar([^,()]*,[^,()]*\), *\([^ )]*\) *):\2.\1):g' \
-e 's:bb.data.\(setVarFlag([^,()]*,[^,()]*,[^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^() ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-i `grep -ril bb.data *`
(From OE-Core rev: b22831fd63164c4db9c0b72934d7d734a6585251)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-09 15:00:01 +00:00
|
|
|
summary = localdata.getVar('SUMMARY', True) or localdata.getVar('DESCRIPTION', True) or "."
|
2013-06-19 05:25:38 +00:00
|
|
|
ctrlfile.write('Description: %s\n' % unicode(summary))
|
Convert to use direct access to the data store (instead of bb.data.*Var*())
This is the result of running the following over the metadata:
sed \
-e 's:bb.data.\(setVar([^,()]*,[^,()]*\), *\([^ )]*\) *):\2.\1):g' \
-e 's:bb.data.\(setVarFlag([^,()]*,[^,()]*,[^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^() ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-i `grep -ril bb.data *`
(From OE-Core rev: b22831fd63164c4db9c0b72934d7d734a6585251)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-09 15:00:01 +00:00
|
|
|
description = localdata.getVar('DESCRIPTION', True) or "."
|
2010-09-29 15:11:24 +00:00
|
|
|
description = textwrap.dedent(description).strip()
|
2013-06-19 05:25:38 +00:00
|
|
|
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
|
|
|
|
ctrlfile.write('%s\n' % unicode(textwrap.fill(t, width=100000, initial_indent=' ', subsequent_indent=' ')))
|
|
|
|
else:
|
|
|
|
# Auto indent
|
|
|
|
ctrlfile.write('%s\n' % unicode(textwrap.fill(description.strip(), width=74, initial_indent=' ', subsequent_indent=' ')))
|
|
|
|
|
2010-09-29 15:11:24 +00:00
|
|
|
else:
|
|
|
|
ctrlfile.write(unicode(c % tuple(pullData(fs, localdata))))
|
2006-09-19 09:04:09 +00:00
|
|
|
except KeyError:
|
2009-11-08 22:32:43 +00:00
|
|
|
import sys
|
2006-09-19 09:04:09 +00:00
|
|
|
(type, value, traceback) = sys.exc_info()
|
2007-11-24 14:55:57 +00:00
|
|
|
bb.utils.unlockfile(lf)
|
2006-09-19 09:04:09 +00:00
|
|
|
ctrlfile.close()
|
|
|
|
raise bb.build.FuncFailed("Missing field for deb generation: %s" % value)
|
|
|
|
# more fields
|
|
|
|
|
2012-11-16 18:29:26 +00:00
|
|
|
custom_fields_chunk = get_package_additional_metadata("deb", localdata)
|
|
|
|
if custom_fields_chunk is not None:
|
|
|
|
ctrlfile.write(unicode(custom_fields_chunk))
|
|
|
|
ctrlfile.write("\n")
|
|
|
|
|
2012-05-10 08:24:22 +00:00
|
|
|
mapping_rename_hook(localdata)
|
2006-09-19 09:04:09 +00:00
|
|
|
|
2012-09-30 00:19:11 +00:00
|
|
|
def debian_cmp_remap(var):
|
2012-11-30 02:53:29 +00:00
|
|
|
# dpkg does not allow for '(' or ')' in a dependency name
|
|
|
|
# replace these instances with '__' and '__'
|
|
|
|
#
|
2012-09-30 00:19:11 +00:00
|
|
|
# In debian '>' and '<' do not mean what it appears they mean
|
|
|
|
# '<' = less or equal
|
|
|
|
# '>' = greater or equal
|
|
|
|
# adjust these to the '<<' and '>>' equivalents
|
|
|
|
#
|
2012-11-30 02:53:29 +00:00
|
|
|
for dep in var:
|
|
|
|
if '(' in dep:
|
|
|
|
newdep = dep.replace('(', '__')
|
|
|
|
newdep = newdep.replace(')', '__')
|
|
|
|
if newdep != dep:
|
|
|
|
var[newdep] = var[dep]
|
|
|
|
del var[dep]
|
2012-09-30 00:19:11 +00:00
|
|
|
for dep in var:
|
2012-10-02 10:37:07 +00:00
|
|
|
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("> ", ">> ")
|
2012-09-30 00:19:11 +00:00
|
|
|
|
2012-10-02 10:37:07 +00:00
|
|
|
rdepends = bb.utils.explode_dep_versions2(localdata.getVar("RDEPENDS", True) or "")
|
2012-09-30 00:19:11 +00:00
|
|
|
debian_cmp_remap(rdepends)
|
2010-08-25 14:40:34 +00:00
|
|
|
for dep in rdepends:
|
|
|
|
if '*' in dep:
|
|
|
|
del rdepends[dep]
|
2012-10-02 10:37:07 +00:00
|
|
|
rrecommends = bb.utils.explode_dep_versions2(localdata.getVar("RRECOMMENDS", True) or "")
|
2012-09-30 00:19:11 +00:00
|
|
|
debian_cmp_remap(rrecommends)
|
2010-08-25 14:40:34 +00:00
|
|
|
for dep in rrecommends:
|
|
|
|
if '*' in dep:
|
|
|
|
del rrecommends[dep]
|
2012-10-02 10:37:07 +00:00
|
|
|
rsuggests = bb.utils.explode_dep_versions2(localdata.getVar("RSUGGESTS", True) or "")
|
2012-09-30 00:19:11 +00:00
|
|
|
debian_cmp_remap(rsuggests)
|
2012-10-02 10:37:07 +00:00
|
|
|
rprovides = bb.utils.explode_dep_versions2(localdata.getVar("RPROVIDES", True) or "")
|
2012-09-30 00:19:11 +00:00
|
|
|
debian_cmp_remap(rprovides)
|
2012-10-02 10:37:07 +00:00
|
|
|
rreplaces = bb.utils.explode_dep_versions2(localdata.getVar("RREPLACES", True) or "")
|
2012-09-30 00:19:11 +00:00
|
|
|
debian_cmp_remap(rreplaces)
|
2012-10-02 10:37:07 +00:00
|
|
|
rconflicts = bb.utils.explode_dep_versions2(localdata.getVar("RCONFLICTS", True) or "")
|
2012-09-30 00:19:11 +00:00
|
|
|
debian_cmp_remap(rconflicts)
|
2006-09-19 09:04:09 +00:00
|
|
|
if rdepends:
|
2010-07-01 23:05:38 +00:00
|
|
|
ctrlfile.write("Depends: %s\n" % unicode(bb.utils.join_deps(rdepends)))
|
2006-09-19 09:04:09 +00:00
|
|
|
if rsuggests:
|
2010-07-01 23:05:38 +00:00
|
|
|
ctrlfile.write("Suggests: %s\n" % unicode(bb.utils.join_deps(rsuggests)))
|
2006-09-19 09:04:09 +00:00
|
|
|
if rrecommends:
|
2010-07-01 23:05:38 +00:00
|
|
|
ctrlfile.write("Recommends: %s\n" % unicode(bb.utils.join_deps(rrecommends)))
|
2006-09-19 09:04:09 +00:00
|
|
|
if rprovides:
|
2010-07-01 23:05:38 +00:00
|
|
|
ctrlfile.write("Provides: %s\n" % unicode(bb.utils.join_deps(rprovides)))
|
2006-09-19 09:04:09 +00:00
|
|
|
if rreplaces:
|
2010-07-01 23:05:38 +00:00
|
|
|
ctrlfile.write("Replaces: %s\n" % unicode(bb.utils.join_deps(rreplaces)))
|
2006-09-19 09:04:09 +00:00
|
|
|
if rconflicts:
|
2010-07-01 23:05:38 +00:00
|
|
|
ctrlfile.write("Conflicts: %s\n" % unicode(bb.utils.join_deps(rconflicts)))
|
2006-09-19 09:04:09 +00:00
|
|
|
ctrlfile.close()
|
|
|
|
|
|
|
|
for script in ["preinst", "postinst", "prerm", "postrm"]:
|
Convert to use direct access to the data store (instead of bb.data.*Var*())
This is the result of running the following over the metadata:
sed \
-e 's:bb.data.\(setVar([^,()]*,[^,()]*\), *\([^ )]*\) *):\2.\1):g' \
-e 's:bb.data.\(setVarFlag([^,()]*,[^,()]*,[^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^() ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-i `grep -ril bb.data *`
(From OE-Core rev: b22831fd63164c4db9c0b72934d7d734a6585251)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-09 15:00:01 +00:00
|
|
|
scriptvar = localdata.getVar('pkg_%s' % script, True)
|
2006-09-19 09:04:09 +00:00
|
|
|
if not scriptvar:
|
|
|
|
continue
|
2014-10-10 23:36:42 +00:00
|
|
|
scriptvar = scriptvar.strip()
|
2006-09-19 09:04:09 +00:00
|
|
|
try:
|
2013-05-09 16:05:58 +00:00
|
|
|
scriptfile = open(os.path.join(controldir, script), 'w')
|
2006-09-19 09:04:09 +00:00
|
|
|
except OSError:
|
2007-11-24 14:55:57 +00:00
|
|
|
bb.utils.unlockfile(lf)
|
2006-09-19 09:04:09 +00:00
|
|
|
raise bb.build.FuncFailed("unable to open %s script file for writing." % script)
|
2014-10-10 23:36:42 +00:00
|
|
|
|
|
|
|
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')
|
2006-09-19 09:04:09 +00:00
|
|
|
scriptfile.close()
|
|
|
|
os.chmod(os.path.join(controldir, script), 0755)
|
|
|
|
|
2015-02-17 02:08:12 +00:00
|
|
|
conffiles_str = ' '.join(get_conffiles(pkg, d))
|
2006-09-19 09:04:09 +00:00
|
|
|
if conffiles_str:
|
|
|
|
try:
|
2013-05-09 16:05:58 +00:00
|
|
|
conffiles = open(os.path.join(controldir, 'conffiles'), 'w')
|
2006-09-19 09:04:09 +00:00
|
|
|
except OSError:
|
2007-11-24 14:55:57 +00:00
|
|
|
bb.utils.unlockfile(lf)
|
2006-09-19 09:04:09 +00:00
|
|
|
raise bb.build.FuncFailed("unable to open conffiles for writing.")
|
|
|
|
for f in conffiles_str.split():
|
2013-02-15 13:03:51 +00:00
|
|
|
if os.path.exists(oe.path.join(root, f)):
|
|
|
|
conffiles.write('%s\n' % f)
|
2006-09-19 09:04:09 +00:00
|
|
|
conffiles.close()
|
|
|
|
|
|
|
|
os.chdir(basedir)
|
2012-05-29 14:53:06 +00:00
|
|
|
ret = subprocess.call("PATH=\"%s\" dpkg-deb -b %s %s" % (localdata.getVar("PATH", True), root, pkgoutdir), shell=True)
|
2006-09-19 09:04:09 +00:00
|
|
|
if ret != 0:
|
2007-11-24 14:55:57 +00:00
|
|
|
bb.utils.unlockfile(lf)
|
2006-09-19 09:04:09 +00:00
|
|
|
raise bb.build.FuncFailed("dpkg-deb execution failed")
|
|
|
|
|
2013-11-05 22:08:56 +00:00
|
|
|
cleanupcontrol(root)
|
2007-11-24 14:55:57 +00:00
|
|
|
bb.utils.unlockfile(lf)
|
2006-09-19 09:04:09 +00:00
|
|
|
}
|
2007-08-21 09:37:30 +00:00
|
|
|
|
2010-08-05 09:52:10 +00:00
|
|
|
SSTATETASKS += "do_package_write_deb"
|
|
|
|
do_package_write_deb[sstate-inputdirs] = "${PKGWRITEDIRDEB}"
|
|
|
|
do_package_write_deb[sstate-outputdirs] = "${DEPLOY_DIR_DEB}"
|
|
|
|
|
|
|
|
python do_package_write_deb_setscene () {
|
2014-01-10 16:33:01 +00:00
|
|
|
tmpdir = d.getVar('TMPDIR', True)
|
|
|
|
|
|
|
|
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"))
|
|
|
|
|
2010-08-05 09:52:10 +00:00
|
|
|
sstate_setscene(d)
|
|
|
|
}
|
2010-09-16 05:55:21 +00:00
|
|
|
addtask do_package_write_deb_setscene
|
2010-08-05 09:52:10 +00:00
|
|
|
|
2007-08-21 09:37:30 +00:00
|
|
|
python () {
|
Convert to use direct access to the data store (instead of bb.data.*Var*())
This is the result of running the following over the metadata:
sed \
-e 's:bb.data.\(setVar([^,()]*,[^,()]*\), *\([^ )]*\) *):\2.\1):g' \
-e 's:bb.data.\(setVarFlag([^,()]*,[^,()]*,[^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^() ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-i `grep -ril bb.data *`
(From OE-Core rev: b22831fd63164c4db9c0b72934d7d734a6585251)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-09 15:00:01 +00:00
|
|
|
if d.getVar('PACKAGES', True) != '':
|
2012-03-03 10:41:41 +00:00
|
|
|
deps = ' dpkg-native:do_populate_sysroot virtual/fakeroot-native:do_populate_sysroot'
|
|
|
|
d.appendVarFlag('do_package_write_deb', 'depends', deps)
|
Convert to use direct access to the data store (instead of bb.data.*Var*())
This is the result of running the following over the metadata:
sed \
-e 's:bb.data.\(setVar([^,()]*,[^,()]*\), *\([^ )]*\) *):\2.\1):g' \
-e 's:bb.data.\(setVarFlag([^,()]*,[^,()]*,[^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^() ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-i `grep -ril bb.data *`
(From OE-Core rev: b22831fd63164c4db9c0b72934d7d734a6585251)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-09 15:00:01 +00:00
|
|
|
d.setVarFlag('do_package_write_deb', 'fakeroot', "1")
|
package_deb.bbclass, populate_sdk_deb.bbclass: fix meta-toolchain-gmae build
[YOCTO #1070]
Currently with deb packaging, we have 2 issues when running
"bitbake meta-toolchain-gmae".
1) when MACHINE="qemux86", SDKMACHINE="i686", INSTALL_BASEARCH_DEB is "i686",
too. This causes the following ERROR:
| E: Couldn't find package task-sdk-host-nativesdk
NOTE: package meta-toolchain-gmae-1.0-r6: task do_populate_sdk: Failed
This is becasue: due to the DPKG_ARCH mapping, we create such a deb package
tmp/deploy/deb/i686-nativesdk/task-sdk-host-nativesdk_1.0-r10_i386.deb; dpkg
can't recoginze the package. We need to map INSTALL_BASEARCH_DEB in the same
way.
2) when MACHINE="qemux86", SDKMACHINE="x86_64", INSTALL_BASEARCH_DEB is
"x86_64", too.
We get such an ERROR:
| E: Couldn't find package task-cross-canadian-i586
NOTE: package meta-toolchain-gmae-1.0-r6: task do_populate_sdk: Failed
This is because: dpkg can't recognize the generated package
tmp/deploy/deb/x86_64-nativesdk/task-cross-canadian-i586_1.0-r0_i386.deb
Here the "i386" suffix is incorrect and should be "x86_64" -- the i386
comes from the line
DPKG_ARCH_i586 ?= "i386" in package_deb.bbclass.
However, for canadian package, actually here the overriding of DPKG (from
"x86-64" to "i386") should not happen -- it accidently happens just because
TARGET_ARCH exists in OVERRIDES. We can move the overriding logic to the
anonymous python function to work this around.
(From OE-Core rev: 63010b9ee89643c8e83656783231f0a7848d9e45)
Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-14 14:30:14 +00:00
|
|
|
|
|
|
|
# Map TARGET_ARCH to Debian's ideas about architectures
|
2013-04-02 11:35:56 +00:00
|
|
|
darch = d.getVar('DPKG_ARCH', True)
|
|
|
|
if darch in ["x86", "i486", "i586", "i686", "pentium"]:
|
|
|
|
d.setVar('DPKG_ARCH', 'i386')
|
2014-03-11 10:07:35 +00:00
|
|
|
elif darch == "x86_64":
|
|
|
|
d.setVar('DPKG_ARCH', 'amd64')
|
2013-04-02 11:35:56 +00:00
|
|
|
elif darch == "arm":
|
|
|
|
d.setVar('DPKG_ARCH', 'armel')
|
2007-08-21 09:37:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
python do_package_write_deb () {
|
2012-07-11 17:33:43 +00:00
|
|
|
bb.build.exec_func("read_subpackage_metadata", d)
|
|
|
|
bb.build.exec_func("do_package_deb", d)
|
2007-08-21 09:37:30 +00:00
|
|
|
}
|
2010-08-05 09:52:10 +00:00
|
|
|
do_package_write_deb[dirs] = "${PKGWRITEDIRDEB}"
|
2013-01-29 22:04:35 +00:00
|
|
|
do_package_write_deb[cleandirs] = "${PKGWRITEDIRDEB}"
|
2012-03-10 02:11:57 +00:00
|
|
|
do_package_write_deb[umask] = "022"
|
2014-03-28 11:04:30 +00:00
|
|
|
addtask package_write_deb after do_packagedata do_package
|
2007-08-21 09:37:30 +00:00
|
|
|
|
package-index.bb: add support for deb and rpm.
[YOCTO #1024]
Currently package-index.bb only supports ipk. This commit adds the support
for rpm and deb, too.
------------------------------
How to generate and use repos:
1) run "bitbake package-index" after building some target,
e.g., core-image-sato-sdk;
2) export ${DEPLOY_DIR_RPM}, ${DEPLOY_DIR_IPK} and ${DEPLOY_DIR_DEB} by a
webserver on the host, assuming the host IP is 192.168.7.1, at
http://192.168.7.1/rpm
http://192.168.7.1/ipk
http://192.168.7.1/deb
3) inside the target, according to the packaging system (rpm, ipk or deb) used
when we generate the target image, we can use different ways to manage
packages:
3.1) RPM
run "zypper addrepo http://192.168.7.1/rpm main; zypper refresh"
to retrieve info about the repo; next, we can use "zypper install/remove"
to manage packages.
3.2) IPK
add the repo info into opkg config file, i.e., in
/etc/opkg/arch.conf, we can add something like
"src i586 http://192.168.7.1/ipk/i586", and next, we run "opkg update" to
make opkg update the list of available packages. And later, we can use
"opkg install/remove" to manage packages.
3.3) DEB
Currently in target, some important config files, like
/var/lib/dpkg/status and /etc/apt/sources.list, for deb/apt are missing. So
we can't install/remove package in target at present.
(From OE-Core rev: 01e34bdb43e0cc27c1cfffd6730c384f40c404c1)
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-05-18 04:09:01 +00:00
|
|
|
|
|
|
|
PACKAGEINDEXDEPS += "dpkg-native:do_populate_sysroot"
|
|
|
|
PACKAGEINDEXDEPS += "apt-native:do_populate_sysroot"
|
2014-02-24 16:12:07 +00:00
|
|
|
|
|
|
|
do_build[recrdeptask] += "do_package_write_deb"
|