diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2012-11-26 15:02:15 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-12-06 12:30:32 +0000 |
commit | e7df818182e9e68b2e0fdede20a41d492b776a5b (patch) | |
tree | bfbad9cc3bb1dd30142ae5c6ff9ee5c7e1993fca /meta/recipes-support/createrepo | |
parent | ee65b00b4ce3f4c27c2a19f079576345d39efb22 (diff) | |
download | openembedded-core-e7df818182e9e68b2e0fdede20a41d492b776a5b.tar.gz openembedded-core-e7df818182e9e68b2e0fdede20a41d492b776a5b.tar.bz2 openembedded-core-e7df818182e9e68b2e0fdede20a41d492b776a5b.zip |
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.
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Diffstat (limited to 'meta/recipes-support/createrepo')
-rw-r--r-- | meta/recipes-support/createrepo/createrepo/recommends.patch | 71 | ||||
-rw-r--r-- | meta/recipes-support/createrepo/createrepo_0.4.11.bb | 3 |
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 @@ +createrepo: implement recommends support + +Record against the corresponding requires entry in the output metadata +if a dependency relationship is marked with the RPMSENSE_MISSINGOK flag +(indicating it is a recommendation, rather than a hard dependency). + +Upstream-Status: Pending + +Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> + +diff --git a/dumpMetadata.py b/dumpMetadata.py +index 70bb2d8..e40e8ac 100644 +--- a/dumpMetadata.py ++++ b/dumpMetadata.py +@@ -319,6 +319,23 @@ class RpmMetaData: + reqs.append(0) + return reqs + ++ def _checkMissingOk(self, flags): ++ reqs=[] ++ if flags is None: ++ return reqs ++ ++ if type(flags) is not types.ListType: ++ flags = [flags] ++ for flag in flags: ++ newflag = flag ++ if flag is not None: ++ newflag = flag & rpm.RPMSENSE_MISSINGOK ++ if newflag: ++ reqs.append(1) ++ else: ++ reqs.append(0) ++ return reqs ++ + + def _correctVersion(self, vers): + returnvers = [] +@@ -537,9 +554,10 @@ class RpmMetaData: + tmpflags = self.hdr[rpm.RPMTAG_REQUIREFLAGS] + flags = self._correctFlags(tmpflags) + prereq = self._checkPreReq(tmpflags) ++ missingok = self._checkMissingOk(tmpflags) + ver = self._correctVersion(self.hdr[rpm.RPMTAG_REQUIREVERSION]) + if names is not None: +- lst = zip(names, flags, ver, prereq) ++ lst = zip(names, flags, ver, prereq, missingok) + return self._uniq(lst) + + def obsoletesList(self): +@@ -692,7 +710,7 @@ def generateXML(doc, node, formatns, rpmObj, sumtype): + depsList = rpmObj.depsList() + if len(depsList) > 0: + rpconode = format.newChild(formatns, 'requires', None) +- for (name, flags, (e,v,r), prereq) in depsList: ++ for (name, flags, (e,v,r), prereq, missingok) in depsList: + entry = rpconode.newChild(formatns, 'entry', None) + entry.newProp('name', name) + if flags != 0: +@@ -711,6 +729,8 @@ def generateXML(doc, node, formatns, rpmObj, sumtype): + entry.newProp('rel', str(r)) + if prereq == 1: + entry.newProp('pre', str(prereq)) ++ if missingok: ++ entry.newProp('missingok', '1') + + for file in rpmObj.usefulFiles(): + files = format.newChild(None, 'file', None) +-- +1.7.9.5 + 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" RDEPENDS_${PN}_class-native += "libxml2-native rpm-native" -PR = "r7" +PR = "r8" SRC_URI= "http://createrepo.baseurl.org/download/${BP}.tar.gz \ file://fix-native-install.patch \ file://python-scripts-should-use-interpreter-from-env.patch \ file://createrepo-rpm549.patch \ + file://recommends.patch \ file://rpm-createsolvedb.py \ " |