diff options
author | Mark Hatle <mark.hatle@windriver.com> | 2013-08-12 19:47:11 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-08-22 18:30:00 +0100 |
commit | 388278818d2af0a2c6a687765d43f22fe6f3c407 (patch) | |
tree | 97f629be5a3d01036bdc5d5e2e97e23ef6127299 /meta | |
parent | dc5f6c3898555b59f16bf809ae4c5418656e6ac9 (diff) | |
download | poky-388278818d2af0a2c6a687765d43f22fe6f3c407.tar.gz |
package_deb: Add support for NO_RECOMMENDATIONS and PACKAGE_EXCLUDE
Add support for NO_RECOMMENDATIONS and PACKAGE_EXCLUDE. Also add a
warning that ensures users know that BAD_RECOMMENDATIONS support is
not implemented in the debian package/rootfs classes.
(From OE-Core rev: 42b115b6d65c8205acb77b96db481f3e5172266b)
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes/package_deb.bbclass | 17 | ||||
-rw-r--r-- | meta/classes/rootfs_deb.bbclass | 8 |
2 files changed, 20 insertions, 5 deletions
diff --git a/meta/classes/package_deb.bbclass b/meta/classes/package_deb.bbclass index 4980555764..068c11a535 100644 --- a/meta/classes/package_deb.bbclass +++ b/meta/classes/package_deb.bbclass | |||
@@ -12,6 +12,8 @@ PKGWRITEDIRDEB = "${WORKDIR}/deploy-debs" | |||
12 | 12 | ||
13 | APTCONF_TARGET = "${WORKDIR}" | 13 | APTCONF_TARGET = "${WORKDIR}" |
14 | 14 | ||
15 | APT_ARGS = "${@['', '--no-install-recommends'][d.getVar("NO_RECOMMENDATIONS", True) == "1"]}" | ||
16 | |||
15 | # | 17 | # |
16 | # Update the Packages index files in ${DEPLOY_DIR_DEB} | 18 | # Update the Packages index files in ${DEPLOY_DIR_DEB} |
17 | # | 19 | # |
@@ -83,6 +85,13 @@ package_install_internal_deb () { | |||
83 | priority=$(expr $priority + 5) | 85 | priority=$(expr $priority + 5) |
84 | done | 86 | done |
85 | 87 | ||
88 | for pkg in ${PACKAGE_EXCLUDE}; do | ||
89 | (echo "Package: $pkg" | ||
90 | echo "Pin: release *" | ||
91 | echo "Pin-Priority: -1" | ||
92 | echo) >> ${APTCONF_TARGET}/apt/preferences | ||
93 | done | ||
94 | |||
86 | tac ${APTCONF_TARGET}/apt/sources.list.rev > ${APTCONF_TARGET}/apt/sources.list | 95 | tac ${APTCONF_TARGET}/apt/sources.list.rev > ${APTCONF_TARGET}/apt/sources.list |
87 | 96 | ||
88 | # The params in deb package control don't allow character `_', so | 97 | # The params in deb package control don't allow character `_', so |
@@ -105,7 +114,7 @@ package_install_internal_deb () { | |||
105 | 114 | ||
106 | if [ ! -z "${package_linguas}" ]; then | 115 | if [ ! -z "${package_linguas}" ]; then |
107 | for i in ${package_linguas}; do | 116 | for i in ${package_linguas}; do |
108 | apt-get install $i --force-yes --allow-unauthenticated | 117 | apt-get ${APT_ARGS} install $i --force-yes --allow-unauthenticated |
109 | if [ $? -ne 0 ]; then | 118 | if [ $? -ne 0 ]; then |
110 | exit 1 | 119 | exit 1 |
111 | fi | 120 | fi |
@@ -114,13 +123,13 @@ package_install_internal_deb () { | |||
114 | 123 | ||
115 | # normal install | 124 | # normal install |
116 | if [ ! -z "${package_to_install}" ]; then | 125 | if [ ! -z "${package_to_install}" ]; then |
117 | apt-get install ${package_to_install} --force-yes --allow-unauthenticated | 126 | apt-get ${APT_ARGS} install ${package_to_install} --force-yes --allow-unauthenticated |
118 | if [ $? -ne 0 ]; then | 127 | if [ $? -ne 0 ]; then |
119 | exit 1 | 128 | exit 1 |
120 | fi | 129 | fi |
121 | 130 | ||
122 | # Attempt to correct the probable broken dependencies in place. | 131 | # Attempt to correct the probable broken dependencies in place. |
123 | apt-get -f install | 132 | apt-get ${APT_ARGS} -f install |
124 | if [ $? -ne 0 ]; then | 133 | if [ $? -ne 0 ]; then |
125 | exit 1 | 134 | exit 1 |
126 | fi | 135 | fi |
@@ -129,7 +138,7 @@ package_install_internal_deb () { | |||
129 | rm -f `dirname ${BB_LOGFILE}`/log.do_${task}-attemptonly.${PID} | 138 | rm -f `dirname ${BB_LOGFILE}`/log.do_${task}-attemptonly.${PID} |
130 | if [ ! -z "${package_attemptonly}" ]; then | 139 | if [ ! -z "${package_attemptonly}" ]; then |
131 | for i in ${package_attemptonly}; do | 140 | for i in ${package_attemptonly}; do |
132 | apt-get install $i --force-yes --allow-unauthenticated >> `dirname ${BB_LOGFILE}`/log.do_${task}-attemptonly.${PID} 2>&1 || true | 141 | apt-get ${APT_ARGS} install $i --force-yes --allow-unauthenticated >> `dirname ${BB_LOGFILE}`/log.do_${task}-attemptonly.${PID} 2>&1 || true |
133 | done | 142 | done |
134 | fi | 143 | fi |
135 | 144 | ||
diff --git a/meta/classes/rootfs_deb.bbclass b/meta/classes/rootfs_deb.bbclass index edd1037f87..dcfe78669c 100644 --- a/meta/classes/rootfs_deb.bbclass +++ b/meta/classes/rootfs_deb.bbclass | |||
@@ -11,6 +11,12 @@ rootfs_deb_do_rootfs[vardepsexclude] += "BUILDNAME" | |||
11 | 11 | ||
12 | do_rootfs[lockfiles] += "${DEPLOY_DIR_DEB}/deb.lock" | 12 | do_rootfs[lockfiles] += "${DEPLOY_DIR_DEB}/deb.lock" |
13 | 13 | ||
14 | python rootfs_deb_bad_recommendations() { | ||
15 | if d.getVar("BAD_RECOMMENDATIONS", True): | ||
16 | bb.warn("Debian package install does not support BAD_RECOMMENDATIONS") | ||
17 | } | ||
18 | do_rootfs[prefuncs] += "rootfs_deb_bad_recommendations" | ||
19 | |||
14 | DEB_POSTPROCESS_COMMANDS = "" | 20 | DEB_POSTPROCESS_COMMANDS = "" |
15 | 21 | ||
16 | opkglibdir = "${localstatedir}/lib/opkg" | 22 | opkglibdir = "${localstatedir}/lib/opkg" |
@@ -113,7 +119,7 @@ remove_packaging_data_files() { | |||
113 | } | 119 | } |
114 | 120 | ||
115 | rootfs_install_packages() { | 121 | rootfs_install_packages() { |
116 | ${STAGING_BINDIR_NATIVE}/apt-get install `cat $1` --force-yes --allow-unauthenticated | 122 | ${STAGING_BINDIR_NATIVE}/apt-get ${APT_ARGS} install `cat $1` --force-yes --allow-unauthenticated |
117 | 123 | ||
118 | # Mark all packages installed | 124 | # Mark all packages installed |
119 | sed -i -e "s/Status: install ok unpacked/Status: install ok installed/;" $INSTALL_ROOTFS_DEB/var/lib/dpkg/status | 125 | sed -i -e "s/Status: install ok unpacked/Status: install ok installed/;" $INSTALL_ROOTFS_DEB/var/lib/dpkg/status |