diff options
| author | Alexander Kanavin <alexander.kanavin@linux.intel.com> | 2017-01-02 15:14:41 +0200 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-03-14 14:42:16 +0000 |
| commit | 372bcd3c978524fa2ca31e4fe14f288f67562cdb (patch) | |
| tree | 81a8bbbf8bf754f9891e81ccfdc80ea5e1ec32ac | |
| parent | b70f96a17fc13a74c04fd56e34cdc8f84dbf2f69 (diff) | |
| download | poky-372bcd3c978524fa2ca31e4fe14f288f67562cdb.tar.gz | |
python-smartpm: remove the recipe
(From OE-Core rev: 9ff0e8b4012f1e68f6caebc3027f9d1bada00f13)
Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
15 files changed, 0 insertions, 1355 deletions
diff --git a/meta/recipes-devtools/python/python-smartpm/channels-rpm_sys-use-md5sum-instead-of-mtime-as-the-.patch b/meta/recipes-devtools/python/python-smartpm/channels-rpm_sys-use-md5sum-instead-of-mtime-as-the-.patch deleted file mode 100644 index 2f14a124ef..0000000000 --- a/meta/recipes-devtools/python/python-smartpm/channels-rpm_sys-use-md5sum-instead-of-mtime-as-the-.patch +++ /dev/null | |||
| @@ -1,38 +0,0 @@ | |||
| 1 | channels/rpm_sys: use md5sum instead of mtime as the digest | ||
| 2 | |||
| 3 | Use the internal getFileDigest() function (which defaults to md5) instead of | ||
| 4 | mtime for getting the file digest. On some systems mtime proved to be | ||
| 5 | unreliable because of delayed update. This caused smart to miss rpm db updates | ||
| 6 | and thus get its understanding of installed packages out of sync. | ||
| 7 | |||
| 8 | Upstream-Status: Pending | ||
| 9 | |||
| 10 | Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> | ||
| 11 | --- | ||
| 12 | smart/channels/rpm_sys.py | 3 ++- | ||
| 13 | 1 file changed, 2 insertions(+), 1 deletion(-) | ||
| 14 | |||
| 15 | diff --git a/smart/channels/rpm_sys.py b/smart/channels/rpm_sys.py | ||
| 16 | index b9fda27..6f1fe94 100644 | ||
| 17 | --- a/smart/channels/rpm_sys.py | ||
| 18 | +++ b/smart/channels/rpm_sys.py | ||
| 19 | @@ -22,6 +22,7 @@ | ||
| 20 | from smart.backends.rpm.header import RPMDBLoader | ||
| 21 | from smart.backends.rpm.base import getTS, rpm_join_dbpath | ||
| 22 | from smart.channel import PackageChannel | ||
| 23 | +from smart.util.filetools import getFileDigest | ||
| 24 | from smart import * | ||
| 25 | import os | ||
| 26 | |||
| 27 | @@ -35,7 +36,7 @@ class RPMSysChannel(PackageChannel): | ||
| 28 | dbdir = rpm_join_dbpath(sysconf.get("rpm-root", "/"), | ||
| 29 | sysconf.get("rpm-dbpath", "var/lib/rpm")) | ||
| 30 | path = os.path.join(dbdir, "Packages") | ||
| 31 | - digest = os.path.getmtime(path) | ||
| 32 | + digest = getFileDigest(path) | ||
| 33 | if digest == self._digest: | ||
| 34 | return True | ||
| 35 | self.removeLoaders() | ||
| 36 | -- | ||
| 37 | 2.6.6 | ||
| 38 | |||
diff --git a/meta/recipes-devtools/python/python-smartpm/smart-add-deugging-when-targetpath-is-empty.patch b/meta/recipes-devtools/python/python-smartpm/smart-add-deugging-when-targetpath-is-empty.patch deleted file mode 100644 index 5e80804bf4..0000000000 --- a/meta/recipes-devtools/python/python-smartpm/smart-add-deugging-when-targetpath-is-empty.patch +++ /dev/null | |||
| @@ -1,47 +0,0 @@ | |||
| 1 | From 01e51afd03131947f8d74b9a23fdbc0078249499 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Mariano Lopez <mariano.lopez@linux.intel.com> | ||
| 3 | Date: Wed, 3 Aug 2016 07:47:09 +0000 | ||
| 4 | Subject: [PATCH] fetcher.py: Add debugging when targetpath is empty | ||
| 5 | |||
| 6 | There are several errors when openining files or manipulating | ||
| 7 | path strings, those errors point targetpath passed to | ||
| 8 | setSucceeded() is empty. This patch won't solve the problems, | ||
| 9 | but will add debugging to give an idea why is failing. | ||
| 10 | |||
| 11 | Upstream-Status: Inappropriate [debugging] | ||
| 12 | |||
| 13 | Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> | ||
| 14 | --- | ||
| 15 | smart/fetcher.py | 16 ++++++++++++++++ | ||
| 16 | 1 file changed, 16 insertions(+) | ||
| 17 | |||
| 18 | diff --git a/smart/fetcher.py b/smart/fetcher.py | ||
| 19 | index dd3ff6b..64aa979 100644 | ||
| 20 | --- a/smart/fetcher.py | ||
| 21 | +++ b/smart/fetcher.py | ||
| 22 | @@ -594,6 +594,22 @@ class FetchItem(object): | ||
| 23 | self._eta = None | ||
| 24 | |||
| 25 | def setSucceeded(self, targetpath, fetchedsize=0): | ||
| 26 | + # It seems the in some odd cases targetpath here | ||
| 27 | + # is empty, this will lead to bugs in several places | ||
| 28 | + if not targetpath: | ||
| 29 | + import traceback | ||
| 30 | + tb_str = "" | ||
| 31 | + for threadId, stack in sys._current_frames().items(): | ||
| 32 | + tb_str += '\nThreadID: %s' % threadId | ||
| 33 | + for filename, lineno, name, line in traceback.extract_stack(stack): | ||
| 34 | + tb_str += '\nFile: "%s", line %d, in %s' % (filename, lineno, name) | ||
| 35 | + if line: | ||
| 36 | + tb_str += "\n %s" % line.strip() | ||
| 37 | + error_string = ["No file path specified", | ||
| 38 | + "URL: %s" % self._url, | ||
| 39 | + "Status: %s" % self._status, | ||
| 40 | + "Traceback: %s" % tb_str] | ||
| 41 | + raise Error, _("\n".join(error_string)) | ||
| 42 | if self._status is not FAILED: | ||
| 43 | self._status = SUCCEEDED | ||
| 44 | self._targetpath = targetpath | ||
| 45 | -- | ||
| 46 | 2.6.6 | ||
| 47 | |||
diff --git a/meta/recipes-devtools/python/python-smartpm/smart-add-for-rpm-ignoresize-check.patch b/meta/recipes-devtools/python/python-smartpm/smart-add-for-rpm-ignoresize-check.patch deleted file mode 100644 index fe98d070d3..0000000000 --- a/meta/recipes-devtools/python/python-smartpm/smart-add-for-rpm-ignoresize-check.patch +++ /dev/null | |||
| @@ -1,35 +0,0 @@ | |||
| 1 | python-smartpm: Add checking for "rpm-ignoresize" option | ||
| 2 | |||
| 3 | The do_rootfs takes a very long time when build host has mounted many NFS | ||
| 4 | devices. syscall lstat() was being called on every filesystem mounted on the | ||
| 5 | build host during building. | ||
| 6 | The reason for the lstat() is that rpm is verifying that enough free disk space | ||
| 7 | is available to do the install. However, since the install is into the target | ||
| 8 | rootfs it should not matter how much free space there is in the host mounts. | ||
| 9 | Add checking for "rpm-ignoresize", by it, smart can make whether RPM skip | ||
| 10 | checking for diskspace when install a rpm package. | ||
| 11 | |||
| 12 | Upstream-Status: Pending | ||
| 13 | |||
| 14 | Signed-off-by: wenlin.kang <wenlin.kang@windriver.com> | ||
| 15 | Signed-off-by: Chong Lu <Chong.Lu@windriver.com> | ||
| 16 | --- | ||
| 17 | smart/backends/rpm/pm.py | 4 ++++ | ||
| 18 | 1 file changed, 4 insertions(+) | ||
| 19 | |||
| 20 | Index: git/smart/backends/rpm/pm.py | ||
| 21 | =================================================================== | ||
| 22 | --- git.orig/smart/backends/rpm/pm.py | ||
| 23 | +++ git/smart/backends/rpm/pm.py | ||
| 24 | @@ -233,6 +233,11 @@ class RPMPackageManager(PackageManager): | ||
| 25 | if sysconf.get("rpm-order"): | ||
| 26 | ts.order() | ||
| 27 | probfilter = rpm.RPMPROB_FILTER_OLDPACKAGE | ||
| 28 | + | ||
| 29 | + if sysconf.get("rpm-ignoresize", False): | ||
| 30 | + probfilter |= rpm.RPMPROB_FILTER_DISKNODES | ||
| 31 | + probfilter |= rpm.RPMPROB_FILTER_DISKSPACE | ||
| 32 | + | ||
| 33 | if force or reinstall: | ||
| 34 | probfilter |= rpm.RPMPROB_FILTER_REPLACEPKG | ||
| 35 | probfilter |= rpm.RPMPROB_FILTER_REPLACEOLDFILES | ||
diff --git a/meta/recipes-devtools/python/python-smartpm/smart-already-installed-message.patch b/meta/recipes-devtools/python/python-smartpm/smart-already-installed-message.patch deleted file mode 100644 index 9055555cd0..0000000000 --- a/meta/recipes-devtools/python/python-smartpm/smart-already-installed-message.patch +++ /dev/null | |||
| @@ -1,54 +0,0 @@ | |||
| 1 | From a74a9a9eb9d75964a0e978950e8b191d7a18d763 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Paul Eggleton <paul.eggleton@linux.intel.com> | ||
| 3 | Date: Fri, 5 Jun 2015 17:07:16 +0100 | ||
| 4 | Subject: [PATCH] smart: change "is already installed" message from warning to | ||
| 5 | info | ||
| 6 | |||
| 7 | This doesn't need to be a warning. | ||
| 8 | |||
| 9 | Upstream-Status: Pending | ||
| 10 | |||
| 11 | Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> | ||
| 12 | --- | ||
| 13 | smart/commands/install.py | 4 ++-- | ||
| 14 | smart/interfaces/text/interactive.py | 2 +- | ||
| 15 | 2 files changed, 3 insertions(+), 3 deletions(-) | ||
| 16 | |||
| 17 | diff --git a/smart/commands/install.py b/smart/commands/install.py | ||
| 18 | index 6ef9682..80d456b 100644 | ||
| 19 | --- a/smart/commands/install.py | ||
| 20 | +++ b/smart/commands/install.py | ||
| 21 | @@ -152,7 +152,7 @@ def main(ctrl, opts): | ||
| 22 | for obj in results: | ||
| 23 | for pkg in obj.packages: | ||
| 24 | if pkg.installed: | ||
| 25 | - iface.warning(_("%s (for %s) is already installed") | ||
| 26 | + iface.info(_("%s (for %s) is already installed") | ||
| 27 | % (pkg, arg)) | ||
| 28 | installed = True | ||
| 29 | break | ||
| 30 | @@ -184,7 +184,7 @@ def main(ctrl, opts): | ||
| 31 | for name in names: | ||
| 32 | pkg = names[name][0] | ||
| 33 | if pkg.installed: | ||
| 34 | - iface.warning(_("%s is already installed") % pkg) | ||
| 35 | + iface.info(_("%s is already installed") % pkg) | ||
| 36 | else: | ||
| 37 | trans.enqueue(pkg, INSTALL) | ||
| 38 | |||
| 39 | diff --git a/smart/interfaces/text/interactive.py b/smart/interfaces/text/interactive.py | ||
| 40 | index 9865584..190867b 100644 | ||
| 41 | --- a/smart/interfaces/text/interactive.py | ||
| 42 | +++ b/smart/interfaces/text/interactive.py | ||
| 43 | @@ -278,7 +278,7 @@ class Interpreter(Cmd): | ||
| 44 | for name in names: | ||
| 45 | pkg = names[name][0] | ||
| 46 | if pkg.installed: | ||
| 47 | - iface.warning(_("%s is already installed") % pkg) | ||
| 48 | + iface.info(_("%s is already installed") % pkg) | ||
| 49 | else: | ||
| 50 | found = True | ||
| 51 | transaction.enqueue(pkg, INSTALL) | ||
| 52 | -- | ||
| 53 | 2.1.0 | ||
| 54 | |||
diff --git a/meta/recipes-devtools/python/python-smartpm/smart-attempt-fix.patch b/meta/recipes-devtools/python/python-smartpm/smart-attempt-fix.patch deleted file mode 100644 index 6e672b3321..0000000000 --- a/meta/recipes-devtools/python/python-smartpm/smart-attempt-fix.patch +++ /dev/null | |||
| @@ -1,158 +0,0 @@ | |||
| 1 | Sadly, smart is not deterministic so the same build can go down multiple different | ||
| 2 | pathways. We'd expect to see the same warnings however depending on the pathway | ||
| 3 | taken, it may or may not warn, particularly with Recommends since they're optional. | ||
| 4 | |||
| 5 | For example, where a Recommended package is available but has Conflicts, we'd expect | ||
| 6 | to see an warning that we couldn't install it. Some code paths silently hide this | ||
| 7 | (its a LOCKED_CONFLICT). We add printing of warnings for this case. | ||
| 8 | |||
| 9 | Also, if there are two compatible feeds available (e.g. i586 and core2_32), this | ||
| 10 | changes the code path from direct _install() to _pending() since there are multiple | ||
| 11 | providers. This patch adds warning handling to _pending() so we don't hit hard | ||
| 12 | failures there. This is as seen with the mysterious libspeexdsp failures for x86-lsb | ||
| 13 | on the autobuilder. | ||
| 14 | |||
| 15 | Upstream-Status: Pending | ||
| 16 | RP | ||
| 17 | 2015/7/16 | ||
| 18 | |||
| 19 | Index: git/smart/transaction.py | ||
| 20 | =================================================================== | ||
| 21 | --- git.orig/smart/transaction.py | ||
| 22 | +++ git/smart/transaction.py | ||
| 23 | @@ -651,13 +651,14 @@ class Transaction(object): | ||
| 24 | |||
| 25 | if not prvpkgs: | ||
| 26 | # No packages provide it at all. Give up. | ||
| 27 | + | ||
| 28 | + reasons = [] | ||
| 29 | + for prv in req.providedby: | ||
| 30 | + for prvpkg in prv.packages: | ||
| 31 | + lockedres = lockedpkgs.get(prvpkg, None) | ||
| 32 | + if lockedres: | ||
| 33 | + reasons.append(lock_reason(prvpkg, lockedres)) | ||
| 34 | if reqrequired: | ||
| 35 | - reasons = [] | ||
| 36 | - for prv in req.providedby: | ||
| 37 | - for prvpkg in prv.packages: | ||
| 38 | - lockedres = lockedpkgs.get(prvpkg, None) | ||
| 39 | - if lockedres: | ||
| 40 | - reasons.append(lock_reason(prvpkg, lockedres)) | ||
| 41 | if reasons: | ||
| 42 | raise Failed, _("Can't install %s: unable to install provider for %s:\n %s") % \ | ||
| 43 | (pkg, req, '\n '.join(reasons)) | ||
| 44 | @@ -665,7 +666,11 @@ class Transaction(object): | ||
| 45 | raise Failed, _("Can't install %s: no package provides %s") % \ | ||
| 46 | (pkg, req) | ||
| 47 | else: | ||
| 48 | + if reasons: | ||
| 49 | + iface.warning(_("Can't install %s: unable to install provider for %s:\n %s") % \ | ||
| 50 | + (pkg, req, '\n '.join(reasons))) | ||
| 51 | + | ||
| 52 | # It's only a recommend, skip | ||
| 53 | continue | ||
| 54 | |||
| 55 | if len(prvpkgs) == 1: | ||
| 56 | @@ -846,6 +852,14 @@ class Transaction(object): | ||
| 57 | isinst = changeset.installed | ||
| 58 | getweight = self._policy.getWeight | ||
| 59 | |||
| 60 | + attempt = sysconf.has("attempt-install", soft=True) | ||
| 61 | + | ||
| 62 | + def handle_failure(msg): | ||
| 63 | + if attempt: | ||
| 64 | + iface.warning(msg) | ||
| 65 | + else: | ||
| 66 | + raise Failed, msg | ||
| 67 | + | ||
| 68 | updown = [] | ||
| 69 | while pending: | ||
| 70 | item = pending.pop(0) | ||
| 71 | @@ -870,8 +884,9 @@ class Transaction(object): | ||
| 72 | |||
| 73 | if not prvpkgs: | ||
| 74 | # No packages provide it at all. Give up. | ||
| 75 | - raise Failed, _("Can't install %s: no package " | ||
| 76 | - "provides %s") % (pkg, req) | ||
| 77 | + handle_failure(_("Can't install %s: no package " | ||
| 78 | + "provides %s") % (pkg, req)) | ||
| 79 | + continue | ||
| 80 | |||
| 81 | if len(prvpkgs) > 1: | ||
| 82 | # More than one package provide it. We use _pending here, | ||
| 83 | @@ -894,9 +909,10 @@ class Transaction(object): | ||
| 84 | keeporder, cs, lk)) | ||
| 85 | keeporder += 0.000001 | ||
| 86 | if not alternatives: | ||
| 87 | - raise Failed, _("Can't install %s: all packages " | ||
| 88 | + handle_failure(_("Can't install %s: all packages " | ||
| 89 | "providing %s failed to install:\n%s")\ | ||
| 90 | - % (pkg, req, "\n".join(failures)) | ||
| 91 | + % (pkg, req, "\n".join(failures))) | ||
| 92 | + continue | ||
| 93 | alternatives.sort() | ||
| 94 | changeset.setState(alternatives[0][1]) | ||
| 95 | if len(alternatives) == 1: | ||
| 96 | @@ -954,18 +970,20 @@ class Transaction(object): | ||
| 97 | |||
| 98 | for reqpkg in reqpkgs: | ||
| 99 | if reqpkg in locked and isinst(reqpkg): | ||
| 100 | - raise Failed, _("Can't remove %s: requiring " | ||
| 101 | + handle_failure(_("Can't remove %s: requiring " | ||
| 102 | "package %s is locked") % \ | ||
| 103 | - (pkg, reqpkg) | ||
| 104 | + (pkg, reqpkg)) | ||
| 105 | + continue | ||
| 106 | for reqpkg in reqpkgs: | ||
| 107 | # We check again, since other actions may have | ||
| 108 | # changed their state. | ||
| 109 | if not isinst(reqpkg): | ||
| 110 | continue | ||
| 111 | if reqpkg in locked: | ||
| 112 | - raise Failed, _("Can't remove %s: requiring " | ||
| 113 | + handle_failure(_("Can't remove %s: requiring " | ||
| 114 | "package %s is locked") % \ | ||
| 115 | - (pkg, reqpkg) | ||
| 116 | + (pkg, reqpkg)) | ||
| 117 | + continue | ||
| 118 | self._remove(reqpkg, changeset, locked, | ||
| 119 | pending, depth) | ||
| 120 | continue | ||
| 121 | @@ -978,12 +996,14 @@ class Transaction(object): | ||
| 122 | try: | ||
| 123 | for reqpkg in reqpkgs: | ||
| 124 | if reqpkg in locked and isinst(reqpkg): | ||
| 125 | - raise Failed, _("%s is locked") % reqpkg | ||
| 126 | + handle_failure(_("%s is locked") % reqpkg) | ||
| 127 | + continue | ||
| 128 | for reqpkg in reqpkgs: | ||
| 129 | if not cs.installed(reqpkg): | ||
| 130 | continue | ||
| 131 | if reqpkg in lk: | ||
| 132 | - raise Failed, _("%s is locked") % reqpkg | ||
| 133 | + handle_failure(_("%s is locked") % reqpkg) | ||
| 134 | + continue | ||
| 135 | self._remove(reqpkg, cs, lk, None, depth) | ||
| 136 | except Failed, e: | ||
| 137 | failures.append(unicode(e)) | ||
| 138 | @@ -991,9 +1011,10 @@ class Transaction(object): | ||
| 139 | alternatives.append((getweight(cs), cs, lk)) | ||
| 140 | |||
| 141 | if not alternatives: | ||
| 142 | - raise Failed, _("Can't install %s: all packages providing " | ||
| 143 | + handle_failure(_("Can't install %s: all packages providing " | ||
| 144 | "%s failed to install:\n%s") \ | ||
| 145 | - % (pkg, prv, "\n".join(failures)) | ||
| 146 | + % (pkg, prv, "\n".join(failures))) | ||
| 147 | + continue | ||
| 148 | |||
| 149 | alternatives.sort() | ||
| 150 | changeset.setState(alternatives[0][1]) | ||
| 151 | @@ -1246,6 +1267,7 @@ class Transaction(object): | ||
| 152 | changeset.setRequested(pkg, True) | ||
| 153 | except Failed, e: | ||
| 154 | if sysconf.has("attempt-install", soft=True): | ||
| 155 | + iface.warning(_("Can't install %s: %s") % (pkg, str(e))) | ||
| 156 | if pkg in changeset: | ||
| 157 | del changeset[pkg] | ||
| 158 | continue | ||
diff --git a/meta/recipes-devtools/python/python-smartpm/smart-attempt.patch b/meta/recipes-devtools/python/python-smartpm/smart-attempt.patch deleted file mode 100644 index e1182041bc..0000000000 --- a/meta/recipes-devtools/python/python-smartpm/smart-attempt.patch +++ /dev/null | |||
| @@ -1,185 +0,0 @@ | |||
| 1 | From b105e7fe812da3ccaf7155c0fe14c8728b0d39a5 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Mark Hatle <mark.hatle@windriver.com> | ||
| 3 | Date: Mon, 20 Jan 2014 14:30:52 +0000 | ||
| 4 | Subject: [PATCH] Add mechanism to attempt install without failing | ||
| 5 | |||
| 6 | In OpenEmbedded, for complementary and 'attemptonly' package processing, | ||
| 7 | we need a way to instruct smart to try to install, but ignore any | ||
| 8 | failures (usually conflicts). | ||
| 9 | |||
| 10 | This option only works for the install operation. | ||
| 11 | |||
| 12 | If a complementary install fails, an actual error occurred, one that | ||
| 13 | we can't ignore without losing the entire attempted transaction. Keep | ||
| 14 | this as an error so that we can catch these cases in the futre. | ||
| 15 | |||
| 16 | Upstream-Status: Pending | ||
| 17 | |||
| 18 | Signed-off-by: Mark Hatle <mark.hatle@windriver.com> | ||
| 19 | Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> | ||
| 20 | --- | ||
| 21 | backends/rpm/pm.py | 35 ++++++++++++++++++++++++++++++++++- | ||
| 22 | transaction.py | 50 +++++++++++++++++++++++++++++++++++++------------- | ||
| 23 | 2 files changed, 71 insertions(+), 14 deletions(-) | ||
| 24 | |||
| 25 | diff --git a/smart/backends/rpm/pm.py b/smart/backends/rpm/pm.py | ||
| 26 | index 9bbd952..ba6405a 100644 | ||
| 27 | --- a/smart/backends/rpm/pm.py | ||
| 28 | +++ b/smart/backends/rpm/pm.py | ||
| 29 | @@ -241,15 +241,56 @@ class RPMPackageManager(PackageManager): | ||
| 30 | cb = RPMCallback(prog, upgradednames) | ||
| 31 | cb.grabOutput(True) | ||
| 32 | probs = None | ||
| 33 | + retry = 0 | ||
| 34 | try: | ||
| 35 | probs = ts.run(cb, None) | ||
| 36 | finally: | ||
| 37 | del getTS.ts | ||
| 38 | cb.grabOutput(False) | ||
| 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): | ||
| 45 | + def remove_conflict(pkgNEVR): | ||
| 46 | + for key in changeset.keys(): | ||
| 47 | + if pkgNEVR == str(key): | ||
| 48 | + del changeset[key] | ||
| 49 | + del pkgpaths[key] | ||
| 50 | + iface.warning("Removing %s due to file %s conflicting with %s" % (pkgNEVR, fname, altNEVR)) | ||
| 51 | + break | ||
| 52 | + | ||
| 53 | + retry = 1 | ||
| 54 | + for prob in probs: | ||
| 55 | + if prob[1][0] == rpm.RPMPROB_NEW_FILE_CONFLICT: | ||
| 56 | + msg = prob[0].split() | ||
| 57 | + fname = msg[1] | ||
| 58 | + pkgNEVR = msg[7] | ||
| 59 | + altNEVR = msg[9] | ||
| 60 | + pkgNEVR = pkgNEVR.rsplit('.', 1)[0] + '@' + pkgNEVR.rsplit('.', 1)[1] | ||
| 61 | + altNEVR = altNEVR.rsplit('.', 1)[0] + '@' + altNEVR.rsplit('.', 1)[1] | ||
| 62 | + remove_conflict(pkgNEVR) | ||
| 63 | + elif prob[1][0] == rpm.RPMPROB_FILE_CONFLICT: | ||
| 64 | + msg = prob[0].split() | ||
| 65 | + fname = msg[1] | ||
| 66 | + pkgNEVR = msg[5] | ||
| 67 | + altNEVR = msg[11] | ||
| 68 | + pkgNEVR = pkgNEVR.rsplit('.', 1)[0] + '@' + pkgNEVR.rsplit('.', 1)[1] | ||
| 69 | + altNEVR = altNEVR.rsplit('.', 1)[0] + '@' + altNEVR.rsplit('.', 1)[1] | ||
| 70 | + remove_conflict(pkgNEVR) | ||
| 71 | + else: | ||
| 72 | + retry = 0 | ||
| 73 | + | ||
| 74 | prog.setDone() | ||
| 75 | - if probs is not None: | ||
| 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): | ||
| 80 | raise Error, "\n".join([x[0] for x in probs]) | ||
| 81 | prog.stop() | ||
| 82 | + if retry and len(changeset): | ||
| 83 | + self.commit(changeset, pkgpaths) | ||
| 84 | |||
| 85 | class RPMCallback: | ||
| 86 | def __init__(self, prog, upgradednames): | ||
| 87 | diff --git a/smart/transaction.py b/smart/transaction.py | ||
| 88 | index 4b90cb7..3e043e9 100644 | ||
| 89 | --- a/smart/transaction.py | ||
| 90 | +++ b/smart/transaction.py | ||
| 91 | @@ -555,6 +555,8 @@ class Transaction(object): | ||
| 92 | changeset.set(pkg, INSTALL) | ||
| 93 | isinst = changeset.installed | ||
| 94 | |||
| 95 | + attempt = sysconf.has("attempt-install", soft=True) | ||
| 96 | + | ||
| 97 | # Remove packages conflicted by this one. | ||
| 98 | for cnf in pkg.conflicts: | ||
| 99 | for prv in cnf.providedby: | ||
| 100 | @@ -564,11 +566,16 @@ class Transaction(object): | ||
| 101 | if not isinst(prvpkg): | ||
| 102 | locked[prvpkg] = (LOCKED_CONFLICT_BY, pkg) | ||
| 103 | continue | ||
| 104 | - if prvpkg in locked: | ||
| 105 | - raise Failed, _("Can't install %s: conflicted package " | ||
| 106 | - "%s is locked") % (pkg, prvpkg) | ||
| 107 | - self._remove(prvpkg, changeset, locked, pending, depth) | ||
| 108 | - pending.append((PENDING_UPDOWN, prvpkg)) | ||
| 109 | + if attempt: | ||
| 110 | + del changeset[pkg] | ||
| 111 | + raise Failed, _("Can't install %s: it conflicts with package " | ||
| 112 | + "%s") % (pkg, prvpkg) | ||
| 113 | + else: | ||
| 114 | + if prvpkg in locked: | ||
| 115 | + raise Failed, _("Can't install %s: conflicted package " | ||
| 116 | + "%s is locked") % (pkg, prvpkg) | ||
| 117 | + self._remove(prvpkg, changeset, locked, pending, depth) | ||
| 118 | + pending.append((PENDING_UPDOWN, prvpkg)) | ||
| 119 | |||
| 120 | # Remove packages conflicting with this one. | ||
| 121 | for prv in pkg.provides: | ||
| 122 | @@ -579,12 +586,18 @@ class Transaction(object): | ||
| 123 | if not isinst(cnfpkg): | ||
| 124 | locked[cnfpkg] = (LOCKED_CONFLICT, pkg) | ||
| 125 | continue | ||
| 126 | - if cnfpkg in locked: | ||
| 127 | + if attempt: | ||
| 128 | + del changeset[pkg] | ||
| 129 | raise Failed, _("Can't install %s: it's conflicted by " | ||
| 130 | - "the locked package %s") \ | ||
| 131 | - % (pkg, cnfpkg) | ||
| 132 | - self._remove(cnfpkg, changeset, locked, pending, depth) | ||
| 133 | - pending.append((PENDING_UPDOWN, cnfpkg)) | ||
| 134 | + "the package %s") \ | ||
| 135 | + % (pkg, cnfpkg) | ||
| 136 | + else: | ||
| 137 | + if cnfpkg in locked: | ||
| 138 | + raise Failed, _("Can't install %s: it's conflicted by " | ||
| 139 | + "the locked package %s") \ | ||
| 140 | + % (pkg, cnfpkg) | ||
| 141 | + self._remove(cnfpkg, changeset, locked, pending, depth) | ||
| 142 | + pending.append((PENDING_UPDOWN, cnfpkg)) | ||
| 143 | |||
| 144 | # Remove packages with the same name that can't | ||
| 145 | # coexist with this one. | ||
| 146 | @@ -594,10 +607,15 @@ class Transaction(object): | ||
| 147 | if not isinst(namepkg): | ||
| 148 | locked[namepkg] = (LOCKED_NO_COEXIST, pkg) | ||
| 149 | continue | ||
| 150 | - if namepkg in locked: | ||
| 151 | + if attempt: | ||
| 152 | + del changeset[pkg] | ||
| 153 | raise Failed, _("Can't install %s: it can't coexist " | ||
| 154 | "with %s") % (pkg, namepkg) | ||
| 155 | - self._remove(namepkg, changeset, locked, pending, depth) | ||
| 156 | + else: | ||
| 157 | + if namepkg in locked: | ||
| 158 | + raise Failed, _("Can't install %s: it can't coexist " | ||
| 159 | + "with %s") % (pkg, namepkg) | ||
| 160 | + self._remove(namepkg, changeset, locked, pending, depth) | ||
| 161 | |||
| 162 | # Install packages required by this one. | ||
| 163 | for req in pkg.requires + pkg.recommends: | ||
| 164 | @@ -1176,6 +1194,8 @@ class Transaction(object): | ||
| 165 | |||
| 166 | self._policy.runStarting() | ||
| 167 | |||
| 168 | + attempt = sysconf.has("attempt-install", soft=True) | ||
| 169 | + | ||
| 170 | try: | ||
| 171 | changeset = self._changeset.copy() | ||
| 172 | isinst = changeset.installed | ||
| 173 | @@ -1190,7 +1210,11 @@ class Transaction(object): | ||
| 174 | locked[pkg] = (LOCKED_KEEP, None) | ||
| 175 | elif op is INSTALL: | ||
| 176 | if not isinst(pkg) and pkg in locked: | ||
| 177 | - raise Failed, _("Can't install %s: it's locked") % pkg | ||
| 178 | + if attempt: | ||
| 179 | + iface.warning(_("Can't install %s: it's locked") % pkg) | ||
| 180 | + del changeset[pkg] | ||
| 181 | + else: | ||
| 182 | + raise Failed, _("Can't install %s: it's locked") % pkg | ||
| 183 | changeset.set(pkg, INSTALL) | ||
| 184 | locked[pkg] = (LOCKED_INSTALL, None) | ||
| 185 | elif op is REMOVE: | ||
diff --git a/meta/recipes-devtools/python/python-smartpm/smart-cache.py-getPackages-matches-name-version.patch b/meta/recipes-devtools/python/python-smartpm/smart-cache.py-getPackages-matches-name-version.patch deleted file mode 100644 index 225b02f964..0000000000 --- a/meta/recipes-devtools/python/python-smartpm/smart-cache.py-getPackages-matches-name-version.patch +++ /dev/null | |||
| @@ -1,43 +0,0 @@ | |||
| 1 | From ee05e55e84b53f4bb0d0baba13ca47a8f84b7cb4 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Robert Yang <liezhi.yang@windriver.com> | ||
| 3 | Date: Wed, 30 Sep 2015 01:12:52 -0700 | ||
| 4 | Subject: [PATCH] smart:cache.py: getPackages() matches name + arch | ||
| 5 | |||
| 6 | It only matched name ony in the past, for example: | ||
| 7 | smart install busybox (matched) | ||
| 8 | but: | ||
| 9 | smart install busybox@core2_64 (didn't match) | ||
| 10 | |||
| 11 | The installation is very slow when no match since it would seach all the | ||
| 12 | packages in the repo | ||
| 13 | This patch makes it match both. | ||
| 14 | |||
| 15 | Upstream-Status: Pending | ||
| 16 | |||
| 17 | Signed-off-by: Robert Yang <liezhi.yang@windriver.com> | ||
| 18 | --- | ||
| 19 | smart/cache.py | 3 ++- | ||
| 20 | smart/ccache.c | 9 ++++++++- | ||
| 21 | 2 files changed, 10 insertions(+), 2 deletions(-) | ||
| 22 | |||
| 23 | diff --git a/smart/control.py b/smart/control.py | ||
| 24 | index d44abe7..f23a604 100644 | ||
| 25 | --- a/smart/control.py | ||
| 26 | +++ b/smart/control.py | ||
| 27 | @@ -876,9 +876,13 @@ class Control(object): | ||
| 28 | objects = [] | ||
| 29 | |||
| 30 | # If we find packages with exactly the given | ||
| 31 | - # name or name-version, use them. | ||
| 32 | - for pkg in self._cache.getPackages(s): | ||
| 33 | - if pkg.name == s or "%s-%s" % (pkg.name, pkg.version) == s: | ||
| 34 | + # name, name-version, or name@arch, use them. | ||
| 35 | + s_name = s | ||
| 36 | + if "@" in s: | ||
| 37 | + s_name = s.split("@")[0] | ||
| 38 | + for pkg in self._cache.getPackages(s_name): | ||
| 39 | + if pkg.name == s or "%s-%s" % (pkg.name, pkg.version) == s \ | ||
| 40 | + or "%s@%s" % (pkg.name, pkg.version.split('@')[1]) == s: | ||
| 41 | objects.append((1.0, pkg)) | ||
| 42 | |||
| 43 | if not objects: | ||
diff --git a/meta/recipes-devtools/python/python-smartpm/smart-channel-remove-all.patch b/meta/recipes-devtools/python/python-smartpm/smart-channel-remove-all.patch deleted file mode 100644 index da23e7ce42..0000000000 --- a/meta/recipes-devtools/python/python-smartpm/smart-channel-remove-all.patch +++ /dev/null | |||
| @@ -1,33 +0,0 @@ | |||
| 1 | From 6d2363a705697f615d9e5af5d6703b291e618b46 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Daniel Klauer <daniel.klauer@gin.de> | ||
| 3 | Date: Thu, 12 May 2016 17:55:01 +0200 | ||
| 4 | Subject: [PATCH] Fix channel command --remove-all option parsing | ||
| 5 | |||
| 6 | Option.take_action() stores a list of options given for validation later. | ||
| 7 | It strips leading dashes and turns remaining dashes into underscores. | ||
| 8 | This list is what ensure_action() will compare its arguments against, | ||
| 9 | thus we must use underscores here. | ||
| 10 | |||
| 11 | Upstream-Status: Pending | ||
| 12 | |||
| 13 | Signed-off-by: Daniel Klauer <daniel.klauer@gin.de> | ||
| 14 | --- | ||
| 15 | smart/commands/channel.py | 2 +- | ||
| 16 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 17 | |||
| 18 | diff --git a/smart/commands/channel.py b/smart/commands/channel.py | ||
| 19 | index 108f3f1..6234f69 100644 | ||
| 20 | --- a/smart/commands/channel.py | ||
| 21 | +++ b/smart/commands/channel.py | ||
| 22 | @@ -164,7 +164,7 @@ def main(ctrl, opts): | ||
| 23 | opts.check_args_of_option("edit", 0) | ||
| 24 | opts.check_args_of_option("enable", -1) | ||
| 25 | opts.check_args_of_option("disable", -1) | ||
| 26 | - opts.ensure_action("channel", ["add", "set", "remove", "remove-all", | ||
| 27 | + opts.ensure_action("channel", ["add", "set", "remove", "remove_all", | ||
| 28 | "list", "show", "yaml", "enable", "disable"]) | ||
| 29 | opts.check_remaining_args() | ||
| 30 | |||
| 31 | -- | ||
| 32 | 1.9.1 | ||
| 33 | |||
diff --git a/meta/recipes-devtools/python/python-smartpm/smart-channelsdir.patch b/meta/recipes-devtools/python/python-smartpm/smart-channelsdir.patch deleted file mode 100644 index e621b33875..0000000000 --- a/meta/recipes-devtools/python/python-smartpm/smart-channelsdir.patch +++ /dev/null | |||
| @@ -1,24 +0,0 @@ | |||
| 1 | Make CHANNELSDIR in smart empty, since this causes host contamination issues | ||
| 2 | on some RPM-based hosts on which smart is already installed. | ||
| 3 | |||
| 4 | [YOCTO #3881] | ||
| 5 | |||
| 6 | Upstream-Status: Inappropriate [embedded specific] | ||
| 7 | |||
| 8 | diff --git a/smart/plugins/channelsync.py b/smart/plugins/channelsync.py | ||
| 9 | index 3ba95ff..646d696 100644 | ||
| 10 | --- a/smart/plugins/channelsync.py | ||
| 11 | +++ b/smart/plugins/channelsync.py | ||
| 12 | @@ -23,7 +23,11 @@ from smart.channel import * | ||
| 13 | from smart import * | ||
| 14 | import os | ||
| 15 | |||
| 16 | -CHANNELSDIR = "/etc/smart/channels/" | ||
| 17 | +# For now, we leave the definition of CHANNELSDIR empty. This prevents smart | ||
| 18 | +# from erroneously consider the build host's channels while setting up its | ||
| 19 | +# channels [YOCTO #3881]. If this feature will be used in the future, CHANNELSDIR | ||
| 20 | +# should be set to a proper value. | ||
| 21 | +CHANNELSDIR = "" | ||
| 22 | |||
| 23 | def syncChannels(channelsdir, force=None): | ||
| 24 | |||
diff --git a/meta/recipes-devtools/python/python-smartpm/smart-locale.patch b/meta/recipes-devtools/python/python-smartpm/smart-locale.patch deleted file mode 100644 index 0f1dfb91d5..0000000000 --- a/meta/recipes-devtools/python/python-smartpm/smart-locale.patch +++ /dev/null | |||
| @@ -1,27 +0,0 @@ | |||
| 1 | rpm or commands run by rpm can use output which isn't strictly acsii such | ||
| 2 | as quotation characters around expression which are character 0xe2. | ||
| 3 | |||
| 4 | Use utf-8 as an encoding rather than whatever the system suggests to | ||
| 5 | ensure smart copes with this rather than erroring with unicode errors. | ||
| 6 | |||
| 7 | RP 2016/5/19 | ||
| 8 | Upstream-Status: Pending | ||
| 9 | |||
| 10 | |||
| 11 | Index: git/smart/backends/rpm/pm.py | ||
| 12 | =================================================================== | ||
| 13 | --- git.orig/smart/backends/rpm/pm.py | ||
| 14 | +++ git/smart/backends/rpm/pm.py | ||
| 15 | @@ -32,11 +32,7 @@ from smart.pm import PackageManager | ||
| 16 | from smart import sysconf, iface, Error, _ | ||
| 17 | |||
| 18 | |||
| 19 | -try: | ||
| 20 | - ENCODING = locale.getpreferredencoding() | ||
| 21 | -except locale.Error: | ||
| 22 | - ENCODING = "ascii" | ||
| 23 | - | ||
| 24 | +ENCODING = "utf-8" | ||
| 25 | |||
| 26 | def get_public_key(header): | ||
| 27 | return header.sprintf("%|DSAHEADER?{%{DSAHEADER:pgpsig}}:" | ||
diff --git a/meta/recipes-devtools/python/python-smartpm/smart-recommends.patch b/meta/recipes-devtools/python/python-smartpm/smart-recommends.patch deleted file mode 100644 index d607fc4752..0000000000 --- a/meta/recipes-devtools/python/python-smartpm/smart-recommends.patch +++ /dev/null | |||
| @@ -1,381 +0,0 @@ | |||
| 1 | Handle recommended packages in core and rpm backends | ||
| 2 | |||
| 3 | Identify and store recommended packages in the cache, add a query option | ||
| 4 | to read them and ignore them if they are not present when installing. | ||
| 5 | |||
| 6 | Initial identification code from Mark Hatle <mark.hatle@windriver.com>. | ||
| 7 | |||
| 8 | Upstream-Status: Pending | ||
| 9 | |||
| 10 | Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> | ||
| 11 | |||
| 12 | diff --git a/smart/backends/rpm/base.py b/smart/backends/rpm/base.py | ||
| 13 | index 9332ea0..4fcfbee 100644 | ||
| 14 | --- a/smart/backends/rpm/base.py | ||
| 15 | +++ b/smart/backends/rpm/base.py | ||
| 16 | @@ -225,6 +225,52 @@ class RPMPackage(Package): | ||
| 17 | break | ||
| 18 | else: | ||
| 19 | return False | ||
| 20 | + srecs = fk(self.recommends) | ||
| 21 | + orecs = fk(other.recommends) | ||
| 22 | + if srecs != orecs: | ||
| 23 | + for srec in srecs: | ||
| 24 | + if srec.name[0] == "/" or srec in orecs: | ||
| 25 | + continue | ||
| 26 | + for orec in orecs: | ||
| 27 | + if (srec.name == orec.name and | ||
| 28 | + srec.relation == orec.relation and | ||
| 29 | + checkver(srec.version, orec.version)): | ||
| 30 | + break | ||
| 31 | + else: | ||
| 32 | + return False | ||
| 33 | + for orec in orecs: | ||
| 34 | + if orec.name[0] == "/" or orec in srecs: | ||
| 35 | + continue | ||
| 36 | + for srec in srecs: | ||
| 37 | + if (srec.name == orec.name and | ||
| 38 | + srec.relation == orec.relation and | ||
| 39 | + checkver(srec.version, orec.version)): | ||
| 40 | + break | ||
| 41 | + else: | ||
| 42 | + return False | ||
| 43 | + srecs = fk(self.recommends) | ||
| 44 | + orecs = fk(other.recommends) | ||
| 45 | + if srecs != orecs: | ||
| 46 | + for srec in srecs: | ||
| 47 | + if srec.name[0] == "/" or srec in orecs: | ||
| 48 | + continue | ||
| 49 | + for orec in orecs: | ||
| 50 | + if (srec.name == orec.name and | ||
| 51 | + srec.relation == orec.relation and | ||
| 52 | + checkver(srec.version, orec.version)): | ||
| 53 | + break | ||
| 54 | + else: | ||
| 55 | + return False | ||
| 56 | + for orec in orecs: | ||
| 57 | + if orec.name[0] == "/" or orec in srecs: | ||
| 58 | + continue | ||
| 59 | + for srec in srecs: | ||
| 60 | + if (srec.name == orec.name and | ||
| 61 | + srec.relation == orec.relation and | ||
| 62 | + checkver(srec.version, orec.version)): | ||
| 63 | + break | ||
| 64 | + else: | ||
| 65 | + return False | ||
| 66 | return True | ||
| 67 | |||
| 68 | def coexists(self, other): | ||
| 69 | diff --git a/smart/ccache.c b/smart/ccache.c | ||
| 70 | index 7193185..8b66515 100644 | ||
| 71 | --- a/smart/ccache.c | ||
| 72 | +++ b/smart/ccache.c | ||
| 73 | @@ -500,6 +500,46 @@ Package_equals(PackageObject *self, PackageObject *other) | ||
| 74 | } | ||
| 75 | } | ||
| 76 | |||
| 77 | + ilen = 0; | ||
| 78 | + jlen = 0; | ||
| 79 | + for (i = 0; i != PyList_GET_SIZE(self->recommends); i++) { | ||
| 80 | + PyObject *item = PyList_GET_ITEM(self->recommends, i); | ||
| 81 | + if (!PyObject_IsInstance(item, (PyObject *)&Depends_Type)) { | ||
| 82 | + PyErr_SetString(PyExc_TypeError, "Depends instance expected"); | ||
| 83 | + return NULL; | ||
| 84 | + } | ||
| 85 | + if (STR(((DependsObject *)item)->name)[0] != '/') | ||
| 86 | + ilen += 1; | ||
| 87 | + } | ||
| 88 | + for (j = 0; j != PyList_GET_SIZE(other->recommends); j++) { | ||
| 89 | + PyObject *item = PyList_GET_ITEM(other->recommends, j); | ||
| 90 | + if (!PyObject_IsInstance(item, (PyObject *)&Depends_Type)) { | ||
| 91 | + PyErr_SetString(PyExc_TypeError, "Depends instance expected"); | ||
| 92 | + return NULL; | ||
| 93 | + } | ||
| 94 | + if (STR(((DependsObject *)item)->name)[0] != '/') | ||
| 95 | + jlen += 1; | ||
| 96 | + } | ||
| 97 | + if (ilen != jlen) { | ||
| 98 | + ret = Py_False; | ||
| 99 | + goto exit; | ||
| 100 | + } | ||
| 101 | + | ||
| 102 | + ilen = PyList_GET_SIZE(self->recommends); | ||
| 103 | + jlen = PyList_GET_SIZE(other->recommends); | ||
| 104 | + for (i = 0; i != ilen; i++) { | ||
| 105 | + PyObject *item = PyList_GET_ITEM(self->recommends, i); | ||
| 106 | + if (STR(((DependsObject *)item)->name)[0] != '/') { | ||
| 107 | + for (j = 0; j != jlen; j++) | ||
| 108 | + if (item == PyList_GET_ITEM(other->recommends, j)) | ||
| 109 | + break; | ||
| 110 | + if (j == jlen) { | ||
| 111 | + ret = Py_False; | ||
| 112 | + goto exit; | ||
| 113 | + } | ||
| 114 | + } | ||
| 115 | + } | ||
| 116 | + | ||
| 117 | exit: | ||
| 118 | Py_INCREF(ret); | ||
| 119 | return ret; | ||
| 120 | @@ -1813,6 +1853,59 @@ Loader_buildPackage(LoaderObject *self, PyObject *args) | ||
| 121 | } | ||
| 122 | } | ||
| 123 | |||
| 124 | + /* if recargs: */ | ||
| 125 | + if (recargs) { | ||
| 126 | + int i = 0; | ||
| 127 | + int len = PyList_GET_SIZE(recargs); | ||
| 128 | + /* pkg.recommends = [] */ | ||
| 129 | + Py_DECREF(pkgobj->recommends); | ||
| 130 | + pkgobj->recommends = PyList_New(len); | ||
| 131 | + /* for args in recargs: */ | ||
| 132 | + for (; i != len; i++) { | ||
| 133 | + PyObject *args = PyList_GET_ITEM(recargs, i); | ||
| 134 | + DependsObject *recobj; | ||
| 135 | + PyObject *rec; | ||
| 136 | + | ||
| 137 | + if (!PyTuple_Check(args)) { | ||
| 138 | + PyErr_SetString(PyExc_TypeError, | ||
| 139 | + "Item in recargs is not a tuple"); | ||
| 140 | + return NULL; | ||
| 141 | + } | ||
| 142 | + | ||
| 143 | + /* rec = cache._objmap.get(args) */ | ||
| 144 | + rec = PyDict_GetItem(cache->_objmap, args); | ||
| 145 | + recobj = (DependsObject *)rec; | ||
| 146 | + | ||
| 147 | + /* if not rec: */ | ||
| 148 | + if (!rec) { | ||
| 149 | + if (!PyTuple_Check(args) || PyTuple_GET_SIZE(args) < 2) { | ||
| 150 | + PyErr_SetString(PyExc_ValueError, "Invalid recargs tuple"); | ||
| 151 | + return NULL; | ||
| 152 | + } | ||
| 153 | + /* rec = args[0](*args[1:]) */ | ||
| 154 | + callargs = PyTuple_GetSlice(args, 1, PyTuple_GET_SIZE(args)); | ||
| 155 | + rec = PyObject_CallObject(PyTuple_GET_ITEM(args, 0), callargs); | ||
| 156 | + Py_DECREF(callargs); | ||
| 157 | + if (!rec) return NULL; | ||
| 158 | + recobj = (DependsObject *)rec; | ||
| 159 | + | ||
| 160 | + /* cache._objmap[args] = rec */ | ||
| 161 | + PyDict_SetItem(cache->_objmap, args, rec); | ||
| 162 | + Py_DECREF(rec); | ||
| 163 | + | ||
| 164 | + /* cache._recommends.append(rec) */ | ||
| 165 | + PyList_Append(cache->_recommends, rec); | ||
| 166 | + } | ||
| 167 | + | ||
| 168 | + /* relpkgs.append(rec.packages) */ | ||
| 169 | + PyList_Append(relpkgs, recobj->packages); | ||
| 170 | + | ||
| 171 | + /* pkg.recommends.append(rec) */ | ||
| 172 | + Py_INCREF(rec); | ||
| 173 | + PyList_SET_ITEM(pkgobj->recommends, i, rec); | ||
| 174 | + } | ||
| 175 | + } | ||
| 176 | + | ||
| 177 | /* if upgargs: */ | ||
| 178 | if (upgargs) { | ||
| 179 | int i = 0; | ||
| 180 | @@ -2592,6 +2685,16 @@ Cache_reset(CacheObject *self, PyObject *args) | ||
| 181 | if (PyList_Check(reqobj->providedby)) | ||
| 182 | LIST_CLEAR(reqobj->providedby); | ||
| 183 | } | ||
| 184 | + len = PyList_GET_SIZE(self->_recommends); | ||
| 185 | + for (i = 0; i != len; i++) { | ||
| 186 | + DependsObject *reqobj; | ||
| 187 | + PyObject *req; | ||
| 188 | + req = PyList_GET_ITEM(self->_recommends, i); | ||
| 189 | + reqobj = (DependsObject *)req; | ||
| 190 | + LIST_CLEAR(reqobj->packages); | ||
| 191 | + if (PyList_Check(reqobj->providedby)) | ||
| 192 | + LIST_CLEAR(reqobj->providedby); | ||
| 193 | + } | ||
| 194 | len = PyList_GET_SIZE(self->_upgrades); | ||
| 195 | for (i = 0; i != len; i++) { | ||
| 196 | DependsObject *upgobj; | ||
| 197 | @@ -2834,6 +2937,30 @@ Cache__reload(CacheObject *self, PyObject *args) | ||
| 198 | } | ||
| 199 | |||
| 200 | /* | ||
| 201 | + for rec in pkg.recommends: | ||
| 202 | + rec.packages.append(pkg) | ||
| 203 | + if rec not in recommends: | ||
| 204 | + recommends[rec] = True | ||
| 205 | + objmap[rec.getInitArgs()] = rec | ||
| 206 | + */ | ||
| 207 | + if (PyList_Check(pkg->recommends)) { | ||
| 208 | + klen = PyList_GET_SIZE(pkg->recommends); | ||
| 209 | + for (k = 0; k != klen; k++) { | ||
| 210 | + PyObject *rec = PyList_GET_ITEM(pkg->recommends, k); | ||
| 211 | + PyList_Append(((DependsObject *)rec)->packages, | ||
| 212 | + (PyObject *)pkg); | ||
| 213 | + if (!PyDict_GetItem(recommends, rec)) { | ||
| 214 | + PyDict_SetItem(recommends, rec, Py_True); | ||
| 215 | + args = PyObject_CallMethod(rec, "getInitArgs", | ||
| 216 | + NULL); | ||
| 217 | + if (!args) return NULL; | ||
| 218 | + PyDict_SetItem(objmap, args, rec); | ||
| 219 | + Py_DECREF(args); | ||
| 220 | + } | ||
| 221 | + } | ||
| 222 | + } | ||
| 223 | + | ||
| 224 | + /* | ||
| 225 | for upg in pkg.upgrades: | ||
| 226 | upg.packages.append(pkg) | ||
| 227 | if upg not in upgrades: | ||
| 228 | @@ -3097,6 +3224,47 @@ Cache_linkDeps(CacheObject *self, PyObject *args) | ||
| 229 | Py_DECREF(seq); | ||
| 230 | } | ||
| 231 | |||
| 232 | + /* recnames = {} */ | ||
| 233 | + recnames = PyDict_New(); | ||
| 234 | + /* for rec in self._recommends: */ | ||
| 235 | + len = PyList_GET_SIZE(self->_recommends); | ||
| 236 | + for (i = 0; i != len; i++) { | ||
| 237 | + PyObject *rec = PyList_GET_ITEM(self->_recommends, i); | ||
| 238 | + | ||
| 239 | + /* for name in rec.getMatchNames(): */ | ||
| 240 | + PyObject *names = PyObject_CallMethod(rec, "getMatchNames", NULL); | ||
| 241 | + PyObject *seq = PySequence_Fast(names, "getMatchNames() returned " | ||
| 242 | + "non-sequence object"); | ||
| 243 | + int nameslen; | ||
| 244 | + if (!seq) return NULL; | ||
| 245 | + nameslen = PySequence_Fast_GET_SIZE(seq); | ||
| 246 | + for (j = 0; j != nameslen; j++) { | ||
| 247 | + PyObject *name = PySequence_Fast_GET_ITEM(seq, j); | ||
| 248 | + | ||
| 249 | + /* lst = recnames.get(name) */ | ||
| 250 | + lst = PyDict_GetItem(recnames, name); | ||
| 251 | + | ||
| 252 | + /* | ||
| 253 | + if lst: | ||
| 254 | + lst.append(rec) | ||
| 255 | + else: | ||
| 256 | + recnames[name] = [rec] | ||
| 257 | + */ | ||
| 258 | + if (lst) { | ||
| 259 | + PyList_Append(lst, rec); | ||
| 260 | + } else { | ||
| 261 | + lst = PyList_New(1); | ||
| 262 | + Py_INCREF(rec); | ||
| 263 | + PyList_SET_ITEM(lst, 0, rec); | ||
| 264 | + PyDict_SetItem(recnames, name, lst); | ||
| 265 | + Py_DECREF(lst); | ||
| 266 | + } | ||
| 267 | + } | ||
| 268 | + | ||
| 269 | + Py_DECREF(names); | ||
| 270 | + Py_DECREF(seq); | ||
| 271 | + } | ||
| 272 | + | ||
| 273 | /* upgnames = {} */ | ||
| 274 | upgnames = PyDict_New(); | ||
| 275 | /* for upg in self._upgrades: */ | ||
| 276 | @@ -3286,6 +3454,56 @@ Cache_linkDeps(CacheObject *self, PyObject *args) | ||
| 277 | } | ||
| 278 | } | ||
| 279 | |||
| 280 | + /* lst = recnames.get(prv.name) */ | ||
| 281 | + lst = PyDict_GetItem(recnames, prv->name); | ||
| 282 | + | ||
| 283 | + /* if lst: */ | ||
| 284 | + if (lst) { | ||
| 285 | + /* for rec in lst: */ | ||
| 286 | + int reclen = PyList_GET_SIZE(lst); | ||
| 287 | + for (j = 0; j != reclen; j++) { | ||
| 288 | + DependsObject *rec = (DependsObject *)PyList_GET_ITEM(lst, j); | ||
| 289 | + /* if rec.matches(prv): */ | ||
| 290 | + PyObject *ret = PyObject_CallMethod((PyObject *)rec, "matches", | ||
| 291 | + "O", (PyObject *)prv); | ||
| 292 | + if (!ret) return NULL; | ||
| 293 | + if (PyObject_IsTrue(ret)) { | ||
| 294 | + /* | ||
| 295 | + if rec.providedby: | ||
| 296 | + rec.providedby.append(prv) | ||
| 297 | + else: | ||
| 298 | + rec.providedby = [prv] | ||
| 299 | + */ | ||
| 300 | + if (PyList_Check(rec->providedby)) { | ||
| 301 | + PyList_Append(rec->providedby, (PyObject *)prv); | ||
| 302 | + } else { | ||
| 303 | + PyObject *_lst = PyList_New(1); | ||
| 304 | + Py_INCREF(prv); | ||
| 305 | + PyList_SET_ITEM(_lst, 0, (PyObject *)prv); | ||
| 306 | + Py_DECREF(rec->providedby); | ||
| 307 | + rec->providedby = _lst; | ||
| 308 | + } | ||
| 309 | + | ||
| 310 | + /* | ||
| 311 | + if prv.recommendedby: | ||
| 312 | + prv.recommendedby.append(prv) | ||
| 313 | + else: | ||
| 314 | + prv.recommendedby = [prv] | ||
| 315 | + */ | ||
| 316 | + if (PyList_Check(prv->recommendedby)) { | ||
| 317 | + PyList_Append(prv->recommendedby, (PyObject *)rec); | ||
| 318 | + } else { | ||
| 319 | + PyObject *_lst = PyList_New(1); | ||
| 320 | + Py_INCREF(rec); | ||
| 321 | + PyList_SET_ITEM(_lst, 0, (PyObject *)rec); | ||
| 322 | + Py_DECREF(prv->recommendedby); | ||
| 323 | + prv->recommendedby = _lst; | ||
| 324 | + } | ||
| 325 | + } | ||
| 326 | + Py_DECREF(ret); | ||
| 327 | + } | ||
| 328 | + } | ||
| 329 | + | ||
| 330 | /* lst = upgnames.get(prv.name) */ | ||
| 331 | lst = PyDict_GetItem(upgnames, prv->name); | ||
| 332 | |||
| 333 | @@ -3821,6 +4094,21 @@ Cache__setstate__(CacheObject *self, PyObject *state) | ||
| 334 | } | ||
| 335 | |||
| 336 | /* | ||
| 337 | + for rec in pkg.recommends: | ||
| 338 | + rec.packages.append(pkg) | ||
| 339 | + recommends[rec] = True | ||
| 340 | + */ | ||
| 341 | + if (PyList_Check(pkgobj->recommends)) { | ||
| 342 | + jlen = PyList_GET_SIZE(pkgobj->recommends); | ||
| 343 | + for (j = 0; j != jlen; j++) { | ||
| 344 | + PyObject *rec = PyList_GET_ITEM(pkgobj->recommends, j); | ||
| 345 | + DependsObject *recobj = (DependsObject *)rec; | ||
| 346 | + PyList_Append(recobj->packages, pkg); | ||
| 347 | + PyDict_SetItem(recommends, rec, Py_True); | ||
| 348 | + } | ||
| 349 | + } | ||
| 350 | + | ||
| 351 | + /* | ||
| 352 | for upg in pkg.upgrades: | ||
| 353 | upg.packages.append(pkg) | ||
| 354 | upgrades[upg] = True | ||
| 355 | diff --git a/smart/commands/query.py b/smart/commands/query.py | ||
| 356 | index 9265cd9..b6f5697 100644 | ||
| 357 | --- a/smart/commands/query.py | ||
| 358 | +++ b/smart/commands/query.py | ||
| 359 | @@ -750,6 +750,22 @@ class TextOutput(NullOutput): | ||
| 360 | name = str(prvpkg) | ||
| 361 | print " ", "%s (%s)" % (name, prv) | ||
| 362 | |||
| 363 | + def showRecommends(self, pkg, rec): | ||
| 364 | + if self._firstrecommends: | ||
| 365 | + self._firstrecommends = False | ||
| 366 | + print " ", _("Recommends:") | ||
| 367 | + print " ", rec | ||
| 368 | + | ||
| 369 | + def showRecommendsProvidedBy(self, pkg, req, prv, prvpkg): | ||
| 370 | + if self._firstrecommendsprovidedby: | ||
| 371 | + self._firstrecommendsprovidedby = False | ||
| 372 | + print " ", _("Provided By:") | ||
| 373 | + if self.opts.hide_version: | ||
| 374 | + name = prvpkg.name | ||
| 375 | + else: | ||
| 376 | + name = str(prvpkg) | ||
| 377 | + print " ", "%s (%s)" % (name, prv) | ||
| 378 | + | ||
| 379 | def showUpgrades(self, pkg, upg): | ||
| 380 | if self._firstupgrades: | ||
| 381 | self._firstupgrades = False | ||
diff --git a/meta/recipes-devtools/python/python-smartpm/smart-rpm-transaction-failure-check.patch b/meta/recipes-devtools/python/python-smartpm/smart-rpm-transaction-failure-check.patch deleted file mode 100644 index bb8c3afdb7..0000000000 --- a/meta/recipes-devtools/python/python-smartpm/smart-rpm-transaction-failure-check.patch +++ /dev/null | |||
| @@ -1,57 +0,0 @@ | |||
| 1 | From 0c55d7e18f40465e95e8e4bf22af01f5d4477d3c Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Daniel Klauer <daniel.klauer@gin.de> | ||
| 3 | Date: Wed, 11 May 2016 17:22:49 +0200 | ||
| 4 | Subject: [PATCH] rpm: Don't ignore transaction error with empty problems list | ||
| 5 | |||
| 6 | SmartPM could misinterpret RPM transaction error as success, | ||
| 7 | if ts.run() (RPM Python API) returns an empty problems list, | ||
| 8 | because of incorrect check for None which treated empty list | ||
| 9 | to be the same as None when it has different meaning. | ||
| 10 | |||
| 11 | ts.run() returns: | ||
| 12 | * None in case of success | ||
| 13 | * problems list in case of error, may be empty | ||
| 14 | (look at rpmts_Run() in rpm-5.4.14/python/rpmts-py.c [1]) | ||
| 15 | |||
| 16 | "if mylist" is not good enough to check for error here, because it will | ||
| 17 | treat an empty list as "false" because its len() == 0 [2]. | ||
| 18 | |||
| 19 | ts.check() seems to be different (it's ok for it to return an empty list), | ||
| 20 | but for consistency it should be made clear that it can return either None, | ||
| 21 | an empty list or a non-empty list. | ||
| 22 | |||
| 23 | [1] http://rpm5.org/cvs/fileview?f=rpm/python/rpmts-py.c&v=1.111.2.3 | ||
| 24 | [2] https://docs.python.org/2/library/stdtypes.html#truth-value-testing | ||
| 25 | |||
| 26 | Upstream-Status: Pending | ||
| 27 | |||
| 28 | Signed-off-by: Daniel Klauer <daniel.klauer@gin.de> | ||
| 29 | --- | ||
| 30 | smart/backends/rpm/pm.py | 4 ++-- | ||
| 31 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
| 32 | |||
| 33 | diff --git a/smart/backends/rpm/pm.py b/smart/backends/rpm/pm.py | ||
| 34 | index 9bbd952..635f726 100644 | ||
| 35 | --- a/smart/backends/rpm/pm.py | ||
| 36 | +++ b/smart/backends/rpm/pm.py | ||
| 37 | @@ -208,7 +208,7 @@ class RPMPackageManager(PackageManager): | ||
| 38 | force = sysconf.get("rpm-force", False) | ||
| 39 | if not force: | ||
| 40 | probs = ts.check() | ||
| 41 | - if probs: | ||
| 42 | + if (probs is not None) and (len(probs) != 0): | ||
| 43 | problines = [] | ||
| 44 | for prob in probs: | ||
| 45 | name1 = "%s-%s-%s" % prob[0] | ||
| 46 | @@ -247,7 +247,7 @@ class RPMPackageManager(PackageManager): | ||
| 47 | del getTS.ts | ||
| 48 | cb.grabOutput(False) | ||
| 49 | prog.setDone() | ||
| 50 | - if probs: | ||
| 51 | + if probs is not None: | ||
| 52 | raise Error, "\n".join([x[0] for x in probs]) | ||
| 53 | prog.stop() | ||
| 54 | |||
| 55 | -- | ||
| 56 | 1.9.1 | ||
| 57 | |||
diff --git a/meta/recipes-devtools/python/python-smartpm/smart-set-noprogress-for-pycurl.patch b/meta/recipes-devtools/python/python-smartpm/smart-set-noprogress-for-pycurl.patch deleted file mode 100644 index 2885998acc..0000000000 --- a/meta/recipes-devtools/python/python-smartpm/smart-set-noprogress-for-pycurl.patch +++ /dev/null | |||
| @@ -1,20 +0,0 @@ | |||
| 1 | Set NOPROGRESS for pycurl just as same as default operation in pycurl module itself. | ||
| 2 | If set NOPROGRESS with 0 for pycurl, it causes dead lock issue of Python GIL when | ||
| 3 | call smart library by python gui just like pygtk. | ||
| 4 | |||
| 5 | Upstream-Status: Pending | ||
| 6 | |||
| 7 | Signed-off-by: Kai Kang <kai.kang@windriver.com> | ||
| 8 | --- | ||
| 9 | diff -u smart-1.4.1/smart.orig/fetcher.py smart-1.4.1/smart/fetcher.py | ||
| 10 | --- smart-1.4.1/smart.orig/fetcher.py 2014-07-15 16:42:19.240437080 +0800 | ||
| 11 | +++ smart-1.4.1/smart/fetcher.py 2014-07-15 17:02:37.812470289 +0800 | ||
| 12 | @@ -1720,7 +1720,7 @@ | ||
| 13 | handle.setopt(pycurl.OPT_FILETIME, 1) | ||
| 14 | handle.setopt(pycurl.LOW_SPEED_LIMIT, 1) | ||
| 15 | handle.setopt(pycurl.LOW_SPEED_TIME, SOCKETTIMEOUT) | ||
| 16 | - handle.setopt(pycurl.NOPROGRESS, 0) | ||
| 17 | + handle.setopt(pycurl.NOPROGRESS, 1) | ||
| 18 | handle.setopt(pycurl.PROGRESSFUNCTION, progress) | ||
| 19 | handle.setopt(pycurl.WRITEDATA, local) | ||
| 20 | handle.setopt(pycurl.FOLLOWLOCATION, 1) | ||
diff --git a/meta/recipes-devtools/python/python-smartpm/smartpm-rpm5-support-check-signatures.patch b/meta/recipes-devtools/python/python-smartpm/smartpm-rpm5-support-check-signatures.patch deleted file mode 100644 index 4067a90a08..0000000000 --- a/meta/recipes-devtools/python/python-smartpm/smartpm-rpm5-support-check-signatures.patch +++ /dev/null | |||
| @@ -1,112 +0,0 @@ | |||
| 1 | From 5b79e28bd70a0ec5b34c5ff19b66cbbdd1e48835 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Haiqing Bai <Haiqing.Bai@windriver.com> | ||
| 3 | Date: Fri, 18 Mar 2016 13:34:07 +0800 | ||
| 4 | Subject: [PATCH] Make smartpm to support check signatures of rpmv5. | ||
| 5 | |||
| 6 | The original support for 'rpm-check-signatures' has been | ||
| 7 | disabled for the RPMv5 does not support '_RPMVSF_NOSIGNATURES' | ||
| 8 | now. This fix replaces the '_RPMVSF_NOSIGNATURES' with | ||
| 9 | rpm VS flags set:RPMVSF_NODSAHEADER|RPMVSF_NORSAHEADER| | ||
| 10 | RPMVSF_NODSA|RPMVSF_NORSA. | ||
| 11 | |||
| 12 | Upstream-Status: Pending | ||
| 13 | Signed-off-by: Haiqing Bai <Haiqing.Bai@windriver.com> | ||
| 14 | --- | ||
| 15 | smart/backends/rpm/base.py | 43 +++++++++++++++++++++++++++++++---------- | ||
| 16 | smart/backends/rpm/pm.py | 2 +- | ||
| 17 | smart/plugins/yumchannelsync.py | 5 +++-- | ||
| 18 | 3 files changed, 37 insertions(+), 13 deletions(-) | ||
| 19 | |||
| 20 | diff --git a/smart/backends/rpm/base.py b/smart/backends/rpm/base.py | ||
| 21 | index 85f4d49..dbd6165 100644 | ||
| 22 | --- a/smart/backends/rpm/base.py | ||
| 23 | +++ b/smart/backends/rpm/base.py | ||
| 24 | @@ -63,11 +63,23 @@ def getTS(new=False): | ||
| 25 | if sysconf.get("rpm-dbpath"): | ||
| 26 | rpm.addMacro('_dbpath', "/" + sysconf.get("rpm-dbpath")) | ||
| 27 | getTS.ts = rpm.ts(getTS.root) | ||
| 28 | - if not sysconf.get("rpm-check-signatures", False): | ||
| 29 | - if hasattr(rpm, '_RPMVSF_NOSIGNATURES'): | ||
| 30 | - getTS.ts.setVSFlags(rpm._RPMVSF_NOSIGNATURES) | ||
| 31 | - else: | ||
| 32 | - raise Error, _("rpm requires checking signatures") | ||
| 33 | + | ||
| 34 | + # _RPMVSF_NOSIGNATURES is not supported in RPMv5, so here uses | ||
| 35 | + # RPMVSF_NODSAHEADER|RPMVSF_NORSAHEADER|RPMVSF_NODSA|RPMVSF_NORSA | ||
| 36 | + # to replace '_RPMVSF_NOSIGNATURES' to continue to support check | ||
| 37 | + # rpm signatures | ||
| 38 | + | ||
| 39 | + #if not sysconf.get("rpm-check-signatures", False): | ||
| 40 | + # if hasattr(rpm, '_RPMVSF_NOSIGNATURES'): | ||
| 41 | + # getTS.ts.setVSFlags(rpm._RPMVSF_NOSIGNATURES) | ||
| 42 | + # else: | ||
| 43 | + # raise Error, _("rpm requires checking signatures") | ||
| 44 | + if sysconf.get("rpm-check-signatures") == False: | ||
| 45 | + getTS.ts.setVSFlags(rpm.RPMVSF_NODSAHEADER|rpm.RPMVSF_NORSAHEADER|\ | ||
| 46 | + rpm.RPMVSF_NODSA|rpm.RPMVSF_NORSA) | ||
| 47 | + else: | ||
| 48 | + getTS.ts.setVSFlags(0) | ||
| 49 | + | ||
| 50 | rpm_dbpath = sysconf.get("rpm-dbpath", "var/lib/rpm") | ||
| 51 | dbdir = rpm_join_dbpath(getTS.root, rpm_dbpath) | ||
| 52 | if not os.path.isdir(dbdir): | ||
| 53 | @@ -89,11 +101,22 @@ def getTS(new=False): | ||
| 54 | if sysconf.get("rpm-dbpath"): | ||
| 55 | rpm.addMacro('_dbpath', "/" + sysconf.get("rpm-dbpath")) | ||
| 56 | ts = rpm.ts(getTS.root) | ||
| 57 | - if not sysconf.get("rpm-check-signatures", False): | ||
| 58 | - if hasattr(rpm, '_RPMVSF_NOSIGNATURES'): | ||
| 59 | - ts.setVSFlags(rpm._RPMVSF_NOSIGNATURES) | ||
| 60 | - else: | ||
| 61 | - raise Error, _("rpm requires checking signatures") | ||
| 62 | + | ||
| 63 | + # _RPMVSF_NOSIGNATURES is not supported in RPMv5, so here uses | ||
| 64 | + # RPMVSF_NODSAHEADER|RPMVSF_NORSAHEADER|RPMVSF_NODSA|RPMVSF_NORSA | ||
| 65 | + # to replace '_RPMVSF_NOSIGNATURES' to continue to support check | ||
| 66 | + # rpm signatures | ||
| 67 | + | ||
| 68 | + #if not sysconf.get("rpm-check-signatures", False): | ||
| 69 | + # if hasattr(rpm, '_RPMVSF_NOSIGNATURES'): | ||
| 70 | + # ts.setVSFlags(rpm._RPMVSF_NOSIGNATURES) | ||
| 71 | + # else: | ||
| 72 | + # raise Error, _("rpm requires checking signatures") | ||
| 73 | + if sysconf.get("rpm-check-signatures") == False: | ||
| 74 | + ts.setVSFlags(rpm.RPMVSF_NODSAHEADER|rpm.RPMVSF_NORSAHEADER|\ | ||
| 75 | + rpm.RPMVSF_NODSA|rpm.RPMVSF_NORSA) | ||
| 76 | + else: | ||
| 77 | + ts.setVSFlags(0) | ||
| 78 | return ts | ||
| 79 | else: | ||
| 80 | return getTS.ts | ||
| 81 | diff --git a/smart/backends/rpm/pm.py b/smart/backends/rpm/pm.py | ||
| 82 | index b57a844..7b651b5 100644 | ||
| 83 | --- a/smart/backends/rpm/pm.py | ||
| 84 | +++ b/smart/backends/rpm/pm.py | ||
| 85 | @@ -180,7 +180,7 @@ class RPMPackageManager(PackageManager): | ||
| 86 | fd = os.open(path, os.O_RDONLY) | ||
| 87 | try: | ||
| 88 | h = ts.hdrFromFdno(fd) | ||
| 89 | - if sysconf.get("rpm-check-signatures", False): | ||
| 90 | + if sysconf.get("rpm-check-signatures", True): | ||
| 91 | if get_public_key(h) == '(none)': | ||
| 92 | raise rpm.error('package is not signed') | ||
| 93 | except rpm.error, e: | ||
| 94 | diff --git a/smart/plugins/yumchannelsync.py b/smart/plugins/yumchannelsync.py | ||
| 95 | index f8107e6..2dc5482 100644 | ||
| 96 | --- a/smart/plugins/yumchannelsync.py | ||
| 97 | +++ b/smart/plugins/yumchannelsync.py | ||
| 98 | @@ -56,8 +56,9 @@ def _getreleasever(): | ||
| 99 | |||
| 100 | rpmroot = sysconf.get("rpm-root", "/") | ||
| 101 | ts = rpmUtils.transaction.initReadOnlyTransaction(root=rpmroot) | ||
| 102 | - if hasattr(rpm, '_RPMVSF_NOSIGNATURES') and hasattr(rpm, '_RPMVSF_NODIGESTS'): | ||
| 103 | - ts.pushVSFlags(~(rpm._RPMVSF_NOSIGNATURES|rpm._RPMVSF_NODIGESTS)) | ||
| 104 | + #_RPMVSF_NOSIGNATURES is not supported in RPMv5 | ||
| 105 | + #if hasattr(rpm, '_RPMVSF_NOSIGNATURES') and hasattr(rpm, '_RPMVSF_NODIGESTS'): | ||
| 106 | + # ts.pushVSFlags(~(rpm._RPMVSF_NOSIGNATURES|rpm._RPMVSF_NODIGESTS)) | ||
| 107 | releasever = None | ||
| 108 | # HACK: we're hard-coding the most used distros, will add more if needed | ||
| 109 | idx = ts.dbMatch('provides', 'fedora-release') | ||
| 110 | -- | ||
| 111 | 1.9.1 | ||
| 112 | |||
diff --git a/meta/recipes-devtools/python/python-smartpm_git.bb b/meta/recipes-devtools/python/python-smartpm_git.bb deleted file mode 100644 index 31c273deaf..0000000000 --- a/meta/recipes-devtools/python/python-smartpm_git.bb +++ /dev/null | |||
| @@ -1,141 +0,0 @@ | |||
| 1 | SUMMARY = "The Smart Package Manager" | ||
| 2 | DESCRIPTION = "The Smart Package Manager project has the ambitious objective of creating \ | ||
| 3 | smart and portable algorithms for solving adequately the problem of managing software \ | ||
| 4 | upgrades and installation." | ||
| 5 | |||
| 6 | HOMEPAGE = "http://labix.org/smart/" | ||
| 7 | SECTION = "devel/python" | ||
| 8 | LICENSE = "GPLv2" | ||
| 9 | LIC_FILES_CHKSUM = "file://LICENSE;md5=393a5ca445f6965873eca0259a17f833" | ||
| 10 | |||
| 11 | DEPENDS = "python rpm gettext-native python-rpm" | ||
| 12 | SRCNAME = "smart" | ||
| 13 | |||
| 14 | SRC_URI = "\ | ||
| 15 | git://github.com/smartpm/smart.git \ | ||
| 16 | file://smart-recommends.patch \ | ||
| 17 | file://smart-channelsdir.patch \ | ||
| 18 | file://smart-rpm-transaction-failure-check.patch \ | ||
| 19 | file://smart-attempt.patch \ | ||
| 20 | file://smart-attempt-fix.patch \ | ||
| 21 | file://smart-add-for-rpm-ignoresize-check.patch \ | ||
| 22 | file://smart-already-installed-message.patch \ | ||
| 23 | file://smart-set-noprogress-for-pycurl.patch \ | ||
| 24 | file://smart-cache.py-getPackages-matches-name-version.patch \ | ||
| 25 | file://smart-channel-remove-all.patch \ | ||
| 26 | file://smart-locale.patch \ | ||
| 27 | file://smartpm-rpm5-support-check-signatures.patch \ | ||
| 28 | file://smart-add-deugging-when-targetpath-is-empty.patch \ | ||
| 29 | file://channels-rpm_sys-use-md5sum-instead-of-mtime-as-the-.patch \ | ||
| 30 | " | ||
| 31 | |||
| 32 | SRCREV = "407a7eca766431257dcd1da15175cc36a1bb22d0" | ||
| 33 | PV = "1.5+git${SRCPV}" | ||
| 34 | |||
| 35 | S = "${WORKDIR}/git" | ||
| 36 | |||
| 37 | # Options - rpm, qt4, gtk | ||
| 38 | PACKAGECONFIG ??= "rpm" | ||
| 39 | |||
| 40 | RPM_RDEP = "${PN}-backend-rpm" | ||
| 41 | QT_RDEP = "${PN}-interface-qt4" | ||
| 42 | GTK_RDEP = "${PN}-interface-gtk" | ||
| 43 | |||
| 44 | RPM_RDEP_class-native = "" | ||
| 45 | QT_RDEP_class-native = "" | ||
| 46 | GTK_RDEP_class-native = "" | ||
| 47 | |||
| 48 | RPM_RDEP_class-nativesdk = "" | ||
| 49 | QT_RDEP_class-nativesdk = "" | ||
| 50 | GTK_RDEP_class-nativesdk = "" | ||
| 51 | |||
| 52 | PACKAGECONFIG[rpm] = ",,rpm,${RPM_RDEP}" | ||
| 53 | PACKAGECONFIG[qt4] = ",,qt4-x11,${QT_RDEP}" | ||
| 54 | PACKAGECONFIG[gtk] = ",,gtk+,${GTK_RDEP}" | ||
| 55 | |||
| 56 | inherit distutils | ||
| 57 | |||
| 58 | do_install_append() { | ||
| 59 | # We don't support the following items | ||
| 60 | rm -rf ${D}${PYTHON_SITEPACKAGES_DIR}/smart/backends/slack | ||
| 61 | rm -rf ${D}${PYTHON_SITEPACKAGES_DIR}/smart/backends/arch | ||
| 62 | rm -rf ${D}${PYTHON_SITEPACKAGES_DIR}/smart/interfaces/qt | ||
| 63 | |||
| 64 | # Temporary, debian support in OE is missing the python module | ||
| 65 | rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/smart/plugins/aptchannelsync.py* | ||
| 66 | rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/smart/plugins/debdir.py* | ||
| 67 | rm -rf ${D}${PYTHON_SITEPACKAGES_DIR}/smart/backends/deb | ||
| 68 | |||
| 69 | # Disable automatic channel detection | ||
| 70 | rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/smart/plugins/detectsys.py* | ||
| 71 | |||
| 72 | # Disable landscape support | ||
| 73 | rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/smart/plugins/landscape.py* | ||
| 74 | |||
| 75 | # Disable urpmi channel support | ||
| 76 | rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/smart/plugins/urpmichannelsync.py* | ||
| 77 | |||
| 78 | # Disable yum channel support | ||
| 79 | rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/smart/plugins/yumchannelsync.py* | ||
| 80 | |||
| 81 | # Disable zypper channel support | ||
| 82 | rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/smart/plugins/zyppchannelsync.py* | ||
| 83 | |||
| 84 | if [ -z "${@bb.utils.filter('PACKAGECONFIG', 'rpm', d)}" ]; then | ||
| 85 | rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/smart/plugins/rpmdir.py* | ||
| 86 | rm -rf ${D}${PYTHON_SITEPACKAGES_DIR}/smart/backends/rpm | ||
| 87 | fi | ||
| 88 | |||
| 89 | if [ -z "${@bb.utils.filter('PACKAGECONFIG', 'qt4', d)}" ]; then | ||
| 90 | rm -rf ${D}${PYTHON_SITEPACKAGES_DIR}/smart/interfaces/qt4 | ||
| 91 | fi | ||
| 92 | |||
| 93 | if [ -z "${@bb.utils.contains('PACKAGECONFIG', 'gtk+', 'gtk', '', d)}" ]; then | ||
| 94 | rm -rf ${D}${PYTHON_SITEPACKAGES_DIR}/smart/interfaces/gtk | ||
| 95 | fi | ||
| 96 | } | ||
| 97 | |||
| 98 | add_native_wrapper() { | ||
| 99 | create_wrapper ${D}/${bindir}/smart \ | ||
| 100 | RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir'), d.getVar('bindir'))}/rpm \ | ||
| 101 | RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir'), d.getVar('bindir'))}/rpm} \ | ||
| 102 | RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir'), d.getVar('bindir'))}/locale | ||
| 103 | } | ||
| 104 | |||
| 105 | do_install_append_class-native() { | ||
| 106 | sed -i -e 's|^#!.*/usr/bin/env python|#! /usr/bin/env nativepython|' ${D}${bindir}/smart | ||
| 107 | add_native_wrapper | ||
| 108 | } | ||
| 109 | |||
| 110 | do_install_append_class-nativesdk() { | ||
| 111 | add_native_wrapper | ||
| 112 | } | ||
| 113 | |||
| 114 | PACKAGES = "${PN}-dev ${PN}-dbg ${PN}-doc smartpm \ | ||
| 115 | ${@bb.utils.contains('PACKAGECONFIG', 'rpm', '${PN}-backend-rpm', '', d)} \ | ||
| 116 | ${@bb.utils.contains('PACKAGECONFIG', 'qt4', '${PN}-interface-qt4', '', d)} \ | ||
| 117 | ${@bb.utils.contains('PACKAGECONFIG', 'gtk', '${PN}-interface-gtk', '', d)} \ | ||
| 118 | ${PN}-interface-images ${PN}" | ||
| 119 | |||
| 120 | RDEPENDS_smartpm = "${PN}" | ||
| 121 | |||
| 122 | RDEPENDS_${PN} += "${PN}-backend-rpm python-codecs python-textutils python-xml python-fcntl \ | ||
| 123 | python-pickle python-crypt python-compression python-shell \ | ||
| 124 | python-resource python-netclient python-threading python-unixadmin python-pprint" | ||
| 125 | RDEPENDS_${PN}_class-native = "" | ||
| 126 | |||
| 127 | RDEPENDS_${PN}-backend-rpm = "python-rpm" | ||
| 128 | |||
| 129 | RDEPENDS_${PN}-interface-qt4 = "qt4-x11 ${PN}-interface-images" | ||
| 130 | RDEPENDS_${PN}-interface-gtk = "gtk+ ${PN}-interface-images" | ||
| 131 | |||
| 132 | FILES_smartpm = "${bindir}/smart" | ||
| 133 | |||
| 134 | FILES_${PN}-backend-rpm = "${PYTHON_SITEPACKAGES_DIR}/smart/backends/rpm" | ||
| 135 | |||
| 136 | FILES_${PN}-interface-qt4 = "${PYTHON_SITEPACKAGES_DIR}/smart/interfaces/qt4" | ||
| 137 | FILES_${PN}-interface-gtk = "${PYTHON_SITEPACKAGES_DIR}/smart/interfaces/gtk" | ||
| 138 | FILES_${PN}-interface-images = "${datadir}/${baselib}/python*/site-packages/smart/interfaces/images" | ||
| 139 | |||
| 140 | BBCLASSEXTEND = "native nativesdk" | ||
| 141 | |||
