summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/python/python-smartpm
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/python/python-smartpm')
-rw-r--r--meta/recipes-devtools/python/python-smartpm/smart-rpm-root.patch80
-rw-r--r--meta/recipes-devtools/python/python-smartpm/smartpm-rpm5-nodig.patch46
2 files changed, 126 insertions, 0 deletions
diff --git a/meta/recipes-devtools/python/python-smartpm/smart-rpm-root.patch b/meta/recipes-devtools/python/python-smartpm/smart-rpm-root.patch
new file mode 100644
index 0000000000..b2629ef051
--- /dev/null
+++ b/meta/recipes-devtools/python/python-smartpm/smart-rpm-root.patch
@@ -0,0 +1,80 @@
1Fix smart RPM backend to handle rpm-dbpath/rpm-root properly
2
3Don't assume that if the dbpath starts with / that it is an absolute
4path. This matches the behaviour of rpm itself. (If the root path is
5specified and does not start with /, rpm will prepend the root path
6twice and fail).
7
8Upstream-Status: Pending
9
10Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
11
12diff --git a/smart/backends/rpm/base.py b/smart/backends/rpm/base.py
13index 7092332..0489e11 100644
14--- a/smart/backends/rpm/base.py
15+++ b/smart/backends/rpm/base.py
16@@ -46,6 +46,12 @@ __all__ = ["RPMPackage", "RPMProvides", "RPMNameProvides", "RPMPreRequires",
17 "rpm", "getTS", "getArchScore", "getArchColor", "system_provides",
18 "collapse_libc_requires"]
19
20+def rpm_join_dbpath(root, dbpath):
21+ if dbpath.startswith('/') and root:
22+ return os.path.join(root, dbpath[1:])
23+ else:
24+ return os.path.join(root, dbpath)
25+
26 def getTS(new=False):
27 rpm_root = os.path.abspath(sysconf.get("rpm-root", "/"))
28 if not hasattr(getTS, "ts") or getTS.root != rpm_root:
29@@ -56,7 +62,7 @@ def getTS(new=False):
30 #if not sysconf.get("rpm-check-signatures", False):
31 # getTS.ts.setVSFlags(rpm._RPMVSF_NOSIGNATURES)
32 rpm_dbpath = sysconf.get("rpm-dbpath", "var/lib/rpm")
33- dbdir = os.path.join(getTS.root, rpm_dbpath)
34+ dbdir = rpm_join_dbpath(getTS.root, rpm_dbpath)
35 if not os.path.isdir(dbdir):
36 try:
37 os.makedirs(dbdir)
38diff --git a/smart/channels/rpm_sys.py b/smart/channels/rpm_sys.py
39index efcb10e..b9fda27 100644
40--- a/smart/channels/rpm_sys.py
41+++ b/smart/channels/rpm_sys.py
42@@ -20,7 +20,7 @@
43 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
44 #
45 from smart.backends.rpm.header import RPMDBLoader
46-from smart.backends.rpm.base import getTS
47+from smart.backends.rpm.base import getTS, rpm_join_dbpath
48 from smart.channel import PackageChannel
49 from smart import *
50 import os
51@@ -32,9 +32,9 @@ class RPMSysChannel(PackageChannel):
52
53 def fetch(self, fetcher, progress):
54 getTS() # Make sure the db exists.
55- path = os.path.join(sysconf.get("rpm-root", "/"),
56- sysconf.get("rpm-dbpath", "var/lib/rpm"),
57- "Packages")
58+ dbdir = rpm_join_dbpath(sysconf.get("rpm-root", "/"),
59+ sysconf.get("rpm-dbpath", "var/lib/rpm"))
60+ path = os.path.join(dbdir, "Packages")
61 digest = os.path.getmtime(path)
62 if digest == self._digest:
63 return True
64diff --git a/smart/plugins/detectsys.py b/smart/plugins/detectsys.py
65index 2cd49ad..3959d07 100644
66--- a/smart/plugins/detectsys.py
67+++ b/smart/plugins/detectsys.py
68@@ -20,10 +20,11 @@
69 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
70 #
71 from smart import *
72+from smart.backends.rpm.base import rpm_join_dbpath
73 import os
74
75 def detectRPMSystem():
76- dir = os.path.join(sysconf.get("rpm-root", "/"),
77+ dir = rpm_join_dbpath(sysconf.get("rpm-root", "/"),
78 sysconf.get("rpm-dbpath", "var/lib/rpm"))
79 file = os.path.join(dir, "Packages")
80 if os.path.exists(file):
diff --git a/meta/recipes-devtools/python/python-smartpm/smartpm-rpm5-nodig.patch b/meta/recipes-devtools/python/python-smartpm/smartpm-rpm5-nodig.patch
new file mode 100644
index 0000000000..9919a941bc
--- /dev/null
+++ b/meta/recipes-devtools/python/python-smartpm/smartpm-rpm5-nodig.patch
@@ -0,0 +1,46 @@
1RPM5 has removed support for RPMVSF_NOSIGNATURES
2
3Patch smart to no longer use this flag
4
5Upstream-Status: Pending
6
7Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
8
9diff -ur smart-1.4.1.orig/smart/backends/rpm/base.py smart-1.4.1/smart/backends/rpm/base.py
10--- smart-1.4.1.orig/smart/backends/rpm/base.py 2012-10-04 11:22:11.229351164 -0500
11+++ smart-1.4.1/smart/backends/rpm/base.py 2012-10-04 11:22:44.820170786 -0500
12@@ -53,8 +53,8 @@
13 if sysconf.get("rpm-dbpath"):
14 rpm.addMacro('_dbpath', "/" + sysconf.get("rpm-dbpath"))
15 getTS.ts = rpm.ts(getTS.root)
16- if not sysconf.get("rpm-check-signatures", False):
17- getTS.ts.setVSFlags(rpm._RPMVSF_NOSIGNATURES)
18+ #if not sysconf.get("rpm-check-signatures", False):
19+ # getTS.ts.setVSFlags(rpm._RPMVSF_NOSIGNATURES)
20 rpm_dbpath = sysconf.get("rpm-dbpath", "var/lib/rpm")
21 dbdir = os.path.join(getTS.root, rpm_dbpath)
22 if not os.path.isdir(dbdir):
23@@ -82,8 +82,8 @@
24 if sysconf.get("rpm-dbpath"):
25 rpm.addMacro('_dbpath', "/" + sysconf.get("rpm-dbpath"))
26 ts = rpm.ts(getTS.root)
27- if not sysconf.get("rpm-check-signatures", False):
28- ts.setVSFlags(rpm._RPMVSF_NOSIGNATURES)
29+ #if not sysconf.get("rpm-check-signatures", False):
30+ # ts.setVSFlags(rpm._RPMVSF_NOSIGNATURES)
31 return ts
32 else:
33 return getTS.ts
34diff -ur smart-1.4.1.orig/smart/plugins/yumchannelsync.py smart-1.4.1/smart/plugins/yumchannelsync.py
35--- smart-1.4.1.orig/smart/plugins/yumchannelsync.py 2010-12-06 03:11:05.000000000 -0600
36+++ smart-1.4.1/smart/plugins/yumchannelsync.py 2012-10-04 11:23:09.799350924 -0500
37@@ -56,7 +56,8 @@
38
39 rpmroot = sysconf.get("rpm-root", "/")
40 ts = rpmUtils.transaction.initReadOnlyTransaction(root=rpmroot)
41- ts.pushVSFlags(~(rpm._RPMVSF_NOSIGNATURES|rpm._RPMVSF_NODIGESTS))
42+ #ts.pushVSFlags(~(rpm._RPMVSF_NOSIGNATURES|rpm._RPMVSF_NODIGESTS))
43+ ts.pushVSFlags(~(rpm._RPMVSF_NODIGESTS))
44 releasever = None
45 # HACK: we're hard-coding the most used distros, will add more if needed
46 idx = ts.dbMatch('provides', 'fedora-release')