Patchwork [2/2] package_rpm.bbclass: Refactor the attempt only install

login
register
mail settings
Submitter Mark Hatle
Date Dec. 14, 2012, 10:40 p.m.
Message ID <1355524834-9550-3-git-send-email-mark.hatle@windriver.com>
Download mbox | patch
Permalink /patch/41051/
State Accepted
Commit 1874c8d7e234ba2f9dca46a7df216248ddc895c6
Headers show

Comments

Mark Hatle - Dec. 14, 2012, 10:40 p.m.
Smart does not have a method to perform an install, but ignore failures.

There was a class of failures that stopped Smart from processing
attemptonly installs.  To work around this we need to iterate over the to
be attempted list.

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
---
 meta/classes/package_rpm.bbclass |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

Patch

diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index 05108b2..dc8a54e 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -465,10 +465,14 @@  EOF
 
 	if [ -n "${package_attemptonly}" ]; then
 		echo "Note: installing attempt only packages..."
+		echo "Attempting $pkgs_to_install"
 		echo "Note: see `dirname ${BB_LOGFILE}`/log.do_${task}_attemptonly.${PID}"
 		translate_oe_to_smart ${sdk_mode} --attemptonly $package_attemptonly
-		echo "Attempting $pkgs_to_install"
-		smart --data-dir=${target_rootfs}/var/lib/smart install -y $pkgs_to_install >> "`dirname ${BB_LOGFILE}`/log.do_${task}_attemptonly.${PID}" 2>&1 || true
+		for each_pkg in $pkgs_to_install ;  do
+			# We need to try each package individually as a single dependency failure
+			# will break the whole set otherwise.
+			smart --data-dir=${target_rootfs}/var/lib/smart install -y $each_pkg >> "`dirname ${BB_LOGFILE}`/log.do_${task}_attemptonly.${PID}" 2>&1 || true
+		done
 	fi
 }