summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2012-11-26 15:02:15 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-12-06 12:31:05 +0000
commit5443525de8c209c27eab0457c9a5a7ca11ec9865 (patch)
tree88dfc6f956e7c8c484212b6c28ce528f24718113
parenta8cee41b3dcdecb45adbfebe96918f7d984b39ca (diff)
downloadpoky-5443525de8c209c27eab0457c9a5a7ca11ec9865.tar.gz
createrepo: implement support for recommends
Adds a flag into the output metadata to note recommends relationships in a way that should not break compatibility with clients that don't understand this flag. (From OE-Core rev: e7df818182e9e68b2e0fdede20a41d492b776a5b) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-support/createrepo/createrepo/recommends.patch71
-rw-r--r--meta/recipes-support/createrepo/createrepo_0.4.11.bb3
2 files changed, 73 insertions, 1 deletions
diff --git a/meta/recipes-support/createrepo/createrepo/recommends.patch b/meta/recipes-support/createrepo/createrepo/recommends.patch
new file mode 100644
index 0000000000..dc5de2b5b0
--- /dev/null
+++ b/meta/recipes-support/createrepo/createrepo/recommends.patch
@@ -0,0 +1,71 @@
1createrepo: implement recommends support
2
3Record against the corresponding requires entry in the output metadata
4if a dependency relationship is marked with the RPMSENSE_MISSINGOK flag
5(indicating it is a recommendation, rather than a hard dependency).
6
7Upstream-Status: Pending
8
9Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
10
11diff --git a/dumpMetadata.py b/dumpMetadata.py
12index 70bb2d8..e40e8ac 100644
13--- a/dumpMetadata.py
14+++ b/dumpMetadata.py
15@@ -319,6 +319,23 @@ class RpmMetaData:
16 reqs.append(0)
17 return reqs
18
19+ def _checkMissingOk(self, flags):
20+ reqs=[]
21+ if flags is None:
22+ return reqs
23+
24+ if type(flags) is not types.ListType:
25+ flags = [flags]
26+ for flag in flags:
27+ newflag = flag
28+ if flag is not None:
29+ newflag = flag & rpm.RPMSENSE_MISSINGOK
30+ if newflag:
31+ reqs.append(1)
32+ else:
33+ reqs.append(0)
34+ return reqs
35+
36
37 def _correctVersion(self, vers):
38 returnvers = []
39@@ -537,9 +554,10 @@ class RpmMetaData:
40 tmpflags = self.hdr[rpm.RPMTAG_REQUIREFLAGS]
41 flags = self._correctFlags(tmpflags)
42 prereq = self._checkPreReq(tmpflags)
43+ missingok = self._checkMissingOk(tmpflags)
44 ver = self._correctVersion(self.hdr[rpm.RPMTAG_REQUIREVERSION])
45 if names is not None:
46- lst = zip(names, flags, ver, prereq)
47+ lst = zip(names, flags, ver, prereq, missingok)
48 return self._uniq(lst)
49
50 def obsoletesList(self):
51@@ -692,7 +710,7 @@ def generateXML(doc, node, formatns, rpmObj, sumtype):
52 depsList = rpmObj.depsList()
53 if len(depsList) > 0:
54 rpconode = format.newChild(formatns, 'requires', None)
55- for (name, flags, (e,v,r), prereq) in depsList:
56+ for (name, flags, (e,v,r), prereq, missingok) in depsList:
57 entry = rpconode.newChild(formatns, 'entry', None)
58 entry.newProp('name', name)
59 if flags != 0:
60@@ -711,6 +729,8 @@ def generateXML(doc, node, formatns, rpmObj, sumtype):
61 entry.newProp('rel', str(r))
62 if prereq == 1:
63 entry.newProp('pre', str(prereq))
64+ if missingok:
65+ entry.newProp('missingok', '1')
66
67 for file in rpmObj.usefulFiles():
68 files = format.newChild(None, 'file', None)
69--
701.7.9.5
71
diff --git a/meta/recipes-support/createrepo/createrepo_0.4.11.bb b/meta/recipes-support/createrepo/createrepo_0.4.11.bb
index 8d2dcdf958..227ebcb491 100644
--- a/meta/recipes-support/createrepo/createrepo_0.4.11.bb
+++ b/meta/recipes-support/createrepo/createrepo_0.4.11.bb
@@ -6,12 +6,13 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=18810669f13b87348459e611d31ab760"
6 6
7RDEPENDS_${PN}_class-native += "libxml2-native rpm-native" 7RDEPENDS_${PN}_class-native += "libxml2-native rpm-native"
8 8
9PR = "r7" 9PR = "r8"
10 10
11SRC_URI= "http://createrepo.baseurl.org/download/${BP}.tar.gz \ 11SRC_URI= "http://createrepo.baseurl.org/download/${BP}.tar.gz \
12 file://fix-native-install.patch \ 12 file://fix-native-install.patch \
13 file://python-scripts-should-use-interpreter-from-env.patch \ 13 file://python-scripts-should-use-interpreter-from-env.patch \
14 file://createrepo-rpm549.patch \ 14 file://createrepo-rpm549.patch \
15 file://recommends.patch \
15 file://rpm-createsolvedb.py \ 16 file://rpm-createsolvedb.py \
16 " 17 "
17 18