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}"
|
2013-03-08 13:21:42 +00:00
|
|
|
DPKG_ARCH_arm ?= "armel"
|
2007-09-27 20:26:26 +00:00
|
|
|
|
2010-08-05 09:52:10 +00:00
|
|
|
PKGWRITEDIRDEB = "${WORKDIR}/deploy-debs"
|
|
|
|
|
2011-01-30 04:26:14 +00:00
|
|
|
#
|
|
|
|
# Update the Packages index files in ${DEPLOY_DIR_DEB}
|
|
|
|
#
|
|
|
|
package_update_index_deb () {
|
|
|
|
|
|
|
|
local debarchs=""
|
|
|
|
|
|
|
|
if [ ! -z "${DEPLOY_KEEP_PACKAGES}" ]; then
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
|
2011-08-01 17:11:22 +00:00
|
|
|
for arch in ${PACKAGE_ARCHS} ${SDK_PACKAGE_ARCHS}; do
|
2011-01-30 04:26:14 +00:00
|
|
|
if [ -e ${DEPLOY_DIR_DEB}/$arch ]; then
|
|
|
|
debarchs="$debarchs $arch"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2013-02-17 08:57:17 +00:00
|
|
|
found=0
|
2011-01-30 04:26:14 +00:00
|
|
|
for arch in $debarchs; do
|
|
|
|
if [ ! -d ${DEPLOY_DIR_DEB}/$arch ]; then
|
|
|
|
continue;
|
|
|
|
fi
|
|
|
|
cd ${DEPLOY_DIR_DEB}/$arch
|
2012-04-10 22:52:23 +00:00
|
|
|
dpkg-scanpackages . | gzip > Packages.gz
|
2011-01-30 04:26:14 +00:00
|
|
|
echo "Label: $arch" > Release
|
2013-02-17 08:57:17 +00:00
|
|
|
found=1
|
2011-01-30 04:26:14 +00:00
|
|
|
done
|
2013-02-17 08:57:17 +00:00
|
|
|
if [ "$found" != "1" ]; then
|
|
|
|
bbfatal "There are no packages in ${DEPLOY_DIR_DEB}!"
|
|
|
|
fi
|
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
|
|
|
|
|
|
|
|
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}"
|
2011-07-30 12:46:40 +00:00
|
|
|
local package_linguas="${INSTALL_PACKAGES_LINGUAS_DEB}"
|
2011-01-30 04:26:14 +00:00
|
|
|
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
|
|
|
|
|
2013-03-02 09:12:58 +00:00
|
|
|
# The params in deb package control don't allow character `_', so
|
|
|
|
# change the arch's `_' to `-' in it.
|
|
|
|
dpkg_arch=`echo ${dpkg_arch} | sed 's/_/-/g'`
|
2011-01-30 04:26:14 +00:00
|
|
|
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"
|
|
|
|
|
2011-09-19 08:00:38 +00:00
|
|
|
mkdir -p ${target_rootfs}/var/lib/dpkg/info
|
|
|
|
mkdir -p ${target_rootfs}/var/lib/dpkg/updates
|
2011-01-30 04:26:14 +00:00
|
|
|
|
2011-09-19 08:00:38 +00:00
|
|
|
> ${target_rootfs}/var/lib/dpkg/status
|
|
|
|
> ${target_rootfs}/var/lib/dpkg/available
|
2011-01-30 04:26:14 +00:00
|
|
|
|
|
|
|
apt-get update
|
|
|
|
|
2013-03-20 22:21:31 +00:00
|
|
|
if [ ! -z "${package_linguas}" ]; then
|
|
|
|
for i in ${package_linguas}; do
|
|
|
|
apt-get install $i --force-yes --allow-unauthenticated
|
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
done
|
2011-01-30 04:26:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
# normal install
|
2013-03-02 09:12:59 +00:00
|
|
|
if [ ! -z "${package_to_install}" ]; then
|
|
|
|
apt-get install ${package_to_install} --force-yes --allow-unauthenticated
|
2011-01-30 04:26:14 +00:00
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
exit 1
|
|
|
|
fi
|
2013-03-02 09:12:59 +00:00
|
|
|
|
|
|
|
# Attempt to correct the probable broken dependencies in place.
|
|
|
|
apt-get -f install
|
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
2011-01-30 04:26:14 +00:00
|
|
|
|
2012-06-18 21:42:45 +00:00
|
|
|
rm -f `dirname ${BB_LOGFILE}`/log.do_${task}-attemptonly.${PID}
|
2011-01-30 04:26:14 +00:00
|
|
|
if [ ! -z "${package_attemptonly}" ]; then
|
|
|
|
for i in ${package_attemptonly}; do
|
2012-06-18 21:42:45 +00:00
|
|
|
apt-get install $i --force-yes --allow-unauthenticated >> `dirname ${BB_LOGFILE}`/log.do_${task}-attemptonly.${PID} 2>&1 || true
|
2011-01-30 04:26:14 +00:00
|
|
|
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
|
2011-09-19 08:00:38 +00:00
|
|
|
sed -i -e "s/Status: install ok unpacked/Status: install ok installed/;" ${target_rootfs}/var/lib/dpkg/status
|
2011-01-30 04:26:14 +00:00
|
|
|
}
|
|
|
|
|
2011-01-30 04:04:46 +00:00
|
|
|
deb_log_check() {
|
|
|
|
target="$1"
|
|
|
|
lf_path="$2"
|
|
|
|
|
|
|
|
lf_txt="`cat $lf_path`"
|
2012-06-29 15:51:22 +00:00
|
|
|
for keyword_die in "^E:"
|
2011-01-30 04:04:46 +00:00
|
|
|
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"
|
2012-09-20 09:56:59 +00:00
|
|
|
printf "log_check: Matched keyword: [$keyword_die]\n\n"
|
2011-01-30 04:04:46 +00:00
|
|
|
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
|
|
|
|
}
|
|
|
|
|
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
|
|
|
|
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))
|
2006-09-19 09:04:09 +00:00
|
|
|
bb.mkdirhier(pkgoutdir)
|
|
|
|
|
|
|
|
os.chdir(root)
|
|
|
|
from glob import glob
|
|
|
|
g = glob('*')
|
|
|
|
try:
|
|
|
|
del g[g.index('DEBIAN')]
|
|
|
|
del g[g.index('./DEBIAN')]
|
|
|
|
except ValueError:
|
|
|
|
pass
|
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')
|
|
|
|
bb.mkdirhier(controldir)
|
2007-03-31 14:04:49 +00:00
|
|
|
os.chmod(controldir, 0755)
|
2006-09-19 09:04:09 +00:00
|
|
|
try:
|
|
|
|
ctrlfile = file(os.path.join(controldir, 'control'), 'wb')
|
|
|
|
# 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']])
|
2006-09-19 09:04:09 +00:00
|
|
|
fields.append(["Homepage: %s\n", ['HOMEPAGE']])
|
|
|
|
|
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 "."
|
|
|
|
description = localdata.getVar('DESCRIPTION', True) or "."
|
2010-09-29 15:11:24 +00:00
|
|
|
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))))
|
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-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
|
|
|
|
try:
|
|
|
|
scriptfile = file(os.path.join(controldir, script), 'w')
|
|
|
|
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)
|
2007-08-07 14:34:33 +00:00
|
|
|
scriptfile.write("#!/bin/sh\n")
|
2006-09-19 09:04:09 +00:00
|
|
|
scriptfile.write(scriptvar)
|
|
|
|
scriptfile.close()
|
|
|
|
os.chmod(os.path.join(controldir, script), 0755)
|
|
|
|
|
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
|
|
|
conffiles_str = localdata.getVar("CONFFILES", True)
|
2006-09-19 09:04:09 +00:00
|
|
|
if conffiles_str:
|
|
|
|
try:
|
|
|
|
conffiles = file(os.path.join(controldir, 'conffiles'), 'w')
|
|
|
|
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:
|
2010-07-22 17:26:07 +00:00
|
|
|
bb.utils.prunedir(controldir)
|
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")
|
|
|
|
|
2008-08-18 07:58:39 +00:00
|
|
|
bb.utils.prunedir(controldir)
|
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-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 () {
|
|
|
|
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")
|
|
|
|
d.setVarFlag('do_package_write_deb_setscene', '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
|
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('DPKG_ARCH', True) in ["x86", "i486", "i586", "i686", "pentium"]:
|
|
|
|
d.setVar('DPKG_ARCH', 'i386')
|
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"
|
2013-01-23 14:27:33 +00:00
|
|
|
addtask package_write_deb before do_package_write 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
|
|
|
|
2013-02-17 08:57:17 +00:00
|
|
|
PACKAGEINDEXES += "[ ! -e ${DEPLOY_DIR_DEB} ] || package_update_index_deb;"
|
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"
|
2013-03-22 19:53:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
# This will of course only work after rootfs_deb_do_rootfs or populate_sdk_deb has been called
|
|
|
|
DPKG_QUERY_COMMAND = "${STAGING_BINDIR_NATIVE}/dpkg-query --admindir=$INSTALL_ROOTFS_DEB/var/lib/dpkg"
|
|
|
|
|
|
|
|
list_installed_packages() {
|
|
|
|
if [ "$1" = "arch" ] ; then
|
|
|
|
# Here we want the PACKAGE_ARCH not the deb architecture
|
|
|
|
${DPKG_QUERY_COMMAND} -W -f='${Package} ${PackageArch}\n'
|
|
|
|
elif [ "$1" = "file" ] ; then
|
|
|
|
${DPKG_QUERY_COMMAND} -W -f='${Package} ${Package}_${Version}_${Architecture}.deb\n' | while read pkg pkgfile
|
|
|
|
do
|
|
|
|
fullpath=`find ${DEPLOY_DIR_DEB} -name "$pkgfile" || true`
|
|
|
|
if [ "$fullpath" = "" ] ; then
|
|
|
|
echo "$pkg $pkgfile"
|
|
|
|
else
|
|
|
|
echo "$pkg $fullpath"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
else
|
|
|
|
${DPKG_QUERY_COMMAND} -W -f='${Package}\n'
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
rootfs_list_installed_depends() {
|
|
|
|
# Cheat here a little bit by using the opkg query helper util
|
|
|
|
${DPKG_QUERY_COMMAND} -W -f='Package: ${Package}\nDepends: ${Depends}\nRecommends: ${Recommends}\n\n' | opkg-query-helper.py
|
|
|
|
}
|