diff options
author | Andreas Oberritter <obi@opendreambox.org> | 2015-03-24 09:50:08 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-03-24 22:49:47 +0000 |
commit | 331a7bbb1cd6781c93644a378d340deddcdb8bd2 (patch) | |
tree | acb41c2cbee465dea068e012d60aa9b9d1768fc0 /meta | |
parent | b574ac6f3c9e07f0054ed4261bc1f83583c29c53 (diff) | |
download | openembedded-core-331a7bbb1cd6781c93644a378d340deddcdb8bd2.tar.gz openembedded-core-331a7bbb1cd6781c93644a378d340deddcdb8bd2.tar.bz2 openembedded-core-331a7bbb1cd6781c93644a378d340deddcdb8bd2.zip |
package_deb: DpkgIndexer use apt-ftparchive that needs a valid config
Since we have support of log checking in deb/ipk [1] rootfs generation
in non Debian-based hosts fails because apt-ftparchive generates a
Warning when not find /etc/apt/apt.conf.d/ (available in Debian-based
hosts).
package_manager.py: DpkgPMIndexer add support for generate and export apt
configuration.
[1] http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=86aec93902af2e2d7d73ca9a643707fcca45055c
Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
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): class DpkgIndexer(Indexer): + def _create_configs(self): + bb.utils.mkdirhier(self.apt_conf_dir) + bb.utils.mkdirhier(os.path.join(self.apt_conf_dir, "lists", "partial")) + bb.utils.mkdirhier(os.path.join(self.apt_conf_dir, "apt.conf.d")) + bb.utils.mkdirhier(os.path.join(self.apt_conf_dir, "preferences.d")) + + with open(os.path.join(self.apt_conf_dir, "preferences"), + "w") as prefs_file: + pass + with open(os.path.join(self.apt_conf_dir, "sources.list"), + "w+") as sources_file: + pass + + with open(self.apt_conf_file, "w") as apt_conf: + with open(os.path.join(self.d.expand("${STAGING_ETCDIR_NATIVE}"), + "apt", "apt.conf.sample")) as apt_conf_sample: + for line in apt_conf_sample.read().split("\n"): + line = re.sub("#ROOTFS#", "/dev/null", line) + line = re.sub("#APTCONF#", self.apt_conf_dir, line) + apt_conf.write(line + "\n") + def write_index(self): + self.apt_conf_dir = os.path.join(self.d.expand("${APTCONF_TARGET}"), + "apt-ftparchive") + self.apt_conf_file = os.path.join(self.apt_conf_dir, "apt.conf") + self._create_configs() + + os.environ['APT_CONFIG'] = self.apt_conf_file + pkg_archs = self.d.getVar('PACKAGE_ARCHS', True) if pkg_archs is not None: arch_list = pkg_archs.split() |