diff options
Diffstat (limited to 'meta')
-rw-r--r-- | meta/lib/oe/package_manager.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py index c9a8084bf2..743c7cb496 100644 --- a/meta/lib/oe/package_manager.py +++ b/meta/lib/oe/package_manager.py | |||
@@ -169,7 +169,35 @@ class OpkgIndexer(Indexer): | |||
169 | 169 | ||
170 | 170 | ||
171 | class DpkgIndexer(Indexer): | 171 | class DpkgIndexer(Indexer): |
172 | def _create_configs(self): | ||
173 | bb.utils.mkdirhier(self.apt_conf_dir) | ||
174 | bb.utils.mkdirhier(os.path.join(self.apt_conf_dir, "lists", "partial")) | ||
175 | bb.utils.mkdirhier(os.path.join(self.apt_conf_dir, "apt.conf.d")) | ||
176 | bb.utils.mkdirhier(os.path.join(self.apt_conf_dir, "preferences.d")) | ||
177 | |||
178 | with open(os.path.join(self.apt_conf_dir, "preferences"), | ||
179 | "w") as prefs_file: | ||
180 | pass | ||
181 | with open(os.path.join(self.apt_conf_dir, "sources.list"), | ||
182 | "w+") as sources_file: | ||
183 | pass | ||
184 | |||
185 | with open(self.apt_conf_file, "w") as apt_conf: | ||
186 | with open(os.path.join(self.d.expand("${STAGING_ETCDIR_NATIVE}"), | ||
187 | "apt", "apt.conf.sample")) as apt_conf_sample: | ||
188 | for line in apt_conf_sample.read().split("\n"): | ||
189 | line = re.sub("#ROOTFS#", "/dev/null", line) | ||
190 | line = re.sub("#APTCONF#", self.apt_conf_dir, line) | ||
191 | apt_conf.write(line + "\n") | ||
192 | |||
172 | def write_index(self): | 193 | def write_index(self): |
194 | self.apt_conf_dir = os.path.join(self.d.expand("${APTCONF_TARGET}"), | ||
195 | "apt-ftparchive") | ||
196 | self.apt_conf_file = os.path.join(self.apt_conf_dir, "apt.conf") | ||
197 | self._create_configs() | ||
198 | |||
199 | os.environ['APT_CONFIG'] = self.apt_conf_file | ||
200 | |||
173 | pkg_archs = self.d.getVar('PACKAGE_ARCHS', True) | 201 | pkg_archs = self.d.getVar('PACKAGE_ARCHS', True) |
174 | if pkg_archs is not None: | 202 | if pkg_archs is not None: |
175 | arch_list = pkg_archs.split() | 203 | arch_list = pkg_archs.split() |