Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 29/33] dpkg: always install dpkg-configure.service
From: Andreas Oberritter @ 2016-12-06 11:49 UTC (permalink / raw)
  To: openembedded-core
In-Reply-To: <1481024991-5882-1-git-send-email-obi@opendreambox.org>

systemd.bbclass handles everything based on DISTRO_FEATURES.

Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
---
 meta/recipes-devtools/dpkg/dpkg.inc | 22 ++++++++--------------
 1 file changed, 8 insertions(+), 14 deletions(-)

diff --git a/meta/recipes-devtools/dpkg/dpkg.inc b/meta/recipes-devtools/dpkg/dpkg.inc
index db37a7b..414ee5b 100644
--- a/meta/recipes-devtools/dpkg/dpkg.inc
+++ b/meta/recipes-devtools/dpkg/dpkg.inc
@@ -9,11 +9,7 @@ UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/d/dpkg/"
 
 inherit autotools gettext perlnative pkgconfig systemd
 
-python () {
-    if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
-        pn = d.getVar('PN', True)
-        d.setVar('SYSTEMD_SERVICE_%s' % (pn), 'dpkg-configure.service')
-}
+SYSTEMD_SERVICE_${PN} = "dpkg-configure.service"
 
 export PERL = "${bindir}/perl"
 PERL_class-native = "${STAGING_BINDIR_NATIVE}/perl-native/perl"
@@ -46,15 +42,13 @@ do_install_append_class-native() {
 }
 
 do_install_append () {
-	if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','false','true',d)};then
-		install -d ${D}${systemd_unitdir}/system
-		install -m 0644 ${WORKDIR}/dpkg-configure.service ${D}${systemd_unitdir}/system/
-		sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \
-			-e 's,@SYSCONFDIR@,${sysconfdir},g' \
-			-e 's,@BINDIR@,${bindir},g' \
-			-e 's,@SYSTEMD_UNITDIR@,${systemd_unitdir},g' \
-			${D}${systemd_unitdir}/system/dpkg-configure.service
-	fi
+    install -d ${D}${systemd_unitdir}/system
+    install -m 0644 ${WORKDIR}/dpkg-configure.service ${D}${systemd_unitdir}/system
+    sed -e 's,@BASE_BINDIR@,${base_bindir},g' \
+        -e 's,@SYSCONFDIR@,${sysconfdir},g' \
+        -e 's,@BINDIR@,${bindir},g' \
+        -e 's,@SYSTEMD_UNITDIR@,${systemd_unitdir},g' \
+        -i ${D}${systemd_unitdir}/system/dpkg-configure.service
 }
 
 PACKAGES =+ "dpkg-perl dselect libdpkg-perl start-stop-daemon update-alternatives-dpkg"
-- 
2.7.4



^ permalink raw reply related

* [PATCH 30/33] dpkg: use correct path for perl libraries
From: Andreas Oberritter @ 2016-12-06 11:49 UTC (permalink / raw)
  To: openembedded-core
In-Reply-To: <1481024991-5882-1-git-send-email-obi@opendreambox.org>

Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
---
 meta/recipes-devtools/dpkg/dpkg.inc | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/meta/recipes-devtools/dpkg/dpkg.inc b/meta/recipes-devtools/dpkg/dpkg.inc
index 414ee5b..1c404fc 100644
--- a/meta/recipes-devtools/dpkg/dpkg.inc
+++ b/meta/recipes-devtools/dpkg/dpkg.inc
@@ -1,21 +1,19 @@
 SUMMARY = "Package maintenance system from Debian"
 SECTION = "base"
 LICENSE = "GPLv2+"
-DEPENDS = "perl"
 DEPENDS_append_class-native = " bzip2-replacement-native"
 PROVIDES = "virtual/update-alternatives"
 
 UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/d/dpkg/"
 
-inherit autotools gettext perlnative pkgconfig systemd
+inherit autotools cpan-base gettext perlnative pkgconfig systemd
 
 SYSTEMD_SERVICE_${PN} = "dpkg-configure.service"
 
 export PERL = "${bindir}/perl"
 PERL_class-native = "${STAGING_BINDIR_NATIVE}/perl-native/perl"
 
-export PERL_LIBDIR = "${libdir}/perl"
-PERL_LIBDIR_class-native = "${libdir}/perl-native/perl"
+export PERL_LIBDIR = "${PERLLIBDIRS}/${PERLVERSION}"
 
 PACKAGECONFIG ??= "bzip2 gzip start-stop-daemon update-alternatives"
 PACKAGECONFIG[bzip2] = "--with-bz2,--without-bz2,bzip2"
-- 
2.7.4



^ permalink raw reply related

* [PATCH 25/33] dpkg: clean-up packaging of start-stop-daemon
From: Andreas Oberritter @ 2016-12-06 11:49 UTC (permalink / raw)
  To: openembedded-core
In-Reply-To: <1481024991-5882-1-git-send-email-obi@opendreambox.org>

Dpkg-start-stop is not an intuitive name. Just call the package
start-stop-daemon. Don't rdepend on it, because it might be empty.

Install start-stop-daemon to /sbin to match Debian and busybox.

Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
---
 meta/recipes-devtools/dpkg/dpkg.inc | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/meta/recipes-devtools/dpkg/dpkg.inc b/meta/recipes-devtools/dpkg/dpkg.inc
index 2eabc30..be8c253 100644
--- a/meta/recipes-devtools/dpkg/dpkg.inc
+++ b/meta/recipes-devtools/dpkg/dpkg.inc
@@ -32,7 +32,7 @@ PACKAGECONFIG[xz] = "--with-liblzma,--without-liblzma,xz"
 
 DPKG_DEB_COMPRESSOR ?= "${@bb.utils.contains('PACKAGECONFIG', 'xz', 'xz', 'gzip', d)}"
 
-EXTRA_OECONF += "--with-dpkg-deb-compressor=${DPKG_DEB_COMPRESSOR}"
+EXTRA_OECONF += "--sbindir=${base_sbindir} --with-dpkg-deb-compressor=${DPKG_DEB_COMPRESSOR}"
 
 EXTRA_OECONF += "TAR=tar"
 EXTRA_OECONF_append_class-target = " DEB_HOST_ARCH=${DPKG_ARCH}"
@@ -65,10 +65,14 @@ do_install_append () {
 	fi
 }
 
-PACKAGES =+ "update-alternatives-dpkg"
+PACKAGES =+ "start-stop-daemon update-alternatives-dpkg"
 
 RDEPENDS_${PN} = "${VIRTUAL-RUNTIME_update-alternatives} run-postinsts perl"
 RDEPENDS_${PN}_class-native = ""
+RRECOMMENDS_${PN} = "start-stop-daemon"
+RRECOMMENDS_${PN}_class-native = ""
+
+FILES_start-stop-daemon = "${base_sbindir}/start-stop-daemon"
 
 FILES_update-alternatives-dpkg = "${bindir}/update-alternatives ${localstatedir}/lib/dpkg/alternatives ${sysconfdir}/alternatives"
 RPROVIDES_update-alternatives-dpkg = "update-alternatives"
@@ -77,14 +81,4 @@ RCONFLICTS_update-alternatives-dpkg = "update-alternatives"
 PACKAGES += "${PN}-perl"
 FILES_${PN}-perl = "${libdir}/perl"
 
-# Split out start-stop-daemon to its own package.  Note that it
-# is installed in a different directory than the one used for
-# the bitbake version.
-#
-PACKAGES =+ "${PN}-start-stop"
-FILES_${PN}-start-stop = "${sbindir}/start-stop-daemon"
-
-RDEPENDS_${PN} += "${PN}-start-stop"
-
-
 BBCLASSEXTEND = "native"
-- 
2.7.4



^ permalink raw reply related

* [PATCH 27/33] dpkg: simplify replacing perl interpreter in scripts
From: Andreas Oberritter @ 2016-12-06 11:49 UTC (permalink / raw)
  To: openembedded-core
In-Reply-To: <1481024991-5882-1-git-send-email-obi@opendreambox.org>

Target scripts already contain the correct value.

Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
---
 meta/recipes-devtools/dpkg/dpkg.inc | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/meta/recipes-devtools/dpkg/dpkg.inc b/meta/recipes-devtools/dpkg/dpkg.inc
index ff59f50..5e838ed 100644
--- a/meta/recipes-devtools/dpkg/dpkg.inc
+++ b/meta/recipes-devtools/dpkg/dpkg.inc
@@ -41,13 +41,11 @@ do_configure_prepend_class-native() {
     sed -i -e 's|SYSCONFDIR|"/etc"|' ${S}/utils/update-alternatives.c
 }
 
-do_install_append () {
-	if [ "${PN}" = "dpkg-native" ]; then
-		sed -i -e 's|^#!.*${bindir}/perl-native.*/perl|#!/usr/bin/env nativeperl|' ${D}${bindir}/dpkg-*
-	else
-		sed -i -e 's|^#!.*${bindir}/perl-native.*/perl|#!/usr/bin/env perl|' ${D}${bindir}/dpkg-*
-	fi
+do_install_append_class-native() {
+    sed -i -e 's|^#!${PERL}|#!/usr/bin/env nativeperl|' ${D}${bindir}/dpkg-*
+}
 
+do_install_append () {
 	if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','false','true',d)};then
 		install -d ${D}${systemd_unitdir}/system
 		install -m 0644 ${WORKDIR}/dpkg-configure.service ${D}${systemd_unitdir}/system/
-- 
2.7.4



^ permalink raw reply related

* [PATCH 26/33] dpkg: remove unneeded do_configure override
From: Andreas Oberritter @ 2016-12-06 11:49 UTC (permalink / raw)
  To: openembedded-core
In-Reply-To: <1481024991-5882-1-git-send-email-obi@opendreambox.org>

Exporting PERL_LIBDIR is enough, compiler.m4 isn't needed.

Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
---
 meta/recipes-devtools/dpkg/dpkg.inc | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/meta/recipes-devtools/dpkg/dpkg.inc b/meta/recipes-devtools/dpkg/dpkg.inc
index be8c253..ff59f50 100644
--- a/meta/recipes-devtools/dpkg/dpkg.inc
+++ b/meta/recipes-devtools/dpkg/dpkg.inc
@@ -41,12 +41,6 @@ do_configure_prepend_class-native() {
     sed -i -e 's|SYSCONFDIR|"/etc"|' ${S}/utils/update-alternatives.c
 }
 
-do_configure () {
-    echo >> ${S}/m4/compiler.m4
-    sed -i -e 's#PERL_LIBDIR=.*$#PERL_LIBDIR="${libdir}/perl"#' ${S}/configure
-    autotools_do_configure
-}
-
 do_install_append () {
 	if [ "${PN}" = "dpkg-native" ]; then
 		sed -i -e 's|^#!.*${bindir}/perl-native.*/perl|#!/usr/bin/env nativeperl|' ${D}${bindir}/dpkg-*
-- 
2.7.4



^ permalink raw reply related

* [PATCH 22/33] package_manager/deb: implement BAD_RECOMMENDATIONS
From: Andreas Oberritter @ 2016-12-06 11:49 UTC (permalink / raw)
  To: openembedded-core
In-Reply-To: <1481024991-5882-1-git-send-email-obi@opendreambox.org>

Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
---
 meta/classes/rootfs_deb.bbclass |  6 ------
 meta/lib/oe/package_manager.py  | 27 +++++++++++++++++++++++++++
 meta/lib/oe/rootfs.py           |  2 ++
 3 files changed, 29 insertions(+), 6 deletions(-)

diff --git a/meta/classes/rootfs_deb.bbclass b/meta/classes/rootfs_deb.bbclass
index f79fca6..18d0b83 100644
--- a/meta/classes/rootfs_deb.bbclass
+++ b/meta/classes/rootfs_deb.bbclass
@@ -13,12 +13,6 @@ do_rootfs[vardeps] += "PACKAGE_FEED_URIS"
 do_rootfs[lockfiles] += "${DEPLOY_DIR_DEB}/deb.lock"
 do_populate_sdk[lockfiles] += "${DEPLOY_DIR_DEB}/deb.lock"
 
-python rootfs_deb_bad_recommendations() {
-    if d.getVar("BAD_RECOMMENDATIONS", True):
-        bb.warn("Debian package install does not support BAD_RECOMMENDATIONS")
-}
-do_rootfs[prefuncs] += "rootfs_deb_bad_recommendations"
-
 DEB_POSTPROCESS_COMMANDS = ""
 
 opkglibdir = "${localstatedir}/lib/opkg"
diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py
index b18148b..6c5b7ef 100644
--- a/meta/lib/oe/package_manager.py
+++ b/meta/lib/oe/package_manager.py
@@ -2198,6 +2198,33 @@ class DpkgPM(OpkgDpkgPM):
 
         return tmp_dir
 
+    def handle_bad_recommendations(self):
+        bad_recommendations = (self.d.getVar("BAD_RECOMMENDATIONS", True) or "").strip()
+        if not bad_recommendations:
+            return
+
+        status_file = self.target_rootfs + "/var/lib/dpkg/status"
+
+        with open(status_file + ".tmp", "w") as status:
+            for pkg in bad_recommendations.split():
+                pkg_info = ('apt-cache', 'show', pkg)
+
+                try:
+                    output = subprocess.check_output(pkg_info, stderr=subprocess.STDOUT).decode("utf-8")
+                except subprocess.CalledProcessError as e:
+                    bb.fatal("Cannot get package info. Command '%s' "
+                             "returned %d:\n%s" % (' '.join(pkg_info), e.returncode, e.output))
+
+                for line in output.splitlines():
+                    if not line:
+                        status.write("Status: hold ok not-installed\n\n")
+                        break
+
+                    if line.startswith(' ') or line.split(': ', 1)[0] not in ('Filename', 'Size', 'MD5sum', 'MSDOS-Filename'):
+                        status.write(line + "\n")
+
+        os.rename(status_file + ".tmp", status_file)
+
 def generate_index_files(d):
     classes = d.getVar('PACKAGE_CLASSES', True).replace("package_", "").split()
 
diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py
index 4c82456..b2bb67b 100644
--- a/meta/lib/oe/rootfs.py
+++ b/meta/lib/oe/rootfs.py
@@ -663,6 +663,8 @@ class DpkgRootfs(DpkgOpkgRootfs):
 
         self.pm.update()
 
+        self.pm.handle_bad_recommendations()
+
         if self.progress_reporter:
             self.progress_reporter.next_stage()
 
-- 
2.7.4



^ permalink raw reply related

* [PATCH 23/33] dpkg: use PACKAGECONFIG
From: Andreas Oberritter @ 2016-12-06 11:49 UTC (permalink / raw)
  To: openembedded-core
In-Reply-To: <1481024991-5882-1-git-send-email-obi@opendreambox.org>

Keep default dependencies as before. Set default compressor to xz
if selected, gzip otherwise.

Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
---
 meta/recipes-devtools/dpkg/dpkg.inc | 31 ++++++++++++++++++-------------
 1 file changed, 18 insertions(+), 13 deletions(-)

diff --git a/meta/recipes-devtools/dpkg/dpkg.inc b/meta/recipes-devtools/dpkg/dpkg.inc
index 6769a70..5b5ea01 100644
--- a/meta/recipes-devtools/dpkg/dpkg.inc
+++ b/meta/recipes-devtools/dpkg/dpkg.inc
@@ -1,13 +1,10 @@
 SUMMARY = "Package maintenance system from Debian"
 LICENSE = "GPLv2.0+"
 SECTION = "base"
+DEPENDS = "perl"
+DEPENDS_append_class-native = " bzip2-replacement-native"
 PROVIDES = "virtual/update-alternatives"
 
-DEPENDS = "zlib bzip2 perl ncurses"
-DEPENDS_class-native = "bzip2-replacement-native zlib-native gettext-native perl-native"
-RDEPENDS_${PN} = "${VIRTUAL-RUNTIME_update-alternatives} xz run-postinsts perl"
-RDEPENDS_${PN}_class-native = "xz-native"
-
 UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/d/dpkg/"
 
 inherit autotools gettext perlnative pkgconfig systemd
@@ -24,14 +21,18 @@ PERL_class-native = "${STAGING_BINDIR_NATIVE}/perl-native/perl"
 export PERL_LIBDIR = "${libdir}/perl"
 PERL_LIBDIR_class-native = "${libdir}/perl-native/perl"
 
-EXTRA_OECONF = "\
-		--disable-dselect \
-		--enable-start-stop-daemon \
-		--with-zlib \
-		--with-bz2 \
-		--without-liblzma \
-		--without-selinux \
-		"
+PACKAGECONFIG ??= "bzip2 gzip start-stop-daemon update-alternatives"
+PACKAGECONFIG[bzip2] = "--with-bz2,--without-bz2,bzip2"
+PACKAGECONFIG[dselect] = "--enable-dselect,--disable-dselect,ncurses"
+PACKAGECONFIG[gzip] = "--with-zlib,--without-zlib,zlib"
+PACKAGECONFIG[selinux] = "--with-selinux,--without-selinux,libselinux"
+PACKAGECONFIG[start-stop-daemon] = "--enable-start-stop-daemon,--disable-start-stop-daemon"
+PACKAGECONFIG[update-alternatives] = "--enable-update-alternatives,--disable-update-alternatives"
+PACKAGECONFIG[xz] = "--with-liblzma,--without-liblzma,xz"
+
+DPKG_DEB_COMPRESSOR ?= "${@bb.utils.contains('PACKAGECONFIG', 'xz', 'xz', 'gzip', d)}"
+
+EXTRA_OECONF += "--with-dpkg-deb-compressor=${DPKG_DEB_COMPRESSOR}"
 
 EXTRA_OECONF += "TAR=tar"
 EXTRA_OECONF_append_class-target = " DEB_HOST_ARCH=${DPKG_ARCH}"
@@ -65,6 +66,10 @@ do_install_append () {
 }
 
 PACKAGES =+ "update-alternatives-dpkg"
+
+RDEPENDS_${PN} = "${VIRTUAL-RUNTIME_update-alternatives} run-postinsts perl"
+RDEPENDS_${PN}_class-native = ""
+
 FILES_update-alternatives-dpkg = "${bindir}/update-alternatives ${localstatedir}/lib/dpkg/alternatives ${sysconfdir}/alternatives"
 RPROVIDES_update-alternatives-dpkg = "update-alternatives"
 RCONFLICTS_update-alternatives-dpkg = "update-alternatives"
-- 
2.7.4



^ permalink raw reply related

* [PATCH 24/33] dpkg: set license field to more common "GPLv2+"
From: Andreas Oberritter @ 2016-12-06 11:49 UTC (permalink / raw)
  To: openembedded-core
In-Reply-To: <1481024991-5882-1-git-send-email-obi@opendreambox.org>

Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
---
 meta/recipes-devtools/dpkg/dpkg.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-devtools/dpkg/dpkg.inc b/meta/recipes-devtools/dpkg/dpkg.inc
index 5b5ea01..2eabc30 100644
--- a/meta/recipes-devtools/dpkg/dpkg.inc
+++ b/meta/recipes-devtools/dpkg/dpkg.inc
@@ -1,6 +1,6 @@
 SUMMARY = "Package maintenance system from Debian"
-LICENSE = "GPLv2.0+"
 SECTION = "base"
+LICENSE = "GPLv2+"
 DEPENDS = "perl"
 DEPENDS_append_class-native = " bzip2-replacement-native"
 PROVIDES = "virtual/update-alternatives"
-- 
2.7.4



^ permalink raw reply related

* [PATCH 20/33] package_manager/deb: let apt-get handle postinst scripts
From: Andreas Oberritter @ 2016-12-06 11:49 UTC (permalink / raw)
  To: openembedded-core
In-Reply-To: <1481024991-5882-1-git-send-email-obi@opendreambox.org>

Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
---
 meta/lib/oe/package_manager.py | 86 ++++--------------------------------------
 meta/lib/oe/rootfs.py          |  6 +--
 2 files changed, 9 insertions(+), 83 deletions(-)

diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py
index 4ef4f6d..12dff20 100644
--- a/meta/lib/oe/package_manager.py
+++ b/meta/lib/oe/package_manager.py
@@ -1959,84 +1959,6 @@ class DpkgPM(OpkgDpkgPM):
 
         self.indexer = DpkgIndexer(self.d, self.deploy_dir)
 
-    """
-    This function will change a package's status in /var/lib/dpkg/status file.
-    If 'packages' is None then the new_status will be applied to all
-    packages
-    """
-    def mark_packages(self, status_tag, packages=None):
-        status_file = self.target_rootfs + "/var/lib/dpkg/status"
-
-        with open(status_file, "r") as sf:
-            with open(status_file + ".tmp", "w+") as tmp_sf:
-                if packages is None:
-                    tmp_sf.write(re.sub(r"Package: (.*?)\n((?:[^\n]+\n)*?)Status: (.*)(?:unpacked|installed)",
-                                        r"Package: \1\n\2Status: \3%s" % status_tag,
-                                        sf.read()))
-                else:
-                    if type(packages).__name__ != "list":
-                        raise TypeError("'packages' should be a list object")
-
-                    status = sf.read()
-                    for pkg in packages:
-                        status = re.sub(r"Package: %s\n((?:[^\n]+\n)*?)Status: (.*)(?:unpacked|installed)" % pkg,
-                                        r"Package: %s\n\1Status: \2%s" % (pkg, status_tag),
-                                        status)
-
-                    tmp_sf.write(status)
-
-        os.rename(status_file + ".tmp", status_file)
-
-    """
-    Run the pre/post installs for package "package_name". If package_name is
-    None, then run all pre/post install scriptlets.
-    """
-    def run_pre_post_installs(self, package_name=None):
-        info_dir = self.target_rootfs + "/var/lib/dpkg/info"
-        ControlScript = collections.namedtuple("ControlScript", ["suffix", "name", "argument"])
-        control_scripts = [
-                ControlScript(".preinst", "Preinstall", "install"),
-                ControlScript(".postinst", "Postinstall", "configure")]
-        status_file = self.target_rootfs + "/var/lib/dpkg/status"
-        installed_pkgs = []
-
-        with open(status_file, "r") as status:
-            for line in status.read().split('\n'):
-                m = re.match("^Package: (.*)", line)
-                if m is not None:
-                    installed_pkgs.append(m.group(1))
-
-        if package_name is not None and not package_name in installed_pkgs:
-            return
-
-        os.environ['D'] = self.target_rootfs
-        os.environ['OFFLINE_ROOT'] = self.target_rootfs
-        os.environ['IPKG_OFFLINE_ROOT'] = self.target_rootfs
-        os.environ['OPKG_OFFLINE_ROOT'] = self.target_rootfs
-        os.environ['INTERCEPT_DIR'] = os.path.join(self.d.getVar('WORKDIR', True),
-                                                   "intercept_scripts")
-        os.environ['NATIVE_ROOT'] = self.d.getVar('STAGING_DIR_NATIVE', True)
-
-        failed_pkgs = []
-        for pkg_name in installed_pkgs:
-            for control_script in control_scripts:
-                p_full = os.path.join(info_dir, pkg_name + control_script.suffix)
-                if os.path.exists(p_full):
-                    try:
-                        bb.note("Executing %s for package: %s ..." %
-                                 (control_script.name.lower(), pkg_name))
-                        subprocess.check_output([p_full, control_script.argument],
-                                stderr=subprocess.STDOUT)
-                    except subprocess.CalledProcessError as e:
-                        bb.note("%s for package %s failed with %d:\n%s" %
-                                (control_script.name, pkg_name, e.returncode,
-                                    e.output.decode("utf-8")))
-                        failed_pkgs.append(pkg_name)
-                        break
-
-        if len(failed_pkgs):
-            self.mark_packages("unpacked", failed_pkgs)
-
     def update(self):
         os.environ['APT_CONFIG'] = self.apt_conf_file
 
@@ -2058,6 +1980,14 @@ class DpkgPM(OpkgDpkgPM):
 
         os.environ['APT_CONFIG'] = self.apt_conf_file
 
+        os.environ['D'] = self.target_rootfs
+        os.environ['OFFLINE_ROOT'] = self.target_rootfs
+        os.environ['IPKG_OFFLINE_ROOT'] = self.target_rootfs
+        os.environ['OPKG_OFFLINE_ROOT'] = self.target_rootfs
+        os.environ['INTERCEPT_DIR'] = os.path.join(self.d.getVar('WORKDIR', True),
+                                                   "intercept_scripts")
+        os.environ['NATIVE_ROOT'] = self.d.getVar('STAGING_DIR_NATIVE', True)
+
         cmd = "%s %s install --force-yes --allow-unauthenticated %s" % \
               (self.apt_get_cmd, self.apt_args, ' '.join(pkgs))
 
diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py
index a348b97..4c82456 100644
--- a/meta/lib/oe/rootfs.py
+++ b/meta/lib/oe/rootfs.py
@@ -685,10 +685,6 @@ class DpkgRootfs(DpkgOpkgRootfs):
 
         self.pm.fix_broken_dependencies()
 
-        self.pm.mark_packages("installed")
-
-        self.pm.run_pre_post_installs()
-
         execute_pre_post_process(self.d, deb_post_process_cmds)
 
         if self.progress_reporter:
@@ -708,7 +704,7 @@ class DpkgRootfs(DpkgOpkgRootfs):
         return self._save_postinsts_common(dst_postinst_dir, src_postinst_dir)
 
     def _handle_intercept_failure(self, registered_pkgs):
-        self.pm.mark_packages("unpacked", registered_pkgs.split())
+        pass
 
     def _log_check(self):
         self._log_check_warn()
-- 
2.7.4



^ permalink raw reply related

* [PATCH 19/33] apt: recommend gnupg
From: Andreas Oberritter @ 2016-12-06 11:49 UTC (permalink / raw)
  To: openembedded-core
In-Reply-To: <1481024991-5882-1-git-send-email-obi@opendreambox.org>

Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
---
 meta/recipes-devtools/apt/apt_1.2.12.bb | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/meta/recipes-devtools/apt/apt_1.2.12.bb b/meta/recipes-devtools/apt/apt_1.2.12.bb
index 2c4f11d..4d781a2 100644
--- a/meta/recipes-devtools/apt/apt_1.2.12.bb
+++ b/meta/recipes-devtools/apt/apt_1.2.12.bb
@@ -109,6 +109,9 @@ PACKAGES =+ "${PN}-dselect ${PN}-transport-https ${PN}-utils lib${PN}-inst lib${
 RDEPENDS_${PN} = "dpkg debianutils"
 RDEPENDS_${PN}-dselect = "bash"
 
+RRECOMMENDS_${PN} = "gnupg"
+RRECOMMENDS_${PN}_class-native = ""
+
 FILES_${PN} += "${libdir}/dpkg"
 FILES_${PN}-dselect = "${libdir}/dpkg/methods/apt"
 FILES_${PN}-transport-https = "${libdir}/apt/methods/https"
-- 
2.7.4



^ permalink raw reply related

* [PATCH 21/33] package_manager/deb: create Packages.xz
From: Andreas Oberritter @ 2016-12-06 11:49 UTC (permalink / raw)
  To: openembedded-core
In-Reply-To: <1481024991-5882-1-git-send-email-obi@opendreambox.org>

apt-get prefers it over Packages.gz.

Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
---
 meta/lib/oe/package_manager.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py
index 12dff20..b18148b 100644
--- a/meta/lib/oe/package_manager.py
+++ b/meta/lib/oe/package_manager.py
@@ -304,6 +304,7 @@ class DpkgIndexer(Indexer):
 
         apt_ftparchive = bb.utils.which(os.getenv('PATH'), "apt-ftparchive")
         gzip = bb.utils.which(os.getenv('PATH'), "gzip")
+        xz = bb.utils.which(os.getenv('PATH'), "xz")
 
         index_cmds = []
         deb_dirs_found = False
@@ -315,6 +316,7 @@ class DpkgIndexer(Indexer):
             cmd = "cd %s; PSEUDO_UNLOAD=1 %s packages . > Packages;" % (arch_dir, apt_ftparchive)
 
             cmd += "%s -fc Packages > Packages.gz;" % gzip
+            cmd += "%s -fc Packages > Packages.xz;" % xz
 
             with open(os.path.join(arch_dir, "Release"), "w+") as release:
                 release.write("Label: %s\n" % arch)
-- 
2.7.4



^ permalink raw reply related

* [PATCH 14/33] apt-native: drop obsolete patches
From: Andreas Oberritter @ 2016-12-06 11:49 UTC (permalink / raw)
  To: openembedded-core
In-Reply-To: <1481024991-5882-1-git-send-email-obi@opendreambox.org>

0001-Revert-always-run-dpkg-configure-a-at-the-end-of-our.patch and
noconfigure.patch are obsolete due to dpkg's new --force-script-chrootless
option.

db_linking_hack.patch and environment.patch are marked as backports
from 2007.

no-curl.patch: curl-native is already a prerequisite.

Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
---
 meta/recipes-devtools/apt/apt-native_1.2.12.bb     |   6 +-
 ...ys-run-dpkg-configure-a-at-the-end-of-our.patch | 126 ---------------------
 meta/recipes-devtools/apt/apt/noconfigure.patch    |  37 ------
 .../apt/files/db_linking_hack.patch                |  29 -----
 meta/recipes-devtools/apt/files/environment.patch  |  15 ---
 meta/recipes-devtools/apt/files/no-curl.patch      |  54 ---------
 6 files changed, 1 insertion(+), 266 deletions(-)
 delete mode 100644 meta/recipes-devtools/apt/apt/0001-Revert-always-run-dpkg-configure-a-at-the-end-of-our.patch
 delete mode 100644 meta/recipes-devtools/apt/apt/noconfigure.patch
 delete mode 100644 meta/recipes-devtools/apt/files/db_linking_hack.patch
 delete mode 100644 meta/recipes-devtools/apt/files/environment.patch
 delete mode 100644 meta/recipes-devtools/apt/files/no-curl.patch

diff --git a/meta/recipes-devtools/apt/apt-native_1.2.12.bb b/meta/recipes-devtools/apt/apt-native_1.2.12.bb
index 695e21d..8d32ef9 100644
--- a/meta/recipes-devtools/apt/apt-native_1.2.12.bb
+++ b/meta/recipes-devtools/apt/apt-native_1.2.12.bb
@@ -5,12 +5,8 @@ DEPENDS += "dpkg-native gettext-native db-native curl-native xz-native"
 PACKAGES = ""
 USE_NLS = "yes"
 
-SRC_URI += "file://db_linking_hack.patch \
-            file://0001-Revert-always-run-dpkg-configure-a-at-the-end-of-our.patch \
-            file://0001-remove-Wsuggest-attribute-from-CFLAGS.patch \
+SRC_URI += "file://0001-remove-Wsuggest-attribute-from-CFLAGS.patch \
             file://0001-fix-the-gcc-version-check.patch \
-            file://noconfigure.patch \
-            file://no-curl.patch \
             file://apt.conf.in \
 "
 
diff --git a/meta/recipes-devtools/apt/apt/0001-Revert-always-run-dpkg-configure-a-at-the-end-of-our.patch b/meta/recipes-devtools/apt/apt/0001-Revert-always-run-dpkg-configure-a-at-the-end-of-our.patch
deleted file mode 100644
index b3a883b..0000000
--- a/meta/recipes-devtools/apt/apt/0001-Revert-always-run-dpkg-configure-a-at-the-end-of-our.patch
+++ /dev/null
@@ -1,126 +0,0 @@
-From dfc1370d50322e2e9d225a7a63b44993fc01a727 Mon Sep 17 00:00:00 2001
-From: Roy Li <rongqing.li@windriver.com>
-Date: Fri, 22 May 2015 08:05:15 +0800
-Subject: [PATCH] Revert "always run 'dpkg --configure -a' at the end of our
- dpkg callings"
-
-Upstream-Status: Inappropriate [embedded specific]
-
-This reverts commit a2a75ff4516f7609f4c55b42270abb8d08943c60, which
-always run 'dpkg --configure -a' at the end of our dpkg callings,
-but it does not work for cross-compile, since the rootfs dir can not
-be passed into dpkg, and lead to the below similar error:
-   -------
-   |mkdir: cannot create directory '/usr/lib/opkg': Permission denied
-   -------
-
-Signed-off-by: Roy Li <rongqing.li@windriver.com>
----
- apt-pkg/deb/dpkgpm.cc                                     |  9 ++-------
- test/integration/test-apt-progress-fd-deb822              | 14 +++++++-------
- test/integration/test-no-fds-leaked-to-maintainer-scripts |  6 ++----
- 3 files changed, 11 insertions(+), 18 deletions(-)
-
-diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc
-index 834cb0e..84ded3a 100644
---- a/apt-pkg/deb/dpkgpm.cc
-+++ b/apt-pkg/deb/dpkgpm.cc
-@@ -1037,12 +1037,6 @@ void pkgDPkgPM::BuildPackagesProgressMap()
- 	 PackagesTotal++;
-       }
-    }
--   /* one extra: We don't want the progress bar to reach 100%, especially not
--      if we call dpkg --configure --pending and process a bunch of triggers
--      while showing 100%. Also, spindown takes a while, so never reaching 100%
--      is way more correct than reaching 100% while still doing stuff even if
--      doing it this way is slightly bending the rules */
--   ++PackagesTotal;
- }
-                                                                         /*}}}*/
- bool pkgDPkgPM::Go(int StatusFd)
-@@ -1250,8 +1244,9 @@ bool pkgDPkgPM::Go(APT::Progress::PackageManager *progress)
- 
-    // support subpressing of triggers processing for special
-    // cases like d-i that runs the triggers handling manually
-+   bool const SmartConf = (_config->Find("PackageManager::Configure", "all") != "all");
-    bool const TriggersPending = _config->FindB("DPkg::TriggersPending", false);
--   if (_config->FindB("DPkg::ConfigurePending", true) == true)
-+   if (_config->FindB("DPkg::ConfigurePending", SmartConf) == true)
-       List.push_back(Item(Item::ConfigurePending, PkgIterator()));
- 
-    // for the progress
-diff --git a/test/integration/test-apt-progress-fd-deb822 b/test/integration/test-apt-progress-fd-deb822
-index 58fd732..3359762 100755
---- a/test/integration/test-apt-progress-fd-deb822
-+++ b/test/integration/test-apt-progress-fd-deb822
-@@ -27,36 +27,36 @@ Message: Installing testing (amd64)
- 
- Status: progress
- Package: testing:amd64
--Percent: 16.6667
-+Percent: 20
- Message: Preparing testing (amd64)
- 
- Status: progress
- Package: testing:amd64
--Percent: 33.3333
-+Percent: 40
- Message: Unpacking testing (amd64)
- 
- Status: progress
- Package: testing:amd64
--Percent: 50
-+Percent: 60
- Message: Preparing to configure testing (amd64)
- 
- Status: progress
--Percent: 50
-+Percent: 60
- Message: Running dpkg
- 
- Status: progress
- Package: testing:amd64
--Percent: 50
-+Percent: 60
- Message: Configuring testing (amd64)
- 
- Status: progress
- Package: testing:amd64
--Percent: 66.6667
-+Percent: 80
- Message: Configuring testing (amd64)
- 
- Status: progress
- Package: testing:amd64
--Percent: 83.3333
-+Percent: 100
- Message: Installed testing (amd64)
- 
- Status: progress
-diff --git a/test/integration/test-no-fds-leaked-to-maintainer-scripts b/test/integration/test-no-fds-leaked-to-maintainer-scripts
-index d86e638..ef6d23b 100755
---- a/test/integration/test-no-fds-leaked-to-maintainer-scripts
-+++ b/test/integration/test-no-fds-leaked-to-maintainer-scripts
-@@ -59,8 +59,7 @@ startup packages configure
- configure $PKGNAME 1.0 <none>
- status unpacked $PKGNAME 1.0
- status half-configured $PKGNAME 1.0
--status installed $PKGNAME 1.0
--startup packages configure" cut -f 3- -d' ' rootdir/var/log/dpkg.log
-+status installed $PKGNAME 1.0" cut -f 3- -d' ' rootdir/var/log/dpkg.log
- }
- checkinstall
- 
-@@ -85,8 +84,7 @@ status config-files $PKGNAME 1.0
- status config-files $PKGNAME 1.0
- status config-files $PKGNAME 1.0
- status config-files $PKGNAME 1.0
--status not-installed $PKGNAME <none>
--startup packages configure" cut -f 3- -d' ' rootdir/var/log/dpkg.log
-+status not-installed $PKGNAME <none>" cut -f 3- -d' ' rootdir/var/log/dpkg.log
- }
- checkpurge
- 
--- 
-2.1.4
-
diff --git a/meta/recipes-devtools/apt/apt/noconfigure.patch b/meta/recipes-devtools/apt/apt/noconfigure.patch
deleted file mode 100644
index ebc6720..0000000
--- a/meta/recipes-devtools/apt/apt/noconfigure.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-Upstream-Status: Inappropriate [configuration]
-Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
-
-
-diff --git a/apt-pkg/packagemanager.cc b/apt-pkg/packagemanager.cc
-index 249542c..0a1911f 100644
---- a/apt-pkg/packagemanager.cc
-+++ b/apt-pkg/packagemanager.cc
-@@ -952,10 +952,12 @@ bool pkgPackageManager::SmartUnPack(PkgIterator Pkg, bool const Immediate, int c
-       return false;
- 
-    if (Immediate == true) {
-+#if 0
-       // Perform immedate configuration of the package. 
-          if (SmartConfigure(Pkg, Depth + 1) == false)
-             _error->Error(_("Could not perform immediate configuration on '%s'. "
-                "Please see man 5 apt.conf under APT::Immediate-Configure for details. (%d)"),Pkg.FullName().c_str(),2);
-+#endif
-    }
-    
-    return true;
-@@ -1038,6 +1040,7 @@ pkgPackageManager::OrderResult pkgPackageManager::OrderInstall()
-       }
-    }
- 
-+#if 0
-    // Final run through the configure phase
-    if (ConfigureAll() == false)
-       return Failed;
-@@ -1052,6 +1055,7 @@ pkgPackageManager::OrderResult pkgPackageManager::OrderInstall()
- 	 return Failed;
-       }
-    }
-+#endif
- 	 
-    return Completed;
- }
diff --git a/meta/recipes-devtools/apt/files/db_linking_hack.patch b/meta/recipes-devtools/apt/files/db_linking_hack.patch
deleted file mode 100644
index a61d4b0..0000000
--- a/meta/recipes-devtools/apt/files/db_linking_hack.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-Upstream-Status: Backport
-
-Index: apt-0.7.3/configure.ac
-===================================================================
---- apt-0.7.3.orig/configure.ac	2007-07-01 10:38:45.000000000 +0000
-+++ apt-0.7.3/configure.ac	2007-08-21 13:39:26.000000000 +0000
-@@ -67,8 +67,20 @@
-       [AC_DEFINE(HAVE_BDB)
-        BDBLIB="-ldb"
-        AC_MSG_RESULT(yes)],
--      [BDBLIB=""
--       AC_MSG_RESULT(no)]
-+
-+       LIBS="$LIBS -lpthread"
-+       [AC_MSG_CHECKING(if we can link against BerkeleyDB with pthread)
-+        AC_LINK_IFELSE(
-+        [AC_LANG_PROGRAM(
-+         [#include <db.h>],
-+         [int r, s, t; db_version(&r, &s, &t);]
-+        )],
-+        [AC_DEFINE(HAVE_BDB)
-+         BDBLIB="-ldb -lpthread"
-+         AC_MSG_RESULT(yes)],
-+        [BDBLIB=""
-+         AC_MSG_RESULT(no)]
-+      )]       
-     )]
- )
- 
diff --git a/meta/recipes-devtools/apt/files/environment.patch b/meta/recipes-devtools/apt/files/environment.patch
deleted file mode 100644
index 9a03038..0000000
--- a/meta/recipes-devtools/apt/files/environment.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-Upstream-Status: Backport
-
-Index: apt-0.6.46.2/buildlib/environment.mak.in
-===================================================================
---- apt-0.6.46.2.orig/buildlib/environment.mak.in	2007-03-29 11:38:58.000000000 +0100
-+++ apt-0.6.46.2/buildlib/environment.mak.in	2007-03-29 11:39:12.000000000 +0100
-@@ -62,7 +62,7 @@
- 
- # Shared library things
- HOST_OS = @host_os@
--ifneq ($(words $(filter linux-gnu gnu% %gnu,$(HOST_OS))),0)
-+ifneq ($(words $(filter linux-gnu linux-gnueabi gnu% %gnu,$(HOST_OS))),0)
-    SONAME_MAGIC=-Wl,-soname -Wl,
-    LFLAGS_SO=
- else
diff --git a/meta/recipes-devtools/apt/files/no-curl.patch b/meta/recipes-devtools/apt/files/no-curl.patch
deleted file mode 100644
index 0838552..0000000
--- a/meta/recipes-devtools/apt/files/no-curl.patch
+++ /dev/null
@@ -1,54 +0,0 @@
-Upstream-Status: Inappropriate [configuration]
-From 5d61ac822fd9a3871cd5089389c210606232ecdc Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?An=C3=ADbal=20Lim=C3=B3n?= <anibal.limon@linux.intel.com>
-Date: Thu, 26 May 2016 15:34:45 -0500
-Subject: [PATCH] Upstream-Status: Inappropriate [configuration]
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
----
- configure.ac     | 7 -------
- methods/makefile | 7 -------
- 2 files changed, 14 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index e47f459..cd24264 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -83,13 +83,6 @@ AC_CHECK_HEADER(db.h,
- 
- LIBS="$saveLIBS"
- 
--AC_CHECK_LIB(curl, curl_easy_init,
--     [AC_CHECK_HEADER(curl/curl.h,
--        curl_ok=yes,
--        curl_ok=no)],
--     AC_MSG_ERROR([failed: I need CURL due https support]),
--)
--
- AC_SUBST(BDBLIB)
- 
- HAVE_ZLIB=no
-diff --git a/methods/makefile b/methods/makefile
-index 3274e92..255086b 100644
---- a/methods/makefile
-+++ b/methods/makefile
-@@ -51,13 +51,6 @@ LIB_MAKES = apt-pkg/makefile
- SOURCE = http.cc http_main.cc rfc2553emu.cc connect.cc server.cc
- include $(PROGRAM_H)
- 
--# The https method
--PROGRAM=https
--SLIBS = -lapt-pkg -lcurl $(INTLLIBS) -lresolv
--LIB_MAKES = apt-pkg/makefile
--SOURCE = https.cc server.cc
--include $(PROGRAM_H)
--
- # The ftp method
- PROGRAM=ftp
- SLIBS = -lapt-pkg $(SOCKETLIBS) $(INTLLIBS) -lresolv
--- 
-2.1.4
-
-- 
2.7.4



^ permalink raw reply related

* [PATCH 16/33] apt: merge apt.inc into .bb
From: Andreas Oberritter @ 2016-12-06 11:49 UTC (permalink / raw)
  To: openembedded-core
In-Reply-To: <1481024991-5882-1-git-send-email-obi@opendreambox.org>

Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
---
 meta/recipes-devtools/apt/apt.inc       | 38 --------------------------------
 meta/recipes-devtools/apt/apt_1.2.12.bb | 39 ++++++++++++++++++++++++++++++++-
 2 files changed, 38 insertions(+), 39 deletions(-)
 delete mode 100644 meta/recipes-devtools/apt/apt.inc

diff --git a/meta/recipes-devtools/apt/apt.inc b/meta/recipes-devtools/apt/apt.inc
deleted file mode 100644
index 1488664..0000000
--- a/meta/recipes-devtools/apt/apt.inc
+++ /dev/null
@@ -1,38 +0,0 @@
-SUMMARY = "Advanced front-end for dpkg"
-LICENSE = "GPLv2.0+"
-SECTION = "base"
-
-SRC_URI = "http://snapshot.debian.org/archive/debian/20160526T162943Z/pool/main/a/${BPN}/${BPN}_${PV}.tar.xz \
-           file://use-host.patch \
-           file://makerace.patch \
-           file://no-nls-dpkg.patch \
-           file://fix-gcc-4.6-null-not-defined.patch \
-           file://truncate-filename.patch \
-           file://nodoc.patch \
-           file://disable-configure-in-makefile.patch \
-           file://disable-test.patch \
-           file://0001-environment.mak-musl-based-systems-can-generate-shar.patch \
-           file://0001-apt-1.2.12-Fix-musl-build.patch \
-           file://0001-remove-Wsuggest-attribute-from-CFLAGS.patch \
-           file://0001-fix-the-gcc-version-check.patch \
-           file://apt.conf.in \
-           "
-SRC_URI[md5sum] = "80f6f0ef110a45a7e5af8a9d233fb0e7"
-SRC_URI[sha256sum] = "e820d27cba73476df4abcff27dadd1b5847474bfe85f7e9202a9a07526973ea6"
-LIC_FILES_CHKSUM = "file://COPYING.GPL;md5=0636e73ff0215e8d672dc4c32c317bb3"
-
-# the package is taken from snapshots.debian.org; that source is static and goes stale
-# so we check the latest upstream from a directory that does get updated
-UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/a/apt/"
-
-inherit autotools gettext useradd
-
-EXTRA_AUTORECONF = "--exclude=autopoint,autoheader"
-
-do_configure_prepend() {
-    rm -rf ${S}/buildlib/config.sub
-    rm -rf ${S}/buildlib/config.guess
-}
-
-USERADD_PACKAGES = "${PN}"
-USERADD_PARAM_${PN} = "--system --no-create-home --home-dir /nonexistent --shell /bin/false --user-group _apt"
diff --git a/meta/recipes-devtools/apt/apt_1.2.12.bb b/meta/recipes-devtools/apt/apt_1.2.12.bb
index f09dfc8..3463a23 100644
--- a/meta/recipes-devtools/apt/apt_1.2.12.bb
+++ b/meta/recipes-devtools/apt/apt_1.2.12.bb
@@ -1,6 +1,43 @@
+SUMMARY = "Advanced front-end for dpkg"
+SECTION = "base"
+LICENSE = "GPLv2.0+"
 DEPENDS = "curl db zlib"
 RDEPENDS_${PN} = "dpkg bash debianutils"
-require apt.inc
+
+SRC_URI = "http://snapshot.debian.org/archive/debian/20160526T162943Z/pool/main/a/${BPN}/${BPN}_${PV}.tar.xz \
+           file://use-host.patch \
+           file://makerace.patch \
+           file://no-nls-dpkg.patch \
+           file://fix-gcc-4.6-null-not-defined.patch \
+           file://truncate-filename.patch \
+           file://nodoc.patch \
+           file://disable-configure-in-makefile.patch \
+           file://disable-test.patch \
+           file://0001-environment.mak-musl-based-systems-can-generate-shar.patch \
+           file://0001-apt-1.2.12-Fix-musl-build.patch \
+           file://0001-remove-Wsuggest-attribute-from-CFLAGS.patch \
+           file://0001-fix-the-gcc-version-check.patch \
+           file://apt.conf.in \
+           "
+SRC_URI[md5sum] = "80f6f0ef110a45a7e5af8a9d233fb0e7"
+SRC_URI[sha256sum] = "e820d27cba73476df4abcff27dadd1b5847474bfe85f7e9202a9a07526973ea6"
+LIC_FILES_CHKSUM = "file://COPYING.GPL;md5=0636e73ff0215e8d672dc4c32c317bb3"
+
+# the package is taken from snapshots.debian.org; that source is static and goes stale
+# so we check the latest upstream from a directory that does get updated
+UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/a/apt/"
+
+inherit autotools gettext useradd
+
+EXTRA_AUTORECONF = "--exclude=autopoint,autoheader"
+
+do_configure_prepend() {
+    rm -rf ${S}/buildlib/config.sub
+    rm -rf ${S}/buildlib/config.guess
+}
+
+USERADD_PACKAGES = "${PN}"
+USERADD_PARAM_${PN} = "--system --no-create-home --home-dir /nonexistent --shell /bin/false --user-group _apt"
 
 USE_NLS_class-native = "yes"
 
-- 
2.7.4



^ permalink raw reply related

* [PATCH 17/33] apt: group variables (license, configuration, packaging)
From: Andreas Oberritter @ 2016-12-06 11:49 UTC (permalink / raw)
  To: openembedded-core
In-Reply-To: <1481024991-5882-1-git-send-email-obi@opendreambox.org>

Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
---
 meta/recipes-devtools/apt/apt_1.2.12.bb | 32 +++++++++++++++++---------------
 1 file changed, 17 insertions(+), 15 deletions(-)

diff --git a/meta/recipes-devtools/apt/apt_1.2.12.bb b/meta/recipes-devtools/apt/apt_1.2.12.bb
index 3463a23..a350b36 100644
--- a/meta/recipes-devtools/apt/apt_1.2.12.bb
+++ b/meta/recipes-devtools/apt/apt_1.2.12.bb
@@ -1,8 +1,8 @@
 SUMMARY = "Advanced front-end for dpkg"
 SECTION = "base"
 LICENSE = "GPLv2.0+"
+LIC_FILES_CHKSUM = "file://COPYING.GPL;md5=0636e73ff0215e8d672dc4c32c317bb3"
 DEPENDS = "curl db zlib"
-RDEPENDS_${PN} = "dpkg bash debianutils"
 
 SRC_URI = "http://snapshot.debian.org/archive/debian/20160526T162943Z/pool/main/a/${BPN}/${BPN}_${PV}.tar.xz \
            file://use-host.patch \
@@ -21,7 +21,6 @@ SRC_URI = "http://snapshot.debian.org/archive/debian/20160526T162943Z/pool/main/
            "
 SRC_URI[md5sum] = "80f6f0ef110a45a7e5af8a9d233fb0e7"
 SRC_URI[sha256sum] = "e820d27cba73476df4abcff27dadd1b5847474bfe85f7e9202a9a07526973ea6"
-LIC_FILES_CHKSUM = "file://COPYING.GPL;md5=0636e73ff0215e8d672dc4c32c317bb3"
 
 # the package is taken from snapshots.debian.org; that source is static and goes stale
 # so we check the latest upstream from a directory that does get updated
@@ -31,6 +30,13 @@ inherit autotools gettext useradd
 
 EXTRA_AUTORECONF = "--exclude=autopoint,autoheader"
 
+PACKAGECONFIG ??= "lzma"
+PACKAGECONFIG[lzma] = "ac_cv_lib_lzma_lzma_easy_encoder=yes,ac_cv_lib_lzma_lzma_easy_encoder=no,xz"
+PACKAGECONFIG[bz2] = "ac_cv_lib_bz2_BZ2_bzopen=yes,ac_cv_lib_bz2_BZ2_bzopen=no,bzip2"
+PACKAGECONFIG[lz4] = "ac_cv_lib_lz4_LZ4F_createCompressionContext=yes,ac_cv_lib_lz4_LZ4F_createCompressionContext=no,lz4"
+
+USE_NLS_class-native = "yes"
+
 do_configure_prepend() {
     rm -rf ${S}/buildlib/config.sub
     rm -rf ${S}/buildlib/config.guess
@@ -39,14 +45,6 @@ do_configure_prepend() {
 USERADD_PACKAGES = "${PN}"
 USERADD_PARAM_${PN} = "--system --no-create-home --home-dir /nonexistent --shell /bin/false --user-group _apt"
 
-USE_NLS_class-native = "yes"
-
-PACKAGES =+ "${PN}-utils"
-FILES_${PN} += "${libdir}/dpkg"
-FILES_${PN}-utils = "${bindir}/apt-extracttemplates \
-                     ${bindir}/apt-ftparchive \
-                     ${bindir}/apt-sortpkgs"
-
 PROGRAMS = " \
     apt apt-cache apt-cdrom apt-config apt-extracttemplates \
     apt-ftparchive apt-get apt-key apt-mark apt-sortpkgs \
@@ -94,11 +92,6 @@ do_install () {
 	install -d ${D}${localstatedir}/log/apt
 }
 
-PACKAGECONFIG ??= "lzma"
-PACKAGECONFIG[lzma] = "ac_cv_lib_lzma_lzma_easy_encoder=yes,ac_cv_lib_lzma_lzma_easy_encoder=no,xz"
-PACKAGECONFIG[bz2] = "ac_cv_lib_bz2_BZ2_bzopen=yes,ac_cv_lib_bz2_BZ2_bzopen=no,bzip2"
-PACKAGECONFIG[lz4] = "ac_cv_lib_lz4_LZ4F_createCompressionContext=yes,ac_cv_lib_lz4_LZ4F_createCompressionContext=no,lz4"
-
 do_install_append_class-native() {
     sed -e "s,@STAGING_DIR_NATIVE@,${STAGING_DIR_NATIVE},g" \
         -e "s,@STAGING_BINDIR_NATIVE@,${STAGING_BINDIR_NATIVE},g" \
@@ -111,4 +104,13 @@ do_install_append_class-target() {
     echo 'APT::Architecture "${DPKG_ARCH}";' > ${D}${sysconfdir}/apt/apt.conf
 }
 
+PACKAGES =+ "${PN}-utils"
+
+RDEPENDS_${PN} = "dpkg bash debianutils"
+
+FILES_${PN} += "${libdir}/dpkg"
+FILES_${PN}-utils = "${bindir}/apt-extracttemplates \
+                     ${bindir}/apt-ftparchive \
+                     ${bindir}/apt-sortpkgs"
+
 BBCLASSEXTEND = "native"
-- 
2.7.4



^ permalink raw reply related

* [PATCH 13/33] apt: rewrite do_install
From: Andreas Oberritter @ 2016-12-06 11:49 UTC (permalink / raw)
  To: openembedded-core
In-Reply-To: <1481024991-5882-1-git-send-email-obi@opendreambox.org>

Install missing files and directories (apt, apt-ftparchive,
apt-helper, apt-mark, trusted.gpg.d).

Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
---
 meta/recipes-devtools/apt/apt_1.2.12.bb | 73 ++++++++++++++++++---------------
 1 file changed, 41 insertions(+), 32 deletions(-)

diff --git a/meta/recipes-devtools/apt/apt_1.2.12.bb b/meta/recipes-devtools/apt/apt_1.2.12.bb
index c531a49..20c7cb4 100644
--- a/meta/recipes-devtools/apt/apt_1.2.12.bb
+++ b/meta/recipes-devtools/apt/apt_1.2.12.bb
@@ -4,44 +4,55 @@ require apt.inc
 
 PACKAGES =+ "${PN}-utils"
 FILES_${PN} += "${libdir}/dpkg"
-FILES_${PN}-utils = "${bindir}/apt-sortpkgs ${bindir}/apt-extracttemplates"
+FILES_${PN}-utils = "${bindir}/apt-extracttemplates \
+                     ${bindir}/apt-ftparchive \
+                     ${bindir}/apt-sortpkgs"
+
+PROGRAMS = " \
+    apt apt-cache apt-cdrom apt-config apt-extracttemplates \
+    apt-ftparchive apt-get apt-key apt-mark apt-sortpkgs \
+"
 
 do_install () {
-	set -x
 	install -d ${D}${bindir}
-	install -m 0755 bin/apt-key ${D}${bindir}/
-	install -m 0755 bin/apt-cdrom ${D}${bindir}/
-	install -m 0755 bin/apt-get ${D}${bindir}/
-	install -m 0755 bin/apt-config ${D}${bindir}/
-	install -m 0755 bin/apt-cache ${D}${bindir}/
+	for f in ${PROGRAMS}; do
+		install -m 0755 bin/$f ${D}${bindir}
+	done
+
+	install -d ${D}${docdir}/apt/examples
+	install -m 0644 ${S}/doc/examples/* ${D}${docdir}/apt/examples
 
-	install -m 0755 bin/apt-sortpkgs ${D}${bindir}/
-	install -m 0755 bin/apt-extracttemplates ${D}${bindir}/
+	install -d ${D}${includedir}/apt-pkg
+	install -m 0644 include/apt-pkg/*.h ${D}${includedir}/apt-pkg
 
-	oe_libinstall -so -C bin libapt-pkg ${D}${libdir}
-	oe_libinstall -so -C bin libapt-inst ${D}${libdir}
+	install -d ${D}${libdir}
+	for f in inst pkg private; do
+		oe_libinstall -so -C bin libapt-$f ${D}${libdir}
+	done
+
+	install -d ${D}${libdir}/apt
+	install -m 0755 bin/apt-helper ${D}${libdir}/apt
 
 	install -d ${D}${libdir}/apt/methods
-	install -m 0755 bin/methods/* ${D}${libdir}/apt/methods/
+	install -m 0755 bin/methods/* ${D}${libdir}/apt/methods
 
 	install -d ${D}${libdir}/dpkg/methods/apt
-	install -m 0644 ${S}/dselect/desc.apt ${D}${libdir}/dpkg/methods/apt/ 
-	install -m 0644 ${S}/dselect/names ${D}${libdir}/dpkg/methods/apt/ 
-	install -m 0755 ${S}/dselect/install ${D}${libdir}/dpkg/methods/apt/ 
-	install -m 0755 ${S}/dselect/setup ${D}${libdir}/dpkg/methods/apt/ 
-	install -m 0755 ${S}/dselect/update ${D}${libdir}/dpkg/methods/apt/ 
-
-	install -d ${D}${sysconfdir}/apt
-	install -d ${D}${sysconfdir}/apt/apt.conf.d
-	install -d ${D}${sysconfdir}/apt/sources.list.d
-	install -d ${D}${sysconfdir}/apt/preferences.d
-	install -d ${D}${localstatedir}/lib/apt/lists/partial
-	install -d ${D}${localstatedir}/cache/apt/archives/partial
-	install -d ${D}${docdir}/apt/examples
-	install -m 0644 ${S}/doc/examples/* ${D}${docdir}/apt/examples/
+	for f in desc.apt names; do
+		install -m 0644 ${S}/dselect/$f ${D}${libdir}/dpkg/methods/apt
+	done
+	for f in install setup update; do
+		install -m 0755 ${S}/dselect/$f ${D}${libdir}/dpkg/methods/apt
+	done
+
+	for d in apt.conf.d preferences.d sources.list.d trusted.gpg.d; do
+		install -d ${D}${sysconfdir}/apt/$d
+	done
 
-	install -d ${D}${includedir}/apt-pkg/
-	install -m 0644 include/apt-pkg/*.h ${D}${includedir}/apt-pkg/
+	install -d ${D}${localstatedir}/cache/apt/archives/partial
+	install -d ${D}${localstatedir}/lib/apt/lists/partial
+	install -d ${D}${localstatedir}/lib/apt/mirrors/partial
+	install -d ${D}${localstatedir}/lib/apt/periodic
+	install -d ${D}${localstatedir}/log/apt
 }
 
 PACKAGECONFIG ??= "lzma"
@@ -49,9 +60,7 @@ PACKAGECONFIG[lzma] = "ac_cv_lib_lzma_lzma_easy_encoder=yes,ac_cv_lib_lzma_lzma_
 PACKAGECONFIG[bz2] = "ac_cv_lib_bz2_BZ2_bzopen=yes,ac_cv_lib_bz2_BZ2_bzopen=no,bzip2"
 PACKAGECONFIG[lz4] = "ac_cv_lib_lz4_LZ4F_createCompressionContext=yes,ac_cv_lib_lz4_LZ4F_createCompressionContext=no,lz4"
 
-do_install_append() {
+do_install_append_class-target() {
     #Write the correct apt-architecture to apt.conf
-    APT_CONF=${D}/etc/apt/apt.conf
-    echo 'APT::Architecture "${DPKG_ARCH}";' > ${APT_CONF}
-    oe_libinstall -so -C bin libapt-private ${D}${libdir}/
+    echo 'APT::Architecture "${DPKG_ARCH}";' > ${D}${sysconfdir}/apt/apt.conf
 }
-- 
2.7.4



^ permalink raw reply related

* [PATCH 15/33] apt: merge with apt-native
From: Andreas Oberritter @ 2016-12-06 11:49 UTC (permalink / raw)
  To: openembedded-core
In-Reply-To: <1481024991-5882-1-git-send-email-obi@opendreambox.org>

Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
---
 meta/recipes-devtools/apt/apt-native_1.2.12.bb | 50 --------------------------
 meta/recipes-devtools/apt/apt.inc              |  3 ++
 meta/recipes-devtools/apt/apt_1.2.12.bb        | 11 ++++++
 3 files changed, 14 insertions(+), 50 deletions(-)
 delete mode 100644 meta/recipes-devtools/apt/apt-native_1.2.12.bb

diff --git a/meta/recipes-devtools/apt/apt-native_1.2.12.bb b/meta/recipes-devtools/apt/apt-native_1.2.12.bb
deleted file mode 100644
index 8d32ef9..0000000
--- a/meta/recipes-devtools/apt/apt-native_1.2.12.bb
+++ /dev/null
@@ -1,50 +0,0 @@
-require apt.inc
-inherit native
-
-DEPENDS += "dpkg-native gettext-native db-native curl-native xz-native"
-PACKAGES = ""
-USE_NLS = "yes"
-
-SRC_URI += "file://0001-remove-Wsuggest-attribute-from-CFLAGS.patch \
-            file://0001-fix-the-gcc-version-check.patch \
-            file://apt.conf.in \
-"
-
-do_install() {
-	install -d ${D}${bindir}
-	install -m 0755 bin/apt-cdrom ${D}${bindir}/
-	install -m 0755 bin/apt-get ${D}${bindir}/
-	install -m 0755 bin/apt-config ${D}${bindir}/
-	install -m 0755 bin/apt-cache ${D}${bindir}/
-	install -m 0755 bin/apt-sortpkgs ${D}${bindir}/
-	install -m 0755 bin/apt-extracttemplates ${D}${bindir}/
-	install -m 0755 bin/apt-ftparchive ${D}${bindir}/
-
-	oe_libinstall -so -C bin libapt-private ${D}${libdir}/
-
-	oe_libinstall -so -C bin libapt-pkg$GLIBC_VER$LIBSTDCPP_VER ${D}${libdir}/
-	oe_libinstall -so -C bin libapt-inst$GLIBC_VER$LIBSTDCPP_VER ${D}${libdir}/
-
-	install -d ${D}${libdir}/apt/methods
-	install -m 0755 bin/methods/* ${D}${libdir}/apt/methods/
-
-	install -d ${D}${libdir}/dpkg/methods/apt
-	install -m 0644 ${S}/dselect/desc.apt ${D}${libdir}/dpkg/methods/apt/ 
-	install -m 0644 ${S}/dselect/names ${D}${libdir}/dpkg/methods/apt/ 
-	install -m 0755 ${S}/dselect/install ${D}${libdir}/dpkg/methods/apt/ 
-	install -m 0755 ${S}/dselect/setup ${D}${libdir}/dpkg/methods/apt/ 
-	install -m 0755 ${S}/dselect/update ${D}${libdir}/dpkg/methods/apt/ 
-
-	install -d ${D}${sysconfdir}/apt
-	install -d ${D}${sysconfdir}/apt/apt.conf.d
-	install -d ${D}${sysconfdir}/apt/preferences.d
-	install -d ${D}${localstatedir}/lib/apt/lists/partial
-	install -d ${D}${localstatedir}/cache/apt/archives/partial
-
-	install -d ${D}${localstatedir}/log/apt/
-
-	sed -e "s,@STAGING_DIR_NATIVE@,${STAGING_DIR_NATIVE},g" \
-	    -e "s,@STAGING_BINDIR_NATIVE@,${STAGING_BINDIR_NATIVE},g" \
-	    -e "s,@STAGING_LIBDIR@,${STAGING_LIBDIR},g" \
-	    < ${WORKDIR}/apt.conf.in > ${D}${sysconfdir}/apt/apt.conf.sample
-}
diff --git a/meta/recipes-devtools/apt/apt.inc b/meta/recipes-devtools/apt/apt.inc
index 3026370..1488664 100644
--- a/meta/recipes-devtools/apt/apt.inc
+++ b/meta/recipes-devtools/apt/apt.inc
@@ -13,6 +13,9 @@ SRC_URI = "http://snapshot.debian.org/archive/debian/20160526T162943Z/pool/main/
            file://disable-test.patch \
            file://0001-environment.mak-musl-based-systems-can-generate-shar.patch \
            file://0001-apt-1.2.12-Fix-musl-build.patch \
+           file://0001-remove-Wsuggest-attribute-from-CFLAGS.patch \
+           file://0001-fix-the-gcc-version-check.patch \
+           file://apt.conf.in \
            "
 SRC_URI[md5sum] = "80f6f0ef110a45a7e5af8a9d233fb0e7"
 SRC_URI[sha256sum] = "e820d27cba73476df4abcff27dadd1b5847474bfe85f7e9202a9a07526973ea6"
diff --git a/meta/recipes-devtools/apt/apt_1.2.12.bb b/meta/recipes-devtools/apt/apt_1.2.12.bb
index 20c7cb4..f09dfc8 100644
--- a/meta/recipes-devtools/apt/apt_1.2.12.bb
+++ b/meta/recipes-devtools/apt/apt_1.2.12.bb
@@ -2,6 +2,8 @@ DEPENDS = "curl db zlib"
 RDEPENDS_${PN} = "dpkg bash debianutils"
 require apt.inc
 
+USE_NLS_class-native = "yes"
+
 PACKAGES =+ "${PN}-utils"
 FILES_${PN} += "${libdir}/dpkg"
 FILES_${PN}-utils = "${bindir}/apt-extracttemplates \
@@ -60,7 +62,16 @@ PACKAGECONFIG[lzma] = "ac_cv_lib_lzma_lzma_easy_encoder=yes,ac_cv_lib_lzma_lzma_
 PACKAGECONFIG[bz2] = "ac_cv_lib_bz2_BZ2_bzopen=yes,ac_cv_lib_bz2_BZ2_bzopen=no,bzip2"
 PACKAGECONFIG[lz4] = "ac_cv_lib_lz4_LZ4F_createCompressionContext=yes,ac_cv_lib_lz4_LZ4F_createCompressionContext=no,lz4"
 
+do_install_append_class-native() {
+    sed -e "s,@STAGING_DIR_NATIVE@,${STAGING_DIR_NATIVE},g" \
+        -e "s,@STAGING_BINDIR_NATIVE@,${STAGING_BINDIR_NATIVE},g" \
+        -e "s,@STAGING_LIBDIR@,${STAGING_LIBDIR},g" \
+        < ${WORKDIR}/apt.conf.in > ${D}${sysconfdir}/apt/apt.conf.sample
+}
+
 do_install_append_class-target() {
     #Write the correct apt-architecture to apt.conf
     echo 'APT::Architecture "${DPKG_ARCH}";' > ${D}${sysconfdir}/apt/apt.conf
 }
+
+BBCLASSEXTEND = "native"
-- 
2.7.4



^ permalink raw reply related

* [PATCH 18/33] apt: more fine-grained packaging
From: Andreas Oberritter @ 2016-12-06 11:49 UTC (permalink / raw)
  To: openembedded-core
In-Reply-To: <1481024991-5882-1-git-send-email-obi@opendreambox.org>

Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
---
 meta/recipes-devtools/apt/apt_1.2.12.bb | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-devtools/apt/apt_1.2.12.bb b/meta/recipes-devtools/apt/apt_1.2.12.bb
index a350b36..2c4f11d 100644
--- a/meta/recipes-devtools/apt/apt_1.2.12.bb
+++ b/meta/recipes-devtools/apt/apt_1.2.12.bb
@@ -104,13 +104,18 @@ do_install_append_class-target() {
     echo 'APT::Architecture "${DPKG_ARCH}";' > ${D}${sysconfdir}/apt/apt.conf
 }
 
-PACKAGES =+ "${PN}-utils"
+PACKAGES =+ "${PN}-dselect ${PN}-transport-https ${PN}-utils lib${PN}-inst lib${PN}-pkg"
 
-RDEPENDS_${PN} = "dpkg bash debianutils"
+RDEPENDS_${PN} = "dpkg debianutils"
+RDEPENDS_${PN}-dselect = "bash"
 
 FILES_${PN} += "${libdir}/dpkg"
+FILES_${PN}-dselect = "${libdir}/dpkg/methods/apt"
+FILES_${PN}-transport-https = "${libdir}/apt/methods/https"
 FILES_${PN}-utils = "${bindir}/apt-extracttemplates \
                      ${bindir}/apt-ftparchive \
                      ${bindir}/apt-sortpkgs"
+FILES_lib${PN}-inst = "${libdir}/libapt-inst${SOLIBS}"
+FILES_lib${PN}-pkg = "${libdir}/libapt-pkg${SOLIBS}"
 
 BBCLASSEXTEND = "native"
-- 
2.7.4



^ permalink raw reply related

* [PATCH 12/33] apt: use default packaging rules for -dev package
From: Andreas Oberritter @ 2016-12-06 11:49 UTC (permalink / raw)
  To: openembedded-core
In-Reply-To: <1481024991-5882-1-git-send-email-obi@opendreambox.org>

Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
---
 meta/recipes-devtools/apt/apt_1.2.12.bb | 1 -
 1 file changed, 1 deletion(-)

diff --git a/meta/recipes-devtools/apt/apt_1.2.12.bb b/meta/recipes-devtools/apt/apt_1.2.12.bb
index ec93eb8..c531a49 100644
--- a/meta/recipes-devtools/apt/apt_1.2.12.bb
+++ b/meta/recipes-devtools/apt/apt_1.2.12.bb
@@ -5,7 +5,6 @@ require apt.inc
 PACKAGES =+ "${PN}-utils"
 FILES_${PN} += "${libdir}/dpkg"
 FILES_${PN}-utils = "${bindir}/apt-sortpkgs ${bindir}/apt-extracttemplates"
-FILES_${PN}-dev = "${libdir}/libapt*.so ${includedir}"
 
 do_install () {
 	set -x
-- 
2.7.4



^ permalink raw reply related

* [PATCH 10/33] apt: use default packaging rules for manpages
From: Andreas Oberritter @ 2016-12-06 11:49 UTC (permalink / raw)
  To: openembedded-core
In-Reply-To: <1481024991-5882-1-git-send-email-obi@opendreambox.org>

Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
---
 meta/recipes-devtools/apt/apt_1.2.12.bb | 35 +--------------------------------
 1 file changed, 1 insertion(+), 34 deletions(-)

diff --git a/meta/recipes-devtools/apt/apt_1.2.12.bb b/meta/recipes-devtools/apt/apt_1.2.12.bb
index 3efa14e..ba49571 100644
--- a/meta/recipes-devtools/apt/apt_1.2.12.bb
+++ b/meta/recipes-devtools/apt/apt_1.2.12.bb
@@ -2,45 +2,13 @@ DEPENDS = "curl db zlib"
 RDEPENDS_${PN} = "dpkg bash debianutils"
 require apt.inc
 
-apt-manpages="doc/apt-cache.8 \
-	      doc/apt-cdrom.8 \
-	      doc/apt-config.8 \
-	      doc/apt-get.8 \
-	      doc/apt.8 \
-	      doc/apt.conf.5 \
-	      doc/apt_preferences.5 \
-	      doc/sources.list.5"
-apt-utils-manpages="doc/apt-extracttemplates.1 \
-		    doc/apt-sortpkgs.1"
-
-def get_files_apt_doc(d, bb, manpages):
-    import re
-    manpages = re.sub(r'\bdoc/(\S+)/(\S+)\.\1\.(.)\b', r'${mandir}/\1/man\3/\2.\3', manpages)
-    manpages = re.sub(r'\bdoc/(\S+)\.(.)\b', r'${mandir}/man\2/\1.\2', manpages)
-    return manpages
-
-def get_commands_apt_doc(d, bb, manpages):
-    s = list()
-    __dir_cache__ = list()
-    for m in manpages.split():
-        dest = get_files_apt_doc(d, bb, m)
-        dir = os.path.dirname(dest)
-        if not dir in __dir_cache__:
-            s.append("install -d ${D}/%s" % dir)
-            __dir_cache__.append(dir)
-        s.append("install -m 0644 %s ${D}/%s" % (m, dest))
-    return "\n".join(s)
-
-PACKAGES += "${PN}-utils ${PN}-utils-doc"
+PACKAGES += "${PN}-utils"
 FILES_${PN} = "${bindir}/apt-cdrom ${bindir}/apt-get \
 	       ${bindir}/apt-config ${bindir}/apt-cache \
 	       ${libdir}/apt ${libdir}/libapt*.so.* \
 	       ${localstatedir} ${sysconfdir} \
 	       ${libdir}/dpkg"
 FILES_${PN}-utils = "${bindir}/apt-sortpkgs ${bindir}/apt-extracttemplates"
-FILES_${PN}-doc = "${@get_files_apt_doc(d, bb, d.getVar('apt-manpages', True))} \
-		   ${docdir}/apt"
-FILES_${PN}-utils-doc = "${@get_files_apt_doc(d, bb, d.getVar('apt-utils-manpages', True))}"
 FILES_${PN}-dev = "${libdir}/libapt*.so ${includedir}"
 
 do_install () {
@@ -87,7 +55,6 @@ PACKAGECONFIG[bz2] = "ac_cv_lib_bz2_BZ2_bzopen=yes,ac_cv_lib_bz2_BZ2_bzopen=no,b
 PACKAGECONFIG[lz4] = "ac_cv_lib_lz4_LZ4F_createCompressionContext=yes,ac_cv_lib_lz4_LZ4F_createCompressionContext=no,lz4"
 
 FILES_${PN} += "${bindir}/apt-key"
-apt-manpages += "doc/apt-key.8"
 
 do_install_append() {
     #Write the correct apt-architecture to apt.conf
-- 
2.7.4



^ permalink raw reply related

* [PATCH 08/33] apt: merge apt-package.inc into .bb
From: Andreas Oberritter @ 2016-12-06 11:49 UTC (permalink / raw)
  To: openembedded-core
In-Reply-To: <1481024991-5882-1-git-send-email-obi@opendreambox.org>

Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
---
 meta/recipes-devtools/apt/apt-package.inc | 78 ------------------------------
 meta/recipes-devtools/apt/apt_1.2.12.bb   | 79 ++++++++++++++++++++++++++++++-
 2 files changed, 78 insertions(+), 79 deletions(-)
 delete mode 100644 meta/recipes-devtools/apt/apt-package.inc

diff --git a/meta/recipes-devtools/apt/apt-package.inc b/meta/recipes-devtools/apt/apt-package.inc
deleted file mode 100644
index a553aa2..0000000
--- a/meta/recipes-devtools/apt/apt-package.inc
+++ /dev/null
@@ -1,78 +0,0 @@
-apt-manpages="doc/apt-cache.8 \
-	      doc/apt-cdrom.8 \
-	      doc/apt-config.8 \
-	      doc/apt-get.8 \
-	      doc/apt.8 \
-	      doc/apt.conf.5 \
-	      doc/apt_preferences.5 \
-	      doc/sources.list.5"
-apt-utils-manpages="doc/apt-extracttemplates.1 \
-		    doc/apt-sortpkgs.1"
-
-def get_files_apt_doc(d, bb, manpages):
-    import re
-    manpages = re.sub(r'\bdoc/(\S+)/(\S+)\.\1\.(.)\b', r'${mandir}/\1/man\3/\2.\3', manpages)
-    manpages = re.sub(r'\bdoc/(\S+)\.(.)\b', r'${mandir}/man\2/\1.\2', manpages)
-    return manpages
-
-def get_commands_apt_doc(d, bb, manpages):
-    s = list()
-    __dir_cache__ = list()
-    for m in manpages.split():
-        dest = get_files_apt_doc(d, bb, m)
-        dir = os.path.dirname(dest)
-        if not dir in __dir_cache__:
-            s.append("install -d ${D}/%s" % dir)
-            __dir_cache__.append(dir)
-        s.append("install -m 0644 %s ${D}/%s" % (m, dest))
-    return "\n".join(s)
-
-PACKAGES += "${PN}-utils ${PN}-utils-doc"
-FILES_${PN} = "${bindir}/apt-cdrom ${bindir}/apt-get \
-	       ${bindir}/apt-config ${bindir}/apt-cache \
-	       ${libdir}/apt ${libdir}/libapt*.so.* \
-	       ${localstatedir} ${sysconfdir} \
-	       ${libdir}/dpkg"
-FILES_${PN}-utils = "${bindir}/apt-sortpkgs ${bindir}/apt-extracttemplates"
-FILES_${PN}-doc = "${@get_files_apt_doc(d, bb, d.getVar('apt-manpages', True))} \
-		   ${docdir}/apt"
-FILES_${PN}-utils-doc = "${@get_files_apt_doc(d, bb, d.getVar('apt-utils-manpages', True))}"
-FILES_${PN}-dev = "${libdir}/libapt*.so ${includedir}"
-
-do_install () {
-	set -x
-	install -d ${D}${bindir}
-	install -m 0755 bin/apt-key ${D}${bindir}/
-	install -m 0755 bin/apt-cdrom ${D}${bindir}/
-	install -m 0755 bin/apt-get ${D}${bindir}/
-	install -m 0755 bin/apt-config ${D}${bindir}/
-	install -m 0755 bin/apt-cache ${D}${bindir}/
-
-	install -m 0755 bin/apt-sortpkgs ${D}${bindir}/
-	install -m 0755 bin/apt-extracttemplates ${D}${bindir}/
-
-	oe_libinstall -so -C bin libapt-pkg ${D}${libdir}
-	oe_libinstall -so -C bin libapt-inst ${D}${libdir}
-
-	install -d ${D}${libdir}/apt/methods
-	install -m 0755 bin/methods/* ${D}${libdir}/apt/methods/
-
-	install -d ${D}${libdir}/dpkg/methods/apt
-	install -m 0644 ${S}/dselect/desc.apt ${D}${libdir}/dpkg/methods/apt/ 
-	install -m 0644 ${S}/dselect/names ${D}${libdir}/dpkg/methods/apt/ 
-	install -m 0755 ${S}/dselect/install ${D}${libdir}/dpkg/methods/apt/ 
-	install -m 0755 ${S}/dselect/setup ${D}${libdir}/dpkg/methods/apt/ 
-	install -m 0755 ${S}/dselect/update ${D}${libdir}/dpkg/methods/apt/ 
-
-	install -d ${D}${sysconfdir}/apt
-	install -d ${D}${sysconfdir}/apt/apt.conf.d
-	install -d ${D}${sysconfdir}/apt/sources.list.d
-	install -d ${D}${sysconfdir}/apt/preferences.d
-	install -d ${D}${localstatedir}/lib/apt/lists/partial
-	install -d ${D}${localstatedir}/cache/apt/archives/partial
-	install -d ${D}${docdir}/apt/examples
-	install -m 0644 ${S}/doc/examples/* ${D}${docdir}/apt/examples/
-
-	install -d ${D}${includedir}/apt-pkg/
-	install -m 0644 include/apt-pkg/*.h ${D}${includedir}/apt-pkg/
-}
diff --git a/meta/recipes-devtools/apt/apt_1.2.12.bb b/meta/recipes-devtools/apt/apt_1.2.12.bb
index ae0bce9..3efa14e 100644
--- a/meta/recipes-devtools/apt/apt_1.2.12.bb
+++ b/meta/recipes-devtools/apt/apt_1.2.12.bb
@@ -2,7 +2,84 @@ DEPENDS = "curl db zlib"
 RDEPENDS_${PN} = "dpkg bash debianutils"
 require apt.inc
 
-require apt-package.inc
+apt-manpages="doc/apt-cache.8 \
+	      doc/apt-cdrom.8 \
+	      doc/apt-config.8 \
+	      doc/apt-get.8 \
+	      doc/apt.8 \
+	      doc/apt.conf.5 \
+	      doc/apt_preferences.5 \
+	      doc/sources.list.5"
+apt-utils-manpages="doc/apt-extracttemplates.1 \
+		    doc/apt-sortpkgs.1"
+
+def get_files_apt_doc(d, bb, manpages):
+    import re
+    manpages = re.sub(r'\bdoc/(\S+)/(\S+)\.\1\.(.)\b', r'${mandir}/\1/man\3/\2.\3', manpages)
+    manpages = re.sub(r'\bdoc/(\S+)\.(.)\b', r'${mandir}/man\2/\1.\2', manpages)
+    return manpages
+
+def get_commands_apt_doc(d, bb, manpages):
+    s = list()
+    __dir_cache__ = list()
+    for m in manpages.split():
+        dest = get_files_apt_doc(d, bb, m)
+        dir = os.path.dirname(dest)
+        if not dir in __dir_cache__:
+            s.append("install -d ${D}/%s" % dir)
+            __dir_cache__.append(dir)
+        s.append("install -m 0644 %s ${D}/%s" % (m, dest))
+    return "\n".join(s)
+
+PACKAGES += "${PN}-utils ${PN}-utils-doc"
+FILES_${PN} = "${bindir}/apt-cdrom ${bindir}/apt-get \
+	       ${bindir}/apt-config ${bindir}/apt-cache \
+	       ${libdir}/apt ${libdir}/libapt*.so.* \
+	       ${localstatedir} ${sysconfdir} \
+	       ${libdir}/dpkg"
+FILES_${PN}-utils = "${bindir}/apt-sortpkgs ${bindir}/apt-extracttemplates"
+FILES_${PN}-doc = "${@get_files_apt_doc(d, bb, d.getVar('apt-manpages', True))} \
+		   ${docdir}/apt"
+FILES_${PN}-utils-doc = "${@get_files_apt_doc(d, bb, d.getVar('apt-utils-manpages', True))}"
+FILES_${PN}-dev = "${libdir}/libapt*.so ${includedir}"
+
+do_install () {
+	set -x
+	install -d ${D}${bindir}
+	install -m 0755 bin/apt-key ${D}${bindir}/
+	install -m 0755 bin/apt-cdrom ${D}${bindir}/
+	install -m 0755 bin/apt-get ${D}${bindir}/
+	install -m 0755 bin/apt-config ${D}${bindir}/
+	install -m 0755 bin/apt-cache ${D}${bindir}/
+
+	install -m 0755 bin/apt-sortpkgs ${D}${bindir}/
+	install -m 0755 bin/apt-extracttemplates ${D}${bindir}/
+
+	oe_libinstall -so -C bin libapt-pkg ${D}${libdir}
+	oe_libinstall -so -C bin libapt-inst ${D}${libdir}
+
+	install -d ${D}${libdir}/apt/methods
+	install -m 0755 bin/methods/* ${D}${libdir}/apt/methods/
+
+	install -d ${D}${libdir}/dpkg/methods/apt
+	install -m 0644 ${S}/dselect/desc.apt ${D}${libdir}/dpkg/methods/apt/ 
+	install -m 0644 ${S}/dselect/names ${D}${libdir}/dpkg/methods/apt/ 
+	install -m 0755 ${S}/dselect/install ${D}${libdir}/dpkg/methods/apt/ 
+	install -m 0755 ${S}/dselect/setup ${D}${libdir}/dpkg/methods/apt/ 
+	install -m 0755 ${S}/dselect/update ${D}${libdir}/dpkg/methods/apt/ 
+
+	install -d ${D}${sysconfdir}/apt
+	install -d ${D}${sysconfdir}/apt/apt.conf.d
+	install -d ${D}${sysconfdir}/apt/sources.list.d
+	install -d ${D}${sysconfdir}/apt/preferences.d
+	install -d ${D}${localstatedir}/lib/apt/lists/partial
+	install -d ${D}${localstatedir}/cache/apt/archives/partial
+	install -d ${D}${docdir}/apt/examples
+	install -m 0644 ${S}/doc/examples/* ${D}${docdir}/apt/examples/
+
+	install -d ${D}${includedir}/apt-pkg/
+	install -m 0644 include/apt-pkg/*.h ${D}${includedir}/apt-pkg/
+}
 
 PACKAGECONFIG ??= "lzma"
 PACKAGECONFIG[lzma] = "ac_cv_lib_lzma_lzma_easy_encoder=yes,ac_cv_lib_lzma_lzma_easy_encoder=no,xz"
-- 
2.7.4



^ permalink raw reply related

* [PATCH 11/33] apt: use default packaging rules for base package, prepend apt-utils
From: Andreas Oberritter @ 2016-12-06 11:49 UTC (permalink / raw)
  To: openembedded-core
In-Reply-To: <1481024991-5882-1-git-send-email-obi@opendreambox.org>

Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
---
 meta/recipes-devtools/apt/apt_1.2.12.bb | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/meta/recipes-devtools/apt/apt_1.2.12.bb b/meta/recipes-devtools/apt/apt_1.2.12.bb
index ba49571..ec93eb8 100644
--- a/meta/recipes-devtools/apt/apt_1.2.12.bb
+++ b/meta/recipes-devtools/apt/apt_1.2.12.bb
@@ -2,12 +2,8 @@ DEPENDS = "curl db zlib"
 RDEPENDS_${PN} = "dpkg bash debianutils"
 require apt.inc
 
-PACKAGES += "${PN}-utils"
-FILES_${PN} = "${bindir}/apt-cdrom ${bindir}/apt-get \
-	       ${bindir}/apt-config ${bindir}/apt-cache \
-	       ${libdir}/apt ${libdir}/libapt*.so.* \
-	       ${localstatedir} ${sysconfdir} \
-	       ${libdir}/dpkg"
+PACKAGES =+ "${PN}-utils"
+FILES_${PN} += "${libdir}/dpkg"
 FILES_${PN}-utils = "${bindir}/apt-sortpkgs ${bindir}/apt-extracttemplates"
 FILES_${PN}-dev = "${libdir}/libapt*.so ${includedir}"
 
@@ -54,8 +50,6 @@ PACKAGECONFIG[lzma] = "ac_cv_lib_lzma_lzma_easy_encoder=yes,ac_cv_lib_lzma_lzma_
 PACKAGECONFIG[bz2] = "ac_cv_lib_bz2_BZ2_bzopen=yes,ac_cv_lib_bz2_BZ2_bzopen=no,bzip2"
 PACKAGECONFIG[lz4] = "ac_cv_lib_lz4_LZ4F_createCompressionContext=yes,ac_cv_lib_lz4_LZ4F_createCompressionContext=no,lz4"
 
-FILES_${PN} += "${bindir}/apt-key"
-
 do_install_append() {
     #Write the correct apt-architecture to apt.conf
     APT_CONF=${D}/etc/apt/apt.conf
-- 
2.7.4



^ permalink raw reply related

* [PATCH 07/33] apt-native: merge apt-native.inc into .bb
From: Andreas Oberritter @ 2016-12-06 11:49 UTC (permalink / raw)
  To: openembedded-core
In-Reply-To: <1481024991-5882-1-git-send-email-obi@opendreambox.org>

Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
---
 meta/recipes-devtools/apt/apt-native.inc       | 70 ------------------------
 meta/recipes-devtools/apt/apt-native_1.2.12.bb | 74 ++++++++++++++++++++++++--
 2 files changed, 71 insertions(+), 73 deletions(-)
 delete mode 100644 meta/recipes-devtools/apt/apt-native.inc

diff --git a/meta/recipes-devtools/apt/apt-native.inc b/meta/recipes-devtools/apt/apt-native.inc
deleted file mode 100644
index 9fa206e..0000000
--- a/meta/recipes-devtools/apt/apt-native.inc
+++ /dev/null
@@ -1,70 +0,0 @@
-require apt.inc
-inherit native
-
-DEPENDS += "dpkg-native gettext-native db-native curl-native xz-native"
-PACKAGES = ""
-USE_NLS = "yes"
-
-SRC_URI += "file://db_linking_hack.patch \
-            file://0001-Revert-always-run-dpkg-configure-a-at-the-end-of-our.patch \
-            file://0001-remove-Wsuggest-attribute-from-CFLAGS.patch \
-            file://0001-fix-the-gcc-version-check.patch \
-"
-
-python do_install () {
-    bb.build.exec_func('do_install_base', d)
-    bb.build.exec_func('do_install_config', d)
-}
-
-python do_install_config () {
-    indir = os.path.dirname(d.getVar('FILE', True))
-    infile = open(oe.path.join(indir, 'files', 'apt.conf'), 'r')
-    data = infile.read()
-    infile.close()
-
-    data = d.expand(data)
-
-    outdir = oe.path.join(d.getVar('D', True), d.getVar('sysconfdir', True), 'apt')
-    if not os.path.exists(outdir):
-        os.makedirs(outdir)
-
-    outpath = oe.path.join(outdir, 'apt.conf.sample')
-    if not os.path.exists(outpath):
-        outfile = open(outpath, 'w')
-        outfile.write(data)
-        outfile.close()
-}
-
-do_install_base () {
-	install -d ${D}${bindir}
-	install -m 0755 bin/apt-cdrom ${D}${bindir}/
-	install -m 0755 bin/apt-get ${D}${bindir}/
-	install -m 0755 bin/apt-config ${D}${bindir}/
-	install -m 0755 bin/apt-cache ${D}${bindir}/
-	install -m 0755 bin/apt-sortpkgs ${D}${bindir}/
-	install -m 0755 bin/apt-extracttemplates ${D}${bindir}/
-	install -m 0755 bin/apt-ftparchive ${D}${bindir}/
-
-	oe_libinstall -so -C bin libapt-private ${D}${libdir}/
-
-	oe_libinstall -so -C bin libapt-pkg$GLIBC_VER$LIBSTDCPP_VER ${D}${libdir}/
-	oe_libinstall -so -C bin libapt-inst$GLIBC_VER$LIBSTDCPP_VER ${D}${libdir}/
-
-	install -d ${D}${libdir}/apt/methods
-	install -m 0755 bin/methods/* ${D}${libdir}/apt/methods/
-
-	install -d ${D}${libdir}/dpkg/methods/apt
-	install -m 0644 ${S}/dselect/desc.apt ${D}${libdir}/dpkg/methods/apt/ 
-	install -m 0644 ${S}/dselect/names ${D}${libdir}/dpkg/methods/apt/ 
-	install -m 0755 ${S}/dselect/install ${D}${libdir}/dpkg/methods/apt/ 
-	install -m 0755 ${S}/dselect/setup ${D}${libdir}/dpkg/methods/apt/ 
-	install -m 0755 ${S}/dselect/update ${D}${libdir}/dpkg/methods/apt/ 
-
-	install -d ${D}${sysconfdir}/apt
-	install -d ${D}${sysconfdir}/apt/apt.conf.d
-	install -d ${D}${sysconfdir}/apt/preferences.d
-	install -d ${D}${localstatedir}/lib/apt/lists/partial
-	install -d ${D}${localstatedir}/cache/apt/archives/partial
-
-	install -d ${D}${localstatedir}/log/apt/
-}
diff --git a/meta/recipes-devtools/apt/apt-native_1.2.12.bb b/meta/recipes-devtools/apt/apt-native_1.2.12.bb
index 1e660da..0edceeb 100644
--- a/meta/recipes-devtools/apt/apt-native_1.2.12.bb
+++ b/meta/recipes-devtools/apt/apt-native_1.2.12.bb
@@ -1,4 +1,72 @@
-require apt-native.inc
+require apt.inc
+inherit native
 
-SRC_URI += "file://noconfigure.patch \
-            file://no-curl.patch"
+DEPENDS += "dpkg-native gettext-native db-native curl-native xz-native"
+PACKAGES = ""
+USE_NLS = "yes"
+
+SRC_URI += "file://db_linking_hack.patch \
+            file://0001-Revert-always-run-dpkg-configure-a-at-the-end-of-our.patch \
+            file://0001-remove-Wsuggest-attribute-from-CFLAGS.patch \
+            file://0001-fix-the-gcc-version-check.patch \
+            file://noconfigure.patch \
+            file://no-curl.patch \
+"
+
+python do_install () {
+    bb.build.exec_func('do_install_base', d)
+    bb.build.exec_func('do_install_config', d)
+}
+
+python do_install_config () {
+    indir = os.path.dirname(d.getVar('FILE', True))
+    infile = open(oe.path.join(indir, 'files', 'apt.conf'), 'r')
+    data = infile.read()
+    infile.close()
+
+    data = d.expand(data)
+
+    outdir = oe.path.join(d.getVar('D', True), d.getVar('sysconfdir', True), 'apt')
+    if not os.path.exists(outdir):
+        os.makedirs(outdir)
+
+    outpath = oe.path.join(outdir, 'apt.conf.sample')
+    if not os.path.exists(outpath):
+        outfile = open(outpath, 'w')
+        outfile.write(data)
+        outfile.close()
+}
+
+do_install_base () {
+	install -d ${D}${bindir}
+	install -m 0755 bin/apt-cdrom ${D}${bindir}/
+	install -m 0755 bin/apt-get ${D}${bindir}/
+	install -m 0755 bin/apt-config ${D}${bindir}/
+	install -m 0755 bin/apt-cache ${D}${bindir}/
+	install -m 0755 bin/apt-sortpkgs ${D}${bindir}/
+	install -m 0755 bin/apt-extracttemplates ${D}${bindir}/
+	install -m 0755 bin/apt-ftparchive ${D}${bindir}/
+
+	oe_libinstall -so -C bin libapt-private ${D}${libdir}/
+
+	oe_libinstall -so -C bin libapt-pkg$GLIBC_VER$LIBSTDCPP_VER ${D}${libdir}/
+	oe_libinstall -so -C bin libapt-inst$GLIBC_VER$LIBSTDCPP_VER ${D}${libdir}/
+
+	install -d ${D}${libdir}/apt/methods
+	install -m 0755 bin/methods/* ${D}${libdir}/apt/methods/
+
+	install -d ${D}${libdir}/dpkg/methods/apt
+	install -m 0644 ${S}/dselect/desc.apt ${D}${libdir}/dpkg/methods/apt/ 
+	install -m 0644 ${S}/dselect/names ${D}${libdir}/dpkg/methods/apt/ 
+	install -m 0755 ${S}/dselect/install ${D}${libdir}/dpkg/methods/apt/ 
+	install -m 0755 ${S}/dselect/setup ${D}${libdir}/dpkg/methods/apt/ 
+	install -m 0755 ${S}/dselect/update ${D}${libdir}/dpkg/methods/apt/ 
+
+	install -d ${D}${sysconfdir}/apt
+	install -d ${D}${sysconfdir}/apt/apt.conf.d
+	install -d ${D}${sysconfdir}/apt/preferences.d
+	install -d ${D}${localstatedir}/lib/apt/lists/partial
+	install -d ${D}${localstatedir}/cache/apt/archives/partial
+
+	install -d ${D}${localstatedir}/log/apt/
+}
-- 
2.7.4



^ permalink raw reply related

* [PATCH 09/33] apt-native: use sed to prepare apt.conf.sample
From: Andreas Oberritter @ 2016-12-06 11:49 UTC (permalink / raw)
  To: openembedded-core
In-Reply-To: <1481024991-5882-1-git-send-email-obi@opendreambox.org>

Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
---
 meta/recipes-devtools/apt/apt-native_1.2.12.bb     | 32 +++++-----------------
 .../apt/{files/apt.conf => apt/apt.conf.in}        |  6 ++--
 2 files changed, 10 insertions(+), 28 deletions(-)
 rename meta/recipes-devtools/apt/{files/apt.conf => apt/apt.conf.in} (87%)

diff --git a/meta/recipes-devtools/apt/apt-native_1.2.12.bb b/meta/recipes-devtools/apt/apt-native_1.2.12.bb
index 0edceeb..695e21d 100644
--- a/meta/recipes-devtools/apt/apt-native_1.2.12.bb
+++ b/meta/recipes-devtools/apt/apt-native_1.2.12.bb
@@ -11,33 +11,10 @@ SRC_URI += "file://db_linking_hack.patch \
             file://0001-fix-the-gcc-version-check.patch \
             file://noconfigure.patch \
             file://no-curl.patch \
+            file://apt.conf.in \
 "
 
-python do_install () {
-    bb.build.exec_func('do_install_base', d)
-    bb.build.exec_func('do_install_config', d)
-}
-
-python do_install_config () {
-    indir = os.path.dirname(d.getVar('FILE', True))
-    infile = open(oe.path.join(indir, 'files', 'apt.conf'), 'r')
-    data = infile.read()
-    infile.close()
-
-    data = d.expand(data)
-
-    outdir = oe.path.join(d.getVar('D', True), d.getVar('sysconfdir', True), 'apt')
-    if not os.path.exists(outdir):
-        os.makedirs(outdir)
-
-    outpath = oe.path.join(outdir, 'apt.conf.sample')
-    if not os.path.exists(outpath):
-        outfile = open(outpath, 'w')
-        outfile.write(data)
-        outfile.close()
-}
-
-do_install_base () {
+do_install() {
 	install -d ${D}${bindir}
 	install -m 0755 bin/apt-cdrom ${D}${bindir}/
 	install -m 0755 bin/apt-get ${D}${bindir}/
@@ -69,4 +46,9 @@ do_install_base () {
 	install -d ${D}${localstatedir}/cache/apt/archives/partial
 
 	install -d ${D}${localstatedir}/log/apt/
+
+	sed -e "s,@STAGING_DIR_NATIVE@,${STAGING_DIR_NATIVE},g" \
+	    -e "s,@STAGING_BINDIR_NATIVE@,${STAGING_BINDIR_NATIVE},g" \
+	    -e "s,@STAGING_LIBDIR@,${STAGING_LIBDIR},g" \
+	    < ${WORKDIR}/apt.conf.in > ${D}${sysconfdir}/apt/apt.conf.sample
 }
diff --git a/meta/recipes-devtools/apt/files/apt.conf b/meta/recipes-devtools/apt/apt/apt.conf.in
similarity index 87%
rename from meta/recipes-devtools/apt/files/apt.conf
rename to meta/recipes-devtools/apt/apt/apt.conf.in
index 9ad61cc..6fc1326 100644
--- a/meta/recipes-devtools/apt/files/apt.conf
+++ b/meta/recipes-devtools/apt/apt/apt.conf.in
@@ -1,4 +1,4 @@
-Dir "${STAGING_DIR_NATIVE}/"
+Dir "@STAGING_DIR_NATIVE@/"
 {
    State "var/lib/apt/"
    {
@@ -11,9 +11,9 @@ Dir "${STAGING_DIR_NATIVE}/"
       pkgcache "";
       srcpkgcache "";
    };
-   Bin "${STAGING_BINDIR_NATIVE}/"
+   Bin "@STAGING_BINDIR_NATIVE@/"
    {
-      methods "${STAGING_LIBDIR}/apt/methods/";
+      methods "@STAGING_LIBDIR@/apt/methods/";
       gzip "/bin/gzip";
       dpkg "dpkg";
       dpkg-source "dpkg-source";
-- 
2.7.4



^ permalink raw reply related

* [PATCH 04/33] apt-native: Use option --force-script-chrootless for rootfs
From: Andreas Oberritter @ 2016-12-06 11:49 UTC (permalink / raw)
  To: openembedded-core
In-Reply-To: <1481024991-5882-1-git-send-email-obi@opendreambox.org>

Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
---
 meta/recipes-devtools/apt/files/apt.conf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-devtools/apt/files/apt.conf b/meta/recipes-devtools/apt/files/apt.conf
index 0335135..9ad61cc 100644
--- a/meta/recipes-devtools/apt/files/apt.conf
+++ b/meta/recipes-devtools/apt/files/apt.conf
@@ -39,4 +39,4 @@ APT
   };
 };
 
-DPkg::Options {"--root=#ROOTFS#";"--admindir=#ROOTFS#/var/lib/dpkg";"--force-all";"--no-debsig"};
+DPkg::Options {"--root=#ROOTFS#";"--admindir=#ROOTFS#/var/lib/dpkg";"--force-all";"--no-debsig";"--force-script-chrootless"};
-- 
2.7.4



^ permalink raw reply related

* [PATCH 06/33] debianutils: Allow native builds
From: Andreas Oberritter @ 2016-12-06 11:49 UTC (permalink / raw)
  To: openembedded-core
In-Reply-To: <1481024991-5882-1-git-send-email-obi@opendreambox.org>

Apt has a runtime dependency on it.

Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
---
 meta/recipes-support/debianutils/debianutils_4.8.bb | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/meta/recipes-support/debianutils/debianutils_4.8.bb b/meta/recipes-support/debianutils/debianutils_4.8.bb
index d969fd3..cf4f382 100644
--- a/meta/recipes-support/debianutils/debianutils_4.8.bb
+++ b/meta/recipes-support/debianutils/debianutils_4.8.bb
@@ -32,7 +32,7 @@ do_install_append() {
 PACKAGES =+ "${PN}-run-parts"
 FILES_${PN}-run-parts = "${base_bindir}/run-parts.debianutils"
 
-RDEPENDS_${PN} += "${PN}-run-parts"
+RDEPENDS_${PN}_class-target = "${PN}-run-parts"
 
 
 ALTERNATIVE_PRIORITY="30"
@@ -46,3 +46,5 @@ ALTERNATIVE_LINK_NAME[run-parts]="${base_bindir}/run-parts"
 ALTERNATIVE_LINK_NAME[savelog]="${bindir}/savelog"
 ALTERNATIVE_LINK_NAME[tempfile]="${base_bindir}/tempfile"
 ALTERNATIVE_LINK_NAME[which]="${bindir}/which"
+
+BBCLASSEXTEND = "native"
-- 
2.7.4



^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox