summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@windriver.com>2013-09-10 20:59:35 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-09-11 11:06:11 +0100
commit4b2d9acda80ee618241a924555178a750cbd6e82 (patch)
tree50fd2707f6f92a11413124e01385142ae2839aeb
parent19c3c6dff3aecbc649608c7cc9ba195f1fa6ed4c (diff)
downloadpoky-4b2d9acda80ee618241a924555178a750cbd6e82.tar.gz
python-smartpm: Add an attempt install mode
[ YOCTO #3723 ] Add a mode to smart that will allow an installation to continue, instead of failure in the case that one or more items is uninstallable. Uninstallable packages are simply ignored, and no error is generated. (From OE-Core rev: bdf07b1698d228dc7ff555199a269b1ff8ceca19) Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/package_rpm.bbclass7
-rw-r--r--meta/recipes-devtools/python/python-smartpm/smart-attempt.patch59
-rw-r--r--meta/recipes-devtools/python/python-smartpm_1.4.1.bb1
3 files changed, 62 insertions, 5 deletions
diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index 8ab42c441e..699d0f200a 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -472,11 +472,8 @@ EOF
472 echo "Attempting $pkgs_to_install" 472 echo "Attempting $pkgs_to_install"
473 echo "Note: see `dirname ${BB_LOGFILE}`/log.do_${task}_attemptonly.${PID}" 473 echo "Note: see `dirname ${BB_LOGFILE}`/log.do_${task}_attemptonly.${PID}"
474 translate_oe_to_smart ${sdk_mode} --attemptonly $package_attemptonly 474 translate_oe_to_smart ${sdk_mode} --attemptonly $package_attemptonly
475 for each_pkg in $pkgs_to_install ; do 475 echo "Attempting $pkgs_to_install" >> "`dirname ${BB_LOGFILE}`/log.do_${task}_attemptonly.${PID}"
476 # We need to try each package individually as a single dependency failure 476 smart --data-dir=${target_rootfs}/var/lib/smart install --attempt -y ${pkgs_to_install} >> "`dirname ${BB_LOGFILE}`/log.do_${task}_attemptonly.${PID}" 2>&1
477 # will break the whole set otherwise.
478 smart --data-dir=${target_rootfs}/var/lib/smart install -y $each_pkg >> "`dirname ${BB_LOGFILE}`/log.do_${task}_attemptonly.${PID}" 2>&1 || true
479 done
480 fi 477 fi
481} 478}
482 479
diff --git a/meta/recipes-devtools/python/python-smartpm/smart-attempt.patch b/meta/recipes-devtools/python/python-smartpm/smart-attempt.patch
new file mode 100644
index 0000000000..0d603d3d1b
--- /dev/null
+++ b/meta/recipes-devtools/python/python-smartpm/smart-attempt.patch
@@ -0,0 +1,59 @@
1Add a mechanism to attempt the install operation, w/o failing.
2
3For complementary and 'attemptonly' packages, we need a way to instruct smart to
4try to install, but ignore any failures.
5
6This option only works for the install operation.
7
8Upstream-Status: Pending
9
10Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
11
12Index: smart-1.4.1/smart/commands/install.py
13===================================================================
14--- smart-1.4.1.orig/smart/commands/install.py
15+++ smart-1.4.1/smart/commands/install.py
16@@ -50,6 +50,8 @@ def option_parser():
17 parser = OptionParser(usage=USAGE,
18 description=DESCRIPTION,
19 examples=EXAMPLES)
20+ parser.add_option("--attempt", action="store_true",
21+ help=_("attempt to install packages, ignore failures"))
22 parser.add_option("--stepped", action="store_true",
23 help=_("split operation in steps"))
24 parser.add_option("--urls", action="store_true",
25@@ -80,6 +82,9 @@ def main(ctrl, opts):
26 if not opts.args:
27 raise Error, _("no package(s) given")
28
29+ if opts.attempt:
30+ sysconf.set("attempt-install", True, soft=True)
31+
32 if opts.explain:
33 sysconf.set("explain-changesets", True, soft=True)
34
35Index: smart-1.4.1/smart/transaction.py
36===================================================================
37--- smart-1.4.1.orig/smart/transaction.py
38+++ smart-1.4.1/smart/transaction.py
39@@ -1216,9 +1216,17 @@ class Transaction(object):
40 else:
41 op = REMOVE
42 if op is INSTALL or op is REINSTALL:
43- self._install(pkg, changeset, locked, pending)
44- if pkg in changeset:
45- changeset.setRequested(pkg, True)
46+ try:
47+ self._install(pkg, changeset, locked, pending)
48+ if pkg in changeset:
49+ changeset.setRequested(pkg, True)
50+ except Failed, e:
51+ if sysconf.has("attempt-install", soft=True):
52+ if pkg in changeset:
53+ del changeset[pkg]
54+ continue
55+ else:
56+ raise Failed, e
57 elif op is REMOVE:
58 self._remove(pkg, changeset, locked, pending)
59 elif op is UPGRADE:
diff --git a/meta/recipes-devtools/python/python-smartpm_1.4.1.bb b/meta/recipes-devtools/python/python-smartpm_1.4.1.bb
index 5d673b9902..f406d692e3 100644
--- a/meta/recipes-devtools/python/python-smartpm_1.4.1.bb
+++ b/meta/recipes-devtools/python/python-smartpm_1.4.1.bb
@@ -30,6 +30,7 @@ SRC_URI = "\
30 file://smart-flag-ignore-recommends.patch \ 30 file://smart-flag-ignore-recommends.patch \
31 file://smart-flag-exclude-packages.patch \ 31 file://smart-flag-exclude-packages.patch \
32 file://smart-config-ignore-all-recommends.patch \ 32 file://smart-config-ignore-all-recommends.patch \
33 file://smart-attempt.patch \
33 " 34 "
34 35
35SRC_URI[md5sum] = "573ef32ba177a6b3c4bf7ef04873fcb6" 36SRC_URI[md5sum] = "573ef32ba177a6b3c4bf7ef04873fcb6"