diff options
-rw-r--r-- | meta/recipes-devtools/python/python-smartpm/smart-attempt.patch | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/meta/recipes-devtools/python/python-smartpm/smart-attempt.patch b/meta/recipes-devtools/python/python-smartpm/smart-attempt.patch index 5aedc88266..e1182041bc 100644 --- a/meta/recipes-devtools/python/python-smartpm/smart-attempt.patch +++ b/meta/recipes-devtools/python/python-smartpm/smart-attempt.patch | |||
@@ -26,7 +26,7 @@ diff --git a/smart/backends/rpm/pm.py b/smart/backends/rpm/pm.py | |||
26 | index 9bbd952..ba6405a 100644 | 26 | index 9bbd952..ba6405a 100644 |
27 | --- a/smart/backends/rpm/pm.py | 27 | --- a/smart/backends/rpm/pm.py |
28 | +++ b/smart/backends/rpm/pm.py | 28 | +++ b/smart/backends/rpm/pm.py |
29 | @@ -241,15 +241,48 @@ class RPMPackageManager(PackageManager): | 29 | @@ -241,15 +241,56 @@ class RPMPackageManager(PackageManager): |
30 | cb = RPMCallback(prog, upgradednames) | 30 | cb = RPMCallback(prog, upgradednames) |
31 | cb.grabOutput(True) | 31 | cb.grabOutput(True) |
32 | probs = None | 32 | probs = None |
@@ -36,7 +36,12 @@ index 9bbd952..ba6405a 100644 | |||
36 | finally: | 36 | finally: |
37 | del getTS.ts | 37 | del getTS.ts |
38 | cb.grabOutput(False) | 38 | cb.grabOutput(False) |
39 | + if (probs is not None) and sysconf.has("attempt-install", soft=True): | 39 | + # If there are file conflicts, and we're attempting installation, |
40 | + # remove conflicting packages from the transaction and retry | ||
41 | + # If there are other problems returned by ts.run(), that are not | ||
42 | + # linked with packages/files conflicts (the returned list is empty), | ||
43 | + # then don't retry | ||
44 | + if (probs is not None) and (len(probs) != 0) and sysconf.has("attempt-install", soft=True): | ||
40 | + def remove_conflict(pkgNEVR): | 45 | + def remove_conflict(pkgNEVR): |
41 | + for key in changeset.keys(): | 46 | + for key in changeset.keys(): |
42 | + if pkgNEVR == str(key): | 47 | + if pkgNEVR == str(key): |
@@ -68,7 +73,10 @@ index 9bbd952..ba6405a 100644 | |||
68 | + | 73 | + |
69 | prog.setDone() | 74 | prog.setDone() |
70 | - if probs is not None: | 75 | - if probs is not None: |
71 | + if (probs is not None) and (not retry): | 76 | + # If there are other problems than packages/files conflicts |
77 | + # returned by ts.run(), the returned list is empty, and if | ||
78 | + # we're only attempting installation, then don't raise any error | ||
79 | + if (probs is not None) and ((len(probs) != 0) or not sysconf.has("attempt-install", soft=True)) and (not retry): | ||
72 | raise Error, "\n".join([x[0] for x in probs]) | 80 | raise Error, "\n".join([x[0] for x in probs]) |
73 | prog.stop() | 81 | prog.stop() |
74 | + if retry and len(changeset): | 82 | + if retry and len(changeset): |