summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
Diffstat (limited to 'meta')
-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 }