Patchwork [4/4] classes/rootfs_rpm: implement BAD_RECOMMENDATIONS for RPM

login
register
mail settings
Submitter Paul Eggleton
Date July 25, 2013, 5:09 p.m.
Message ID <462445728b7057ef4f9b88b34ac52b6139b41e44.1374772012.git.paul.eggleton@linux.intel.com>
Download mbox | patch
Permalink /patch/54527/
State Accepted
Commit 4e85129a7d47baf3e32b815cbc277bff84e085a0
Headers show

Comments

Paul Eggleton - July 25, 2013, 5:09 p.m.
Add support for the BAD_RECOMMENDATIONS variable that can be used to
prevent specific packages from being installed via an RRECOMMENDS
relationship when using the RPM backend. (Previously this
functionality was only available when using ipk packaging.)

In the process this moves the defaulting of BAD_RECOMMENDATIONS (as
empty) to bitbake.conf since it is no longer specific to the ipk
backend, as well as unifying some of the code that creates the
configuration for smart for use on the host and target.

Fixes [YOCTO #3916].

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 meta/classes/package_rpm.bbclass | 11 +++++++++--
 meta/classes/rootfs_ipk.bbclass  |  2 --
 meta/classes/rootfs_rpm.bbclass  |  3 +--
 meta/conf/bitbake.conf           |  2 ++
 4 files changed, 12 insertions(+), 6 deletions(-)

Patch

diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index 1537079..324d83f 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -224,6 +224,14 @@  translate_oe_to_smart() {
 	export pkgs_to_install
 }
 
+package_write_smart_config() {
+	# Write common configuration for host and target usage
+	smart --data-dir=$1/var/lib/smart config --set rpm-nolinktos=1
+	smart --data-dir=$1/var/lib/smart config --set rpm-noparentdirs=1
+	for i in ${BAD_RECOMMENDATIONS}; do
+		smart --data-dir=$1/var/lib/smart flag --set ignore-recommends $i
+	done
+}
 
 #
 # Install a bunch of packages using rpm.
@@ -345,10 +353,9 @@  EOF
 		rm -rf ${target_rootfs}/var/lib/smart
 		smart --data-dir=${target_rootfs}/var/lib/smart config --set rpm-root=${target_rootfs}
 		smart --data-dir=${target_rootfs}/var/lib/smart config --set rpm-dbpath=${rpmlibdir}
-		smart --data-dir=${target_rootfs}/var/lib/smart config --set rpm-nolinktos=1
-		smart --data-dir=${target_rootfs}/var/lib/smart config --set rpm-noparentdirs=1
 		smart --data-dir=${target_rootfs}/var/lib/smart config --set rpm-extra-macros._var=${localstatedir}
 		smart --data-dir=${target_rootfs}/var/lib/smart config --set rpm-extra-macros._tmppath=/install/tmp
+		package_write_smart_config ${target_rootfs}
 		# Optional debugging
 		#smart --data-dir=${target_rootfs}/var/lib/smart config --set rpm-log-level=debug
 		#smart --data-dir=${target_rootfs}/var/lib/smart config --set rpm-log-file=/tmp/smart-debug-logfile
diff --git a/meta/classes/rootfs_ipk.bbclass b/meta/classes/rootfs_ipk.bbclass
index 1403422..c9650cb 100644
--- a/meta/classes/rootfs_ipk.bbclass
+++ b/meta/classes/rootfs_ipk.bbclass
@@ -21,8 +21,6 @@  OPKG_POSTPROCESS_COMMANDS = "ipk_insert_feed_uris; "
 
 OPKGLIBDIR = "${localstatedir}/lib"
 
-# Which packages to not install on the basis of a recommendation
-BAD_RECOMMENDATIONS ?= ""
 MULTILIBRE_ALLOW_REP = "${OPKGLIBDIR}/opkg"
 
 fakeroot rootfs_ipk_do_rootfs () {
diff --git a/meta/classes/rootfs_rpm.bbclass b/meta/classes/rootfs_rpm.bbclass
index 1b09c8d..30b52d4 100644
--- a/meta/classes/rootfs_rpm.bbclass
+++ b/meta/classes/rootfs_rpm.bbclass
@@ -163,8 +163,7 @@  rpm_setup_smart_target_config() {
 	# Set up smart configuration for the target
 	rm -rf ${IMAGE_ROOTFS}/var/lib/smart
 	smart --data-dir=${IMAGE_ROOTFS}/var/lib/smart channel --add rpmsys type=rpm-sys -y
-	smart --data-dir=${IMAGE_ROOTFS}/var/lib/smart config --set rpm-nolinktos=1
-	smart --data-dir=${IMAGE_ROOTFS}/var/lib/smart config --set rpm-noparentdirs=1
+	package_write_smart_config ${IMAGE_ROOTFS}
 	rm -f ${IMAGE_ROOTFS}/var/lib/smart/config.old
 }
 
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index 62a3936..07eb473 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -753,6 +753,8 @@  COMBINED_FEATURES[vardeps] += "DISTRO_FEATURES MACHINE_FEATURES"
 SERIAL_CONSOLE ??= ""
 SERIAL_CONSOLES ??= "${@d.getVar('SERIAL_CONSOLE', True).replace(' ', ';')}"
 
+BAD_RECOMMENDATIONS ?= ""
+
 # Make sure MACHINE isn't exported
 # (breaks binutils at least)
 MACHINE[unexport] = "1"