summaryrefslogtreecommitdiffstats
path: root/meta/lib
diff options
context:
space:
mode:
authorAlexander Kanavin <alexander.kanavin@linux.intel.com>2018-03-19 11:38:27 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-03-20 09:59:32 +0000
commitdad8f073e3ba101bf4651c25ddbcb1aaedbabdbb (patch)
tree3ea5e15f5b5f06e5bc46b1797c8d9843fd47f886 /meta/lib
parentc256b715e68e21ffc42875d229fb69403db4b4f3 (diff)
downloadpoky-dad8f073e3ba101bf4651c25ddbcb1aaedbabdbb.tar.gz
package-index: index also subdirectories when using rpm
Previously only the top-level index was created, which did not work if PACKAGE_FEED_ARCHS whitelisting (or explicitly listing architectures in dnf repo files by hand) was in use: https://lists.yoctoproject.org/pipermail/yocto/2018-March/040327.html https://bugzilla.yoctoproject.org/show_bug.cgi?id=12419 [YOCTO #12419] (From OE-Core rev: f2a568ddb22f38114fdbc1d389c7556386ebb1fa) Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r--meta/lib/oe/package_manager.py20
1 files changed, 17 insertions, 3 deletions
diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py
index b80ea5e75c..e006dc6215 100644
--- a/meta/lib/oe/package_manager.py
+++ b/meta/lib/oe/package_manager.py
@@ -101,13 +101,16 @@ class Indexer(object, metaclass=ABCMeta):
101 101
102class RpmIndexer(Indexer): 102class RpmIndexer(Indexer):
103 def write_index(self): 103 def write_index(self):
104 self.do_write_index(self.deploy_dir)
105
106 def do_write_index(self, deploy_dir):
104 if self.d.getVar('PACKAGE_FEED_SIGN') == '1': 107 if self.d.getVar('PACKAGE_FEED_SIGN') == '1':
105 signer = get_signer(self.d, self.d.getVar('PACKAGE_FEED_GPG_BACKEND')) 108 signer = get_signer(self.d, self.d.getVar('PACKAGE_FEED_GPG_BACKEND'))
106 else: 109 else:
107 signer = None 110 signer = None
108 111
109 createrepo_c = bb.utils.which(os.environ['PATH'], "createrepo_c") 112 createrepo_c = bb.utils.which(os.environ['PATH'], "createrepo_c")
110 result = create_index("%s --update -q %s" % (createrepo_c, self.deploy_dir)) 113 result = create_index("%s --update -q %s" % (createrepo_c, deploy_dir))
111 if result: 114 if result:
112 bb.fatal(result) 115 bb.fatal(result)
113 116
@@ -115,11 +118,22 @@ class RpmIndexer(Indexer):
115 if signer: 118 if signer:
116 sig_type = self.d.getVar('PACKAGE_FEED_GPG_SIGNATURE_TYPE') 119 sig_type = self.d.getVar('PACKAGE_FEED_GPG_SIGNATURE_TYPE')
117 is_ascii_sig = (sig_type.upper() != "BIN") 120 is_ascii_sig = (sig_type.upper() != "BIN")
118 signer.detach_sign(os.path.join(self.deploy_dir, 'repodata', 'repomd.xml'), 121 signer.detach_sign(os.path.join(deploy_dir, 'repodata', 'repomd.xml'),
119 self.d.getVar('PACKAGE_FEED_GPG_NAME'), 122 self.d.getVar('PACKAGE_FEED_GPG_NAME'),
120 self.d.getVar('PACKAGE_FEED_GPG_PASSPHRASE_FILE'), 123 self.d.getVar('PACKAGE_FEED_GPG_PASSPHRASE_FILE'),
121 armor=is_ascii_sig) 124 armor=is_ascii_sig)
122 125
126class RpmSubdirIndexer(RpmIndexer):
127 def write_index(self):
128 bb.note("Generating package index for %s" %(self.deploy_dir))
129 self.do_write_index(self.deploy_dir)
130 for entry in os.walk(self.deploy_dir):
131 if os.path.samefile(self.deploy_dir, entry[0]):
132 for dir in entry[1]:
133 if dir != 'repodata':
134 dir_path = oe.path.join(self.deploy_dir, dir)
135 bb.note("Generating package index for %s" %(dir_path))
136 self.do_write_index(dir_path)
123 137
124class OpkgIndexer(Indexer): 138class OpkgIndexer(Indexer):
125 def write_index(self): 139 def write_index(self):
@@ -1686,7 +1700,7 @@ def generate_index_files(d):
1686 classes = d.getVar('PACKAGE_CLASSES').replace("package_", "").split() 1700 classes = d.getVar('PACKAGE_CLASSES').replace("package_", "").split()
1687 1701
1688 indexer_map = { 1702 indexer_map = {
1689 "rpm": (RpmIndexer, d.getVar('DEPLOY_DIR_RPM')), 1703 "rpm": (RpmSubdirIndexer, d.getVar('DEPLOY_DIR_RPM')),
1690 "ipk": (OpkgIndexer, d.getVar('DEPLOY_DIR_IPK')), 1704 "ipk": (OpkgIndexer, d.getVar('DEPLOY_DIR_IPK')),
1691 "deb": (DpkgIndexer, d.getVar('DEPLOY_DIR_DEB')) 1705 "deb": (DpkgIndexer, d.getVar('DEPLOY_DIR_DEB'))
1692 } 1706 }