From d9a3ebef27979f6c3f586a3b35b07521ae1faeed Mon Sep 17 00:00:00 2001 From: Herve Jourdain Date: Thu, 9 Jun 2016 15:41:31 +0800 Subject: smartpm: if RPM transaction fails with an empty list of problems in attempt mode, ignore it! Since commit be0cabf816a84c59e0e951b92a570121ed843822 on 2016/05/17, smartpm will retry the transaction if ts.run() returns with an empty list of problems, and we're in attempt mode. But then, since all the packages are already installed, the transaction will fail with "package already installed" error. In attempt mode, it's fine to not retry nor generate an error when the transaction fails for no reason linked to files/packages conflicts, so this patch fixes this behaviour. (From OE-Core rev: 327f263be285525adcbbf472db6ac7722c84ac2f) Signed-off-by: Herve Jourdain Signed-off-by: Ross Burton Signed-off-by: Richard Purdie --- .../python/python-smartpm/smart-attempt.patch | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'meta') 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 index 9bbd952..ba6405a 100644 --- a/smart/backends/rpm/pm.py +++ b/smart/backends/rpm/pm.py -@@ -241,15 +241,48 @@ class RPMPackageManager(PackageManager): +@@ -241,15 +241,56 @@ class RPMPackageManager(PackageManager): cb = RPMCallback(prog, upgradednames) cb.grabOutput(True) probs = None @@ -36,7 +36,12 @@ index 9bbd952..ba6405a 100644 finally: del getTS.ts cb.grabOutput(False) -+ if (probs is not None) and sysconf.has("attempt-install", soft=True): ++ # If there are file conflicts, and we're attempting installation, ++ # remove conflicting packages from the transaction and retry ++ # If there are other problems returned by ts.run(), that are not ++ # linked with packages/files conflicts (the returned list is empty), ++ # then don't retry ++ if (probs is not None) and (len(probs) != 0) and sysconf.has("attempt-install", soft=True): + def remove_conflict(pkgNEVR): + for key in changeset.keys(): + if pkgNEVR == str(key): @@ -68,7 +73,10 @@ index 9bbd952..ba6405a 100644 + prog.setDone() - if probs is not None: -+ if (probs is not None) and (not retry): ++ # If there are other problems than packages/files conflicts ++ # returned by ts.run(), the returned list is empty, and if ++ # we're only attempting installation, then don't raise any error ++ if (probs is not None) and ((len(probs) != 0) or not sysconf.has("attempt-install", soft=True)) and (not retry): raise Error, "\n".join([x[0] for x in probs]) prog.stop() + if retry and len(changeset): -- cgit v1.2.3-54-g00ecf