diff options
Diffstat (limited to 'meta/recipes-devtools/python/python-smartpm/smart-attempt.patch')
-rw-r--r-- | meta/recipes-devtools/python/python-smartpm/smart-attempt.patch | 59 |
1 files changed, 59 insertions, 0 deletions
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 @@ | |||
1 | Add a mechanism to attempt the install operation, w/o failing. | ||
2 | |||
3 | For complementary and 'attemptonly' packages, we need a way to instruct smart to | ||
4 | try to install, but ignore any failures. | ||
5 | |||
6 | This option only works for the install operation. | ||
7 | |||
8 | Upstream-Status: Pending | ||
9 | |||
10 | Signed-off-by: Mark Hatle <mark.hatle@windriver.com> | ||
11 | |||
12 | Index: 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 | |||
35 | Index: 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: | ||