All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/33] Accumulated patches for deb packaging
@ 2016-12-06 11:49 Andreas Oberritter
  2016-12-06 11:49 ` [PATCH 01/33] dpkg: implement offline mode for update-alternatives Andreas Oberritter
                   ` (34 more replies)
  0 siblings, 35 replies; 59+ messages in thread
From: Andreas Oberritter @ 2016-12-06 11:49 UTC (permalink / raw)
  To: openembedded-core

These are most of my patches which accumulated since our distro
switched from opkg to dpkg and apt two years ago. They were tested
thoroughly on dora and krogoth and just a little bit on master.

Most importantly, this adds support for Debian's update-alternatives
on rootfs creation time. For this to work, the recently added option
'--force-script-chrootless' must be passed to dpkg.

There's also a patch adding BAD_RECOMMENDATIONS for deb packages.

One patch renames dpkg-start-stop to start-stop-daemon. There's also
a recipe in meta-oe with the same name, which should be removed later.

Andreas Oberritter (33):
  dpkg: implement offline mode for update-alternatives
  dpkg: update-alternatives-dpkg should conflict with other providers
  dpkg-native: hardcode SYSCONFDIR to /etc in update-alternatives
  apt-native: Use option --force-script-chrootless for rootfs
  package_manager/deb: pass option --force-script-chrootless to dpkg
  debianutils: Allow native builds
  apt-native: merge apt-native.inc into .bb
  apt: merge apt-package.inc into .bb
  apt-native: use sed to prepare apt.conf.sample
  apt: use default packaging rules for manpages
  apt: use default packaging rules for base package, prepend apt-utils
  apt: use default packaging rules for -dev package
  apt: rewrite do_install
  apt-native: drop obsolete patches
  apt: merge with apt-native
  apt: merge apt.inc into .bb
  apt: group variables (license, configuration, packaging)
  apt: more fine-grained packaging
  apt: recommend gnupg
  package_manager/deb: let apt-get handle postinst scripts
  package_manager/deb: create Packages.xz
  package_manager/deb: implement BAD_RECOMMENDATIONS
  dpkg: use PACKAGECONFIG
  dpkg: set license field to more common "GPLv2+"
  dpkg: clean-up packaging of start-stop-daemon
  dpkg: remove unneeded do_configure override
  dpkg: simplify replacing perl interpreter in scripts
  dpkg: update packages and files to match Debian more closely
  dpkg: always install dpkg-configure.service
  dpkg: use correct path for perl libraries
  package_deb.bbclass: compress control.tar with the same algorithm as
    data.tar
  apt: fix rpath error during configure
  apt: dselect depends on perl

 meta/classes/package_deb.bbclass                   |   2 +-
 meta/classes/rootfs_deb.bbclass                    |   6 -
 meta/lib/oe/package_manager.py                     | 117 ++----
 meta/lib/oe/rootfs.py                              |   8 +-
 meta/recipes-devtools/apt/apt-native.inc           |  70 ----
 meta/recipes-devtools/apt/apt-native_1.2.12.bb     |   4 -
 meta/recipes-devtools/apt/apt-package.inc          |  78 ----
 meta/recipes-devtools/apt/apt.inc                  |  35 --
 ...ys-run-dpkg-configure-a-at-the-end-of-our.patch | 126 -------
 .../apt/{files/apt.conf => apt/apt.conf.in}        |   8 +-
 meta/recipes-devtools/apt/apt/noconfigure.patch    |  37 --
 meta/recipes-devtools/apt/apt_1.2.12.bb            | 125 ++++++-
 .../apt/files/db_linking_hack.patch                |  29 --
 meta/recipes-devtools/apt/files/environment.patch  |  15 -
 meta/recipes-devtools/apt/files/no-curl.patch      |  54 ---
 meta/recipes-devtools/dpkg/dpkg.inc                | 153 ++++----
 ...tinsts-expect-D-to-be-set-when-running-in.patch |  70 ----
 ...pdate-alternatives-Implement-offline-mode.patch | 399 +++++++++++++++++++++
 meta/recipes-devtools/dpkg/dpkg_1.18.7.bb          |   2 +-
 .../recipes-support/debianutils/debianutils_4.8.bb |   4 +-
 20 files changed, 654 insertions(+), 688 deletions(-)
 delete mode 100644 meta/recipes-devtools/apt/apt-native.inc
 delete mode 100644 meta/recipes-devtools/apt/apt-native_1.2.12.bb
 delete mode 100644 meta/recipes-devtools/apt/apt-package.inc
 delete mode 100644 meta/recipes-devtools/apt/apt.inc
 delete mode 100644 meta/recipes-devtools/apt/apt/0001-Revert-always-run-dpkg-configure-a-at-the-end-of-our.patch
 rename meta/recipes-devtools/apt/{files/apt.conf => apt/apt.conf.in} (80%)
 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
 delete mode 100644 meta/recipes-devtools/dpkg/dpkg/0003-Our-pre-postinsts-expect-D-to-be-set-when-running-in.patch
 create mode 100644 meta/recipes-devtools/dpkg/dpkg/0003-update-alternatives-Implement-offline-mode.patch

-- 
2.7.4



^ permalink raw reply	[flat|nested] 59+ messages in thread

* [PATCH 01/33] dpkg: implement offline mode for update-alternatives
  2016-12-06 11:49 [PATCH 00/33] Accumulated patches for deb packaging Andreas Oberritter
@ 2016-12-06 11:49 ` Andreas Oberritter
  2016-12-06 18:31   ` Burton, Ross
  2016-12-06 11:49 ` [PATCH 02/33] dpkg: update-alternatives-dpkg should conflict with other providers Andreas Oberritter
                   ` (33 subsequent siblings)
  34 siblings, 1 reply; 59+ messages in thread
From: Andreas Oberritter @ 2016-12-06 11:49 UTC (permalink / raw)
  To: openembedded-core

Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
---
 meta/recipes-devtools/dpkg/dpkg.inc                |  12 +-
 ...tinsts-expect-D-to-be-set-when-running-in.patch |  70 ----
 ...pdate-alternatives-Implement-offline-mode.patch | 399 +++++++++++++++++++++
 meta/recipes-devtools/dpkg/dpkg_1.18.7.bb          |   2 +-
 4 files changed, 403 insertions(+), 80 deletions(-)
 delete mode 100644 meta/recipes-devtools/dpkg/dpkg/0003-Our-pre-postinsts-expect-D-to-be-set-when-running-in.patch
 create mode 100644 meta/recipes-devtools/dpkg/dpkg/0003-update-alternatives-Implement-offline-mode.patch

diff --git a/meta/recipes-devtools/dpkg/dpkg.inc b/meta/recipes-devtools/dpkg/dpkg.inc
index e8d8a9b..ec0117b 100644
--- a/meta/recipes-devtools/dpkg/dpkg.inc
+++ b/meta/recipes-devtools/dpkg/dpkg.inc
@@ -1,9 +1,10 @@
 SUMMARY = "Package maintenance system from Debian"
 LICENSE = "GPLv2.0+"
 SECTION = "base"
+PROVIDES = "virtual/update-alternatives"
 
 DEPENDS = "zlib bzip2 perl ncurses"
-DEPENDS_class-native = "bzip2-replacement-native zlib-native virtual/update-alternatives-native gettext-native perl-native"
+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"
 
@@ -43,8 +44,6 @@ do_configure () {
 
 do_install_append () {
 	if [ "${PN}" = "dpkg-native" ]; then
-		# update-alternatives doesn't have an offline mode
-		rm ${D}${bindir}/update-alternatives
 		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-*
@@ -61,14 +60,9 @@ do_install_append () {
 	fi
 }
 
-PROV = "virtual/update-alternatives"
-PROV_class-native = ""
-
-PROVIDES += "${PROV}"
-
 PACKAGES =+ "update-alternatives-dpkg"
 FILES_update-alternatives-dpkg = "${bindir}/update-alternatives ${localstatedir}/lib/dpkg/alternatives ${sysconfdir}/alternatives"
-RPROVIDES_update-alternatives-dpkg += "update-alternatives"
+RPROVIDES_update-alternatives-dpkg = "update-alternatives"
 
 PACKAGES += "${PN}-perl"
 FILES_${PN}-perl = "${libdir}/perl"
diff --git a/meta/recipes-devtools/dpkg/dpkg/0003-Our-pre-postinsts-expect-D-to-be-set-when-running-in.patch b/meta/recipes-devtools/dpkg/dpkg/0003-Our-pre-postinsts-expect-D-to-be-set-when-running-in.patch
deleted file mode 100644
index 80504ce..0000000
--- a/meta/recipes-devtools/dpkg/dpkg/0003-Our-pre-postinsts-expect-D-to-be-set-when-running-in.patch
+++ /dev/null
@@ -1,70 +0,0 @@
-From 24229971492515b64c81e8c6392e5dfbdc22b44c Mon Sep 17 00:00:00 2001
-From: Alexander Kanavin <alex.kanavin@gmail.com>
-Date: Wed, 26 Aug 2015 16:25:45 +0300
-Subject: [PATCH 3/5] Our pre/postinsts expect $D to be set when running in a
- sysroot and don't expect a chroot. This matches up our system expectations
- with what dpkg does.
-
-Upstream-Status: Inappropriate [OE Specific]
-
-RP 2011/12/07
-ALIMON 2016/05/26
-
----
- src/script.c | 39 +++------------------------------------
- 1 file changed, 3 insertions(+), 36 deletions(-)
-
-diff --git a/src/script.c b/src/script.c
-index 3c88be8..ce66a86 100644
---- a/src/script.c
-+++ b/src/script.c
-@@ -97,43 +97,10 @@ setexecute(const char *path, struct stat *stab)
- static const char *
- maintscript_pre_exec(struct command *cmd)
- {
--	const char *admindir = dpkg_db_get_dir();
--	const char *changedir = fc_script_chrootless ? instdir : "/";
--	size_t instdirl = strlen(instdir);
--
--	if (*instdir && !fc_script_chrootless) {
--		if (strncmp(admindir, instdir, instdirl) != 0)
--			ohshit(_("admindir must be inside instdir for dpkg to work properly"));
--		if (setenv("DPKG_ADMINDIR", admindir + instdirl, 1) < 0)
--			ohshite(_("unable to setenv for subprocesses"));
--		if (setenv("DPKG_ROOT", "", 1) < 0)
--			ohshite(_("unable to setenv for subprocesses"));
--
--		if (chroot(instdir))
--			ohshite(_("failed to chroot to '%.250s'"), instdir);
-+	if (*instdir) {
-+		setenv("D", instdir, 1);
- 	}
--	/* Switch to a known good directory to give the maintainer script
--	 * a saner environment, also needed after the chroot(). */
--	if (chdir(changedir))
--		ohshite(_("failed to chdir to '%.255s'"), changedir);
--	if (debug_has_flag(dbg_scripts)) {
--		struct varbuf args = VARBUF_INIT;
--		const char **argv = cmd->argv;
--
--		while (*++argv) {
--			varbuf_add_char(&args, ' ');
--			varbuf_add_str(&args, *argv);
--		}
--		varbuf_end_str(&args);
--		debug(dbg_scripts, "fork/exec %s (%s )", cmd->filename,
--		      args.buf);
--		varbuf_destroy(&args);
--	}
--	if (!instdirl || fc_script_chrootless)
--		return cmd->filename;
--
--	assert(strlen(cmd->filename) >= instdirl);
--	return cmd->filename + instdirl;
-+	return cmd->filename;
- }
- 
- /**
--- 
-2.1.4
-
diff --git a/meta/recipes-devtools/dpkg/dpkg/0003-update-alternatives-Implement-offline-mode.patch b/meta/recipes-devtools/dpkg/dpkg/0003-update-alternatives-Implement-offline-mode.patch
new file mode 100644
index 0000000..ebf4e08
--- /dev/null
+++ b/meta/recipes-devtools/dpkg/dpkg/0003-update-alternatives-Implement-offline-mode.patch
@@ -0,0 +1,399 @@
+From b4f0f6ced469095a2b21ddddb01b59c7aded057e Mon Sep 17 00:00:00 2001
+From: Andreas Oberritter <obi@opendreambox.org>
+Date: Thu, 28 Aug 2014 05:20:21 +0200
+Subject: [PATCH] update-alternatives: Implement offline mode
+
+Lets update-alternatives manage symlinks inside a cross-arch root
+filesystem in a directory specified by DPKG_ROOT.
+
+Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
+---
+ utils/Makefile.am           |   1 +
+ utils/update-alternatives.c | 175 ++++++++++++++++++++++++++++----------------
+ 2 files changed, 114 insertions(+), 62 deletions(-)
+
+diff --git a/utils/Makefile.am b/utils/Makefile.am
+index 83378ad..1f821c5 100644
+--- a/utils/Makefile.am
++++ b/utils/Makefile.am
+@@ -27,6 +27,7 @@ update_alternatives_SOURCES = \
+ update_alternatives_CPPFLAGS = \
+ 	-DALT_TMP_EXT=\".dpkg-tmp\" \
+ 	-DADMINDIR_ENVVAR=\"DPKG_ADMINDIR\" \
++	-DINSTDIR_ENVVAR=\"DPKG_ROOT\" \
+ 	$(AM_CPPFLAGS)
+ 
+ update_alternatives_LDADD = \
+diff --git a/utils/update-alternatives.c b/utils/update-alternatives.c
+index 5dc3213..2b49819 100644
+--- a/utils/update-alternatives.c
++++ b/utils/update-alternatives.c
+@@ -51,6 +51,7 @@
+ #define PROGNAME "update-alternatives"
+ 
+ static const char *altdir = SYSCONFDIR "/alternatives";
++static const char *instdir;
+ static const char *admdir;
+ 
+ static const char *prog_path = "update-alternatives";
+@@ -64,6 +65,27 @@ static int opt_verbose = 0;
+ static int opt_force = 0;
+ 
+ /*
++ * Types.
++ */
++
++enum alternative_path_status {
++	ALT_PATH_SYMLINK,
++	ALT_PATH_MISSING,
++	ALT_PATH_OTHER,
++};
++
++
++/*
++ * Predeclarations.
++ */
++
++static char * DPKG_ATTR_PRINTF(1)
++xasprintf(const char *fmt, ...);
++
++static enum alternative_path_status
++alternative_path_classify(const char *linkname);
++
++/*
+  * Functions.
+  */
+ 
+@@ -270,7 +292,7 @@ xstrdup(const char *str)
+ }
+ 
+ static char *
+-areadlink(const char *linkname)
++_areadlink(const char *linkname)
+ {
+ 	struct stat st;
+ 	char *buf;
+@@ -303,6 +325,19 @@ areadlink(const char *linkname)
+ }
+ 
+ static char *
++areadlink(const char *linkname)
++{
++	char *instdir_linkname;
++	char *ret;
++
++	instdir_linkname = xasprintf("%s%s", instdir, linkname);
++	ret = _areadlink(instdir_linkname);
++	free(instdir_linkname);
++
++	return ret;
++}
++
++static char *
+ xreadlink(const char *linkname)
+ {
+ 	char *buf;
+@@ -348,9 +383,22 @@ set_action(const char *new_action)
+ }
+ 
+ static const char *
++instdir_init(void)
++{
++	const char *dpkg_instdir;
++
++	dpkg_instdir = getenv(INSTDIR_ENVVAR);
++	if (dpkg_instdir)
++		return dpkg_instdir;
++
++	return "";
++}
++
++static const char *
+ admindir_init(void)
+ {
+ 	const char *basedir, *basedir_env;
++	size_t length;
+ 
+ 	/* Try to get the admindir from an environment variable, usually set
+ 	 * by the system package manager. */
+@@ -360,6 +408,12 @@ admindir_init(void)
+ 	else
+ 		basedir = ADMINDIR;
+ 
++	/* If instdir is set and admindir is below instdir, treat admindir
++	 * as relative. */
++	length = strlen(instdir);
++	if (strncmp(basedir, instdir, length) == 0)
++		basedir += length;
++
+ 	return xasprintf("%s/%s", basedir, "alternatives");
+ }
+ 
+@@ -432,25 +486,43 @@ rename_mv(const char *src, const char *dst)
+ static void
+ checked_symlink(const char *filename, const char *linkname)
+ {
+-	if (symlink(filename, linkname))
++	char *instdir_linkname;
++
++	instdir_linkname = xasprintf("%s%s", instdir, linkname);
++
++	if (symlink(filename, instdir_linkname))
+ 		syserr(_("error creating symbolic link '%.255s'"), linkname);
++
++	free(instdir_linkname);
+ }
+ 
+ static void
+ checked_mv(const char *src, const char *dst)
+ {
+-	if (!rename_mv(src, dst))
++	char *instdir_src;
++	char *instdir_dst;
++
++	instdir_src = xasprintf("%s%s", instdir, src);
++	instdir_dst = xasprintf("%s%s", instdir, dst);
++
++	if (!rename_mv(instdir_src, instdir_dst))
+ 		syserr(_("unable to install '%.250s' as '%.250s'"), src, dst);
++
++	free(instdir_src);
++	free(instdir_dst);
+ }
+ 
+ static void
+ checked_rm(const char *f)
+ {
+-	if (!unlink(f))
+-		return;
++	char *instdir_f;
+ 
+-	if (errno != ENOENT)
++	instdir_f = xasprintf("%s%s", instdir, f);
++
++	if (unlink(instdir_f) && errno != ENOENT)
+ 		syserr(_("unable to remove '%s'"), f);
++
++	free(instdir_f);
+ }
+ 
+ static void DPKG_ATTR_PRINTF(1)
+@@ -567,16 +639,11 @@ fileset_has_slave(struct fileset *fs, const char *name)
+ static bool
+ fileset_can_install_slave(struct fileset *fs, const char *slave_name)
+ {
+-	struct stat st;
+-
+ 	/* Decide whether the slave alternative must be setup */
+ 	if (fileset_has_slave(fs, slave_name)) {
+ 		const char *slave = fileset_get_slave(fs, slave_name);
+ 
+-		errno = 0;
+-		if (stat(slave, &st) == -1 && errno != ENOENT)
+-			syserr(_("cannot stat file '%s'"), slave);
+-		if (errno == 0)
++		if (alternative_path_classify(slave) != ALT_PATH_MISSING)
+ 			return true;
+ 	}
+ 
+@@ -1039,10 +1106,15 @@ static int
+ altdb_get_namelist(struct dirent ***table)
+ {
+ 	int count;
++	char *instdir_admdir;
+ 
+-	count = scandir(admdir, table, altdb_filter_namelist, alphasort);
++	instdir_admdir = xasprintf("%s%s", instdir, admdir);
++
++	count = scandir(instdir_admdir, table, altdb_filter_namelist, alphasort);
+ 	if (count < 0)
+-		syserr(_("cannot scan directory '%.255s'"), admdir);
++		syserr(_("cannot scan directory '%.255s'"), instdir_admdir);
++
++	free(instdir_admdir);
+ 
+ 	return count;
+ }
+@@ -1167,7 +1239,6 @@ alternative_parse_fileset(struct alternative *a, struct altdb_context *ctx)
+ {
+ 	struct fileset *fs;
+ 	struct slave_link *sl;
+-	struct stat st;
+ 	char *master_file;
+ 
+ 	master_file = altdb_get_line(ctx, _("master file"));
+@@ -1180,12 +1251,9 @@ alternative_parse_fileset(struct alternative *a, struct altdb_context *ctx)
+ 	if (fs)
+ 		ctx->bad_format(ctx, _("duplicate path %s"), master_file);
+ 
+-	if (stat(master_file, &st)) {
++	if (alternative_path_classify(master_file) == ALT_PATH_MISSING) {
+ 		char *junk;
+ 
+-		if (errno != ENOENT)
+-			syserr(_("cannot stat file '%s'"), master_file);
+-
+ 		/* File not found - remove. */
+ 		if (ctx->flags & ALTDB_WARN_PARSER)
+ 			warning(_("alternative %s (part of link group %s) "
+@@ -1248,7 +1316,7 @@ alternative_load(struct alternative *a, enum altdb_flags flags)
+ 		ctx.bad_format = altdb_parse_stop;
+ 	else
+ 		ctx.bad_format = altdb_parse_error;
+-	ctx.filename = xasprintf("%s/%s", admdir, a->master_name);
++	ctx.filename = xasprintf("%s%s/%s", instdir, admdir, a->master_name);
+ 
+ 	/* Open the alternative file. */
+ 	ctx.fh = fopen(ctx.filename, "r");
+@@ -1340,7 +1408,7 @@ alternative_save(struct alternative *a)
+ 	file = xasprintf("%s/%s", admdir, a->master_name);
+ 	filenew = xasprintf("%s" ALT_TMP_EXT, file);
+ 
+-	ctx.filename = filenew;
++	ctx.filename = xasprintf("%s%s", instdir, filenew);
+ 	ctx.fh = fopen(ctx.filename, "w");
+ 	if (ctx.fh == NULL)
+ 		syserr(_("unable to create file '%s'"), ctx.filename);
+@@ -1379,6 +1447,7 @@ alternative_save(struct alternative *a)
+ 		syserr(_("unable to sync file '%s'"), ctx.filename);
+ 	if (fclose(ctx.fh))
+ 		syserr(_("unable to close file '%s'"), ctx.filename);
++	free(ctx.filename);
+ 
+ 	/* Put in place atomically. */
+ 	checked_mv(filenew, file);
+@@ -1399,7 +1468,6 @@ alternative_set_current(struct alternative *a, char *new_choice)
+ static const char *
+ alternative_get_current(struct alternative *a)
+ {
+-	struct stat st;
+ 	char *curlink;
+ 	char *file;
+ 
+@@ -1407,12 +1475,9 @@ alternative_get_current(struct alternative *a)
+ 		return a->current;
+ 
+ 	curlink = xasprintf("%s/%s", altdir, a->master_name);
+-	if (lstat(curlink, &st)) {
+-		if (errno == ENOENT) {
+-			free(curlink);
+-			return alternative_set_current(a, NULL);
+-		}
+-		syserr(_("cannot stat file '%s'"), curlink);
++	if (alternative_path_classify(curlink) == ALT_PATH_MISSING) {
++		free(curlink);
++		return alternative_set_current(a, NULL);
+ 	}
+ 
+ 	file = xreadlink(curlink);
+@@ -1674,14 +1739,8 @@ alternative_commit(struct alternative *a)
+ 	alternative_commit_operations_free(a);
+ }
+ 
+-enum alternative_path_status {
+-	ALT_PATH_SYMLINK,
+-	ALT_PATH_MISSING,
+-	ALT_PATH_OTHER,
+-};
+-
+ static enum alternative_path_status
+-alternative_path_classify(const char *linkname)
++_alternative_path_classify(const char *linkname)
+ {
+ 	struct stat st;
+ 
+@@ -1697,6 +1756,19 @@ alternative_path_classify(const char *linkname)
+ 	}
+ }
+ 
++static enum alternative_path_status
++alternative_path_classify(const char *linkname)
++{
++	enum alternative_path_status ret;
++	char *instdir_linkname;
++
++	instdir_linkname = xasprintf("%s%s", instdir, linkname);
++	ret = _alternative_path_classify(instdir_linkname);
++	free(instdir_linkname);
++
++	return ret;
++}
++
+ static bool
+ alternative_path_can_remove(const char *linkname)
+ {
+@@ -2120,13 +2192,7 @@ alternative_select_mode(struct alternative *a, const char *current_choice)
+ 	if (current_choice) {
+ 		/* Detect manually modified alternative, switch to manual. */
+ 		if (!alternative_has_choice(a, current_choice)) {
+-			struct stat st;
+-
+-			errno = 0;
+-			if (stat(current_choice, &st) == -1 && errno != ENOENT)
+-				syserr(_("cannot stat file '%s'"), current_choice);
+-
+-			if (errno == ENOENT) {
++			if (alternative_path_classify(current_choice) == ALT_PATH_MISSING) {
+ 				warning(_("%s/%s is dangling; it will be updated "
+ 				          "with best choice"), altdir, a->master_name);
+ 				alternative_set_status(a, ALT_ST_AUTO);
+@@ -2150,7 +2216,6 @@ alternative_evolve_slave(struct alternative *a, const char *cur_choice,
+                          struct slave_link *sl, struct fileset *fs)
+ {
+ 	struct slave_link *sl_old;
+-	struct stat st;
+ 	char *new_file = NULL;
+ 	const char *old, *new;
+ 
+@@ -2174,17 +2239,7 @@ alternative_evolve_slave(struct alternative *a, const char *cur_choice,
+ 	}
+ 	if (strcmp(old, new) != 0 &&
+ 	    alternative_path_classify(old) == ALT_PATH_SYMLINK) {
+-		bool rename_link = false;
+-
+-		if (new_file) {
+-			errno = 0;
+-			if (stat(new_file, &st) == -1 && errno != ENOENT)
+-				syserr(_("cannot stat file '%s'"),
+-				       new_file);
+-			rename_link = (errno == 0);
+-		}
+-
+-		if (rename_link) {
++		if (new_file && alternative_path_classify(new_file) != ALT_PATH_MISSING) {
+ 			info(_("renaming %s slave link from %s to %s"),
+ 			     sl->name, old, new);
+ 			checked_mv(old, new);
+@@ -2474,7 +2529,6 @@ alternative_check_install_args(struct alternative *inst_alt,
+ 	struct alternative_map *alt_map_links, *alt_map_parent;
+ 	struct alternative *found;
+ 	struct slave_link *sl;
+-	struct stat st;
+ 
+ 	alternative_check_name(inst_alt->master_name);
+ 	alternative_check_link(inst_alt->master_link);
+@@ -2499,13 +2553,9 @@ alternative_check_install_args(struct alternative *inst_alt,
+ 		      inst_alt->master_link, found->master_name);
+ 	}
+ 
+-	if (stat(fileset->master_file, &st) == -1) {
+-		if (errno == ENOENT)
+-			error(_("alternative path %s doesn't exist"),
+-			      fileset->master_file);
+-		else
+-			syserr(_("cannot stat file '%s'"), fileset->master_file);
+-	}
++	if (alternative_path_classify(fileset->master_file) == ALT_PATH_MISSING)
++		error(_("alternative path %s doesn't exist"),
++		      fileset->master_file);
+ 
+ 	for (sl = inst_alt->slaves; sl; sl = sl->next) {
+ 		const char *file = fileset_get_slave(fileset, sl->name);
+@@ -2580,6 +2630,7 @@ main(int argc, char **argv)
+ 	bindtextdomain(PACKAGE, LOCALEDIR);
+ 	textdomain(PACKAGE);
+ 
++	instdir = instdir_init();
+ 	admdir = admindir_init();
+ 
+ 	if (setvbuf(stdout, NULL, _IONBF, 0))
diff --git a/meta/recipes-devtools/dpkg/dpkg_1.18.7.bb b/meta/recipes-devtools/dpkg/dpkg_1.18.7.bb
index 28fdc13..65a9bb6 100644
--- a/meta/recipes-devtools/dpkg/dpkg_1.18.7.bb
+++ b/meta/recipes-devtools/dpkg/dpkg_1.18.7.bb
@@ -8,7 +8,7 @@ SRC_URI = "http://snapshot.debian.org/archive/debian/20160509T100042Z/pool/main/
            file://dpkg-configure.service \
            file://add_armeb_triplet_entry.patch \
            file://0002-Adapt-to-linux-wrs-kernel-version-which-has-characte.patch \
-           file://0003-Our-pre-postinsts-expect-D-to-be-set-when-running-in.patch \
+           file://0003-update-alternatives-Implement-offline-mode.patch \
            file://0004-The-lutimes-function-doesn-t-work-properly-for-all-s.patch \
            file://0005-dpkg-compiler.m4-remove-Wvla.patch \
            file://0006-add-musleabi-to-known-target-tripets.patch \
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [PATCH 02/33] dpkg: update-alternatives-dpkg should conflict with other providers
  2016-12-06 11:49 [PATCH 00/33] Accumulated patches for deb packaging Andreas Oberritter
  2016-12-06 11:49 ` [PATCH 01/33] dpkg: implement offline mode for update-alternatives Andreas Oberritter
@ 2016-12-06 11:49 ` Andreas Oberritter
  2016-12-06 19:52   ` Burton, Ross
  2016-12-06 11:49 ` [PATCH 03/33] dpkg-native: hardcode SYSCONFDIR to /etc in update-alternatives Andreas Oberritter
                   ` (32 subsequent siblings)
  34 siblings, 1 reply; 59+ messages in thread
From: Andreas Oberritter @ 2016-12-06 11:49 UTC (permalink / raw)
  To: openembedded-core

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

diff --git a/meta/recipes-devtools/dpkg/dpkg.inc b/meta/recipes-devtools/dpkg/dpkg.inc
index ec0117b..f7d9e77 100644
--- a/meta/recipes-devtools/dpkg/dpkg.inc
+++ b/meta/recipes-devtools/dpkg/dpkg.inc
@@ -63,6 +63,7 @@ do_install_append () {
 PACKAGES =+ "update-alternatives-dpkg"
 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"
 
 PACKAGES += "${PN}-perl"
 FILES_${PN}-perl = "${libdir}/perl"
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [PATCH 03/33] dpkg-native: hardcode SYSCONFDIR to /etc in update-alternatives
  2016-12-06 11:49 [PATCH 00/33] Accumulated patches for deb packaging Andreas Oberritter
  2016-12-06 11:49 ` [PATCH 01/33] dpkg: implement offline mode for update-alternatives Andreas Oberritter
  2016-12-06 11:49 ` [PATCH 02/33] dpkg: update-alternatives-dpkg should conflict with other providers Andreas Oberritter
@ 2016-12-06 11:49 ` Andreas Oberritter
  2016-12-06 15:39   ` Burton, Ross
  2016-12-06 11:49 ` [PATCH 04/33] apt-native: Use option --force-script-chrootless for rootfs Andreas Oberritter
                   ` (31 subsequent siblings)
  34 siblings, 1 reply; 59+ messages in thread
From: Andreas Oberritter @ 2016-12-06 11:49 UTC (permalink / raw)
  To: openembedded-core

It needs to be relative to DPKG_INSTDIR when installing.

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

diff --git a/meta/recipes-devtools/dpkg/dpkg.inc b/meta/recipes-devtools/dpkg/dpkg.inc
index f7d9e77..6769a70 100644
--- a/meta/recipes-devtools/dpkg/dpkg.inc
+++ b/meta/recipes-devtools/dpkg/dpkg.inc
@@ -36,6 +36,10 @@ EXTRA_OECONF = "\
 EXTRA_OECONF += "TAR=tar"
 EXTRA_OECONF_append_class-target = " DEB_HOST_ARCH=${DPKG_ARCH}"
 
+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
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [PATCH 04/33] apt-native: Use option --force-script-chrootless for rootfs
  2016-12-06 11:49 [PATCH 00/33] Accumulated patches for deb packaging Andreas Oberritter
                   ` (2 preceding siblings ...)
  2016-12-06 11:49 ` [PATCH 03/33] dpkg-native: hardcode SYSCONFDIR to /etc in update-alternatives Andreas Oberritter
@ 2016-12-06 11:49 ` Andreas Oberritter
  2016-12-06 11:49 ` [PATCH 05/33] package_manager/deb: pass option --force-script-chrootless to dpkg Andreas Oberritter
                   ` (30 subsequent siblings)
  34 siblings, 0 replies; 59+ messages in thread
From: Andreas Oberritter @ 2016-12-06 11:49 UTC (permalink / raw)
  To: openembedded-core

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	[flat|nested] 59+ messages in thread

* [PATCH 05/33] package_manager/deb: pass option --force-script-chrootless to dpkg
  2016-12-06 11:49 [PATCH 00/33] Accumulated patches for deb packaging Andreas Oberritter
                   ` (3 preceding siblings ...)
  2016-12-06 11:49 ` [PATCH 04/33] apt-native: Use option --force-script-chrootless for rootfs Andreas Oberritter
@ 2016-12-06 11:49 ` Andreas Oberritter
  2016-12-06 11:49 ` [PATCH 06/33] debianutils: Allow native builds Andreas Oberritter
                   ` (29 subsequent siblings)
  34 siblings, 0 replies; 59+ messages in thread
From: Andreas Oberritter @ 2016-12-06 11:49 UTC (permalink / raw)
  To: openembedded-core

Fixes removal of packages with new dpkg version.

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

diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py
index 7ba2e4d..4ef4f6d 100644
--- a/meta/lib/oe/package_manager.py
+++ b/meta/lib/oe/package_manager.py
@@ -2090,7 +2090,7 @@ class DpkgPM(OpkgDpkgPM):
             cmd = "%s purge %s" % (self.apt_get_cmd, ' '.join(pkgs))
         else:
             cmd = "%s --admindir=%s/var/lib/dpkg --instdir=%s" \
-                  " -P --force-depends %s" % \
+                  " -P --force-depends --force-script-chrootless %s" % \
                   (bb.utils.which(os.getenv('PATH'), "dpkg"),
                    self.target_rootfs, self.target_rootfs, ' '.join(pkgs))
 
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [PATCH 06/33] debianutils: Allow native builds
  2016-12-06 11:49 [PATCH 00/33] Accumulated patches for deb packaging Andreas Oberritter
                   ` (4 preceding siblings ...)
  2016-12-06 11:49 ` [PATCH 05/33] package_manager/deb: pass option --force-script-chrootless to dpkg Andreas Oberritter
@ 2016-12-06 11:49 ` Andreas Oberritter
  2016-12-06 11:49 ` [PATCH 07/33] apt-native: merge apt-native.inc into .bb Andreas Oberritter
                   ` (28 subsequent siblings)
  34 siblings, 0 replies; 59+ messages in thread
From: Andreas Oberritter @ 2016-12-06 11:49 UTC (permalink / raw)
  To: openembedded-core

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	[flat|nested] 59+ messages in thread

* [PATCH 07/33] apt-native: merge apt-native.inc into .bb
  2016-12-06 11:49 [PATCH 00/33] Accumulated patches for deb packaging Andreas Oberritter
                   ` (5 preceding siblings ...)
  2016-12-06 11:49 ` [PATCH 06/33] debianutils: Allow native builds Andreas Oberritter
@ 2016-12-06 11:49 ` Andreas Oberritter
  2016-12-06 11:49 ` [PATCH 08/33] apt: merge apt-package.inc " Andreas Oberritter
                   ` (27 subsequent siblings)
  34 siblings, 0 replies; 59+ messages in thread
From: Andreas Oberritter @ 2016-12-06 11:49 UTC (permalink / raw)
  To: openembedded-core

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	[flat|nested] 59+ messages in thread

* [PATCH 08/33] apt: merge apt-package.inc into .bb
  2016-12-06 11:49 [PATCH 00/33] Accumulated patches for deb packaging Andreas Oberritter
                   ` (6 preceding siblings ...)
  2016-12-06 11:49 ` [PATCH 07/33] apt-native: merge apt-native.inc into .bb Andreas Oberritter
@ 2016-12-06 11:49 ` Andreas Oberritter
  2016-12-06 11:49 ` [PATCH 09/33] apt-native: use sed to prepare apt.conf.sample Andreas Oberritter
                   ` (26 subsequent siblings)
  34 siblings, 0 replies; 59+ messages in thread
From: Andreas Oberritter @ 2016-12-06 11:49 UTC (permalink / raw)
  To: openembedded-core

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	[flat|nested] 59+ messages in thread

* [PATCH 09/33] apt-native: use sed to prepare apt.conf.sample
  2016-12-06 11:49 [PATCH 00/33] Accumulated patches for deb packaging Andreas Oberritter
                   ` (7 preceding siblings ...)
  2016-12-06 11:49 ` [PATCH 08/33] apt: merge apt-package.inc " Andreas Oberritter
@ 2016-12-06 11:49 ` Andreas Oberritter
  2016-12-06 11:49 ` [PATCH 10/33] apt: use default packaging rules for manpages Andreas Oberritter
                   ` (25 subsequent siblings)
  34 siblings, 0 replies; 59+ messages in thread
From: Andreas Oberritter @ 2016-12-06 11:49 UTC (permalink / raw)
  To: openembedded-core

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	[flat|nested] 59+ messages in thread

* [PATCH 10/33] apt: use default packaging rules for manpages
  2016-12-06 11:49 [PATCH 00/33] Accumulated patches for deb packaging Andreas Oberritter
                   ` (8 preceding siblings ...)
  2016-12-06 11:49 ` [PATCH 09/33] apt-native: use sed to prepare apt.conf.sample Andreas Oberritter
@ 2016-12-06 11:49 ` Andreas Oberritter
  2016-12-06 11:49 ` [PATCH 11/33] apt: use default packaging rules for base package, prepend apt-utils Andreas Oberritter
                   ` (24 subsequent siblings)
  34 siblings, 0 replies; 59+ messages in thread
From: Andreas Oberritter @ 2016-12-06 11:49 UTC (permalink / raw)
  To: openembedded-core

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	[flat|nested] 59+ messages in thread

* [PATCH 11/33] apt: use default packaging rules for base package, prepend apt-utils
  2016-12-06 11:49 [PATCH 00/33] Accumulated patches for deb packaging Andreas Oberritter
                   ` (9 preceding siblings ...)
  2016-12-06 11:49 ` [PATCH 10/33] apt: use default packaging rules for manpages Andreas Oberritter
@ 2016-12-06 11:49 ` Andreas Oberritter
  2016-12-06 11:49 ` [PATCH 12/33] apt: use default packaging rules for -dev package Andreas Oberritter
                   ` (23 subsequent siblings)
  34 siblings, 0 replies; 59+ messages in thread
From: Andreas Oberritter @ 2016-12-06 11:49 UTC (permalink / raw)
  To: openembedded-core

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	[flat|nested] 59+ messages in thread

* [PATCH 12/33] apt: use default packaging rules for -dev package
  2016-12-06 11:49 [PATCH 00/33] Accumulated patches for deb packaging Andreas Oberritter
                   ` (10 preceding siblings ...)
  2016-12-06 11:49 ` [PATCH 11/33] apt: use default packaging rules for base package, prepend apt-utils Andreas Oberritter
@ 2016-12-06 11:49 ` Andreas Oberritter
  2016-12-06 11:49 ` [PATCH 13/33] apt: rewrite do_install Andreas Oberritter
                   ` (22 subsequent siblings)
  34 siblings, 0 replies; 59+ messages in thread
From: Andreas Oberritter @ 2016-12-06 11:49 UTC (permalink / raw)
  To: openembedded-core

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	[flat|nested] 59+ messages in thread

* [PATCH 13/33] apt: rewrite do_install
  2016-12-06 11:49 [PATCH 00/33] Accumulated patches for deb packaging Andreas Oberritter
                   ` (11 preceding siblings ...)
  2016-12-06 11:49 ` [PATCH 12/33] apt: use default packaging rules for -dev package Andreas Oberritter
@ 2016-12-06 11:49 ` Andreas Oberritter
  2016-12-06 11:49 ` [PATCH 14/33] apt-native: drop obsolete patches Andreas Oberritter
                   ` (21 subsequent siblings)
  34 siblings, 0 replies; 59+ messages in thread
From: Andreas Oberritter @ 2016-12-06 11:49 UTC (permalink / raw)
  To: openembedded-core

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	[flat|nested] 59+ messages in thread

* [PATCH 14/33] apt-native: drop obsolete patches
  2016-12-06 11:49 [PATCH 00/33] Accumulated patches for deb packaging Andreas Oberritter
                   ` (12 preceding siblings ...)
  2016-12-06 11:49 ` [PATCH 13/33] apt: rewrite do_install Andreas Oberritter
@ 2016-12-06 11:49 ` Andreas Oberritter
  2016-12-06 11:49 ` [PATCH 15/33] apt: merge with apt-native Andreas Oberritter
                   ` (20 subsequent siblings)
  34 siblings, 0 replies; 59+ messages in thread
From: Andreas Oberritter @ 2016-12-06 11:49 UTC (permalink / raw)
  To: openembedded-core

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	[flat|nested] 59+ messages in thread

* [PATCH 15/33] apt: merge with apt-native
  2016-12-06 11:49 [PATCH 00/33] Accumulated patches for deb packaging Andreas Oberritter
                   ` (13 preceding siblings ...)
  2016-12-06 11:49 ` [PATCH 14/33] apt-native: drop obsolete patches Andreas Oberritter
@ 2016-12-06 11:49 ` Andreas Oberritter
  2016-12-06 11:49 ` [PATCH 16/33] apt: merge apt.inc into .bb Andreas Oberritter
                   ` (19 subsequent siblings)
  34 siblings, 0 replies; 59+ messages in thread
From: Andreas Oberritter @ 2016-12-06 11:49 UTC (permalink / raw)
  To: openembedded-core

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	[flat|nested] 59+ messages in thread

* [PATCH 16/33] apt: merge apt.inc into .bb
  2016-12-06 11:49 [PATCH 00/33] Accumulated patches for deb packaging Andreas Oberritter
                   ` (14 preceding siblings ...)
  2016-12-06 11:49 ` [PATCH 15/33] apt: merge with apt-native Andreas Oberritter
@ 2016-12-06 11:49 ` Andreas Oberritter
  2016-12-06 11:49 ` [PATCH 17/33] apt: group variables (license, configuration, packaging) Andreas Oberritter
                   ` (18 subsequent siblings)
  34 siblings, 0 replies; 59+ messages in thread
From: Andreas Oberritter @ 2016-12-06 11:49 UTC (permalink / raw)
  To: openembedded-core

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	[flat|nested] 59+ messages in thread

* [PATCH 17/33] apt: group variables (license, configuration, packaging)
  2016-12-06 11:49 [PATCH 00/33] Accumulated patches for deb packaging Andreas Oberritter
                   ` (15 preceding siblings ...)
  2016-12-06 11:49 ` [PATCH 16/33] apt: merge apt.inc into .bb Andreas Oberritter
@ 2016-12-06 11:49 ` Andreas Oberritter
  2016-12-06 11:49 ` [PATCH 18/33] apt: more fine-grained packaging Andreas Oberritter
                   ` (17 subsequent siblings)
  34 siblings, 0 replies; 59+ messages in thread
From: Andreas Oberritter @ 2016-12-06 11:49 UTC (permalink / raw)
  To: openembedded-core

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	[flat|nested] 59+ messages in thread

* [PATCH 18/33] apt: more fine-grained packaging
  2016-12-06 11:49 [PATCH 00/33] Accumulated patches for deb packaging Andreas Oberritter
                   ` (16 preceding siblings ...)
  2016-12-06 11:49 ` [PATCH 17/33] apt: group variables (license, configuration, packaging) Andreas Oberritter
@ 2016-12-06 11:49 ` Andreas Oberritter
  2016-12-06 11:49 ` [PATCH 19/33] apt: recommend gnupg Andreas Oberritter
                   ` (16 subsequent siblings)
  34 siblings, 0 replies; 59+ messages in thread
From: Andreas Oberritter @ 2016-12-06 11:49 UTC (permalink / raw)
  To: openembedded-core

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	[flat|nested] 59+ messages in thread

* [PATCH 19/33] apt: recommend gnupg
  2016-12-06 11:49 [PATCH 00/33] Accumulated patches for deb packaging Andreas Oberritter
                   ` (17 preceding siblings ...)
  2016-12-06 11:49 ` [PATCH 18/33] apt: more fine-grained packaging Andreas Oberritter
@ 2016-12-06 11:49 ` Andreas Oberritter
  2016-12-06 11:49 ` [PATCH 20/33] package_manager/deb: let apt-get handle postinst scripts Andreas Oberritter
                   ` (15 subsequent siblings)
  34 siblings, 0 replies; 59+ messages in thread
From: Andreas Oberritter @ 2016-12-06 11:49 UTC (permalink / raw)
  To: openembedded-core

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	[flat|nested] 59+ messages in thread

* [PATCH 20/33] package_manager/deb: let apt-get handle postinst scripts
  2016-12-06 11:49 [PATCH 00/33] Accumulated patches for deb packaging Andreas Oberritter
                   ` (18 preceding siblings ...)
  2016-12-06 11:49 ` [PATCH 19/33] apt: recommend gnupg Andreas Oberritter
@ 2016-12-06 11:49 ` Andreas Oberritter
  2016-12-06 17:26   ` Burton, Ross
  2016-12-06 11:49 ` [PATCH 21/33] package_manager/deb: create Packages.xz Andreas Oberritter
                   ` (14 subsequent siblings)
  34 siblings, 1 reply; 59+ messages in thread
From: Andreas Oberritter @ 2016-12-06 11:49 UTC (permalink / raw)
  To: openembedded-core

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	[flat|nested] 59+ messages in thread

* [PATCH 21/33] package_manager/deb: create Packages.xz
  2016-12-06 11:49 [PATCH 00/33] Accumulated patches for deb packaging Andreas Oberritter
                   ` (19 preceding siblings ...)
  2016-12-06 11:49 ` [PATCH 20/33] package_manager/deb: let apt-get handle postinst scripts Andreas Oberritter
@ 2016-12-06 11:49 ` Andreas Oberritter
  2016-12-06 17:22   ` Burton, Ross
  2016-12-06 11:49 ` [PATCH 22/33] package_manager/deb: implement BAD_RECOMMENDATIONS Andreas Oberritter
                   ` (13 subsequent siblings)
  34 siblings, 1 reply; 59+ messages in thread
From: Andreas Oberritter @ 2016-12-06 11:49 UTC (permalink / raw)
  To: openembedded-core

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	[flat|nested] 59+ messages in thread

* [PATCH 22/33] package_manager/deb: implement BAD_RECOMMENDATIONS
  2016-12-06 11:49 [PATCH 00/33] Accumulated patches for deb packaging Andreas Oberritter
                   ` (20 preceding siblings ...)
  2016-12-06 11:49 ` [PATCH 21/33] package_manager/deb: create Packages.xz Andreas Oberritter
@ 2016-12-06 11:49 ` Andreas Oberritter
  2016-12-06 11:49 ` [PATCH 23/33] dpkg: use PACKAGECONFIG Andreas Oberritter
                   ` (12 subsequent siblings)
  34 siblings, 0 replies; 59+ messages in thread
From: Andreas Oberritter @ 2016-12-06 11:49 UTC (permalink / raw)
  To: openembedded-core

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	[flat|nested] 59+ messages in thread

* [PATCH 23/33] dpkg: use PACKAGECONFIG
  2016-12-06 11:49 [PATCH 00/33] Accumulated patches for deb packaging Andreas Oberritter
                   ` (21 preceding siblings ...)
  2016-12-06 11:49 ` [PATCH 22/33] package_manager/deb: implement BAD_RECOMMENDATIONS Andreas Oberritter
@ 2016-12-06 11:49 ` Andreas Oberritter
  2016-12-06 11:49 ` [PATCH 24/33] dpkg: set license field to more common "GPLv2+" Andreas Oberritter
                   ` (11 subsequent siblings)
  34 siblings, 0 replies; 59+ messages in thread
From: Andreas Oberritter @ 2016-12-06 11:49 UTC (permalink / raw)
  To: openembedded-core

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	[flat|nested] 59+ messages in thread

* [PATCH 24/33] dpkg: set license field to more common "GPLv2+"
  2016-12-06 11:49 [PATCH 00/33] Accumulated patches for deb packaging Andreas Oberritter
                   ` (22 preceding siblings ...)
  2016-12-06 11:49 ` [PATCH 23/33] dpkg: use PACKAGECONFIG Andreas Oberritter
@ 2016-12-06 11:49 ` Andreas Oberritter
  2016-12-06 11:49 ` [PATCH 25/33] dpkg: clean-up packaging of start-stop-daemon Andreas Oberritter
                   ` (10 subsequent siblings)
  34 siblings, 0 replies; 59+ messages in thread
From: Andreas Oberritter @ 2016-12-06 11:49 UTC (permalink / raw)
  To: openembedded-core

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	[flat|nested] 59+ messages in thread

* [PATCH 25/33] dpkg: clean-up packaging of start-stop-daemon
  2016-12-06 11:49 [PATCH 00/33] Accumulated patches for deb packaging Andreas Oberritter
                   ` (23 preceding siblings ...)
  2016-12-06 11:49 ` [PATCH 24/33] dpkg: set license field to more common "GPLv2+" Andreas Oberritter
@ 2016-12-06 11:49 ` Andreas Oberritter
  2016-12-06 11:49 ` [PATCH 26/33] dpkg: remove unneeded do_configure override Andreas Oberritter
                   ` (9 subsequent siblings)
  34 siblings, 0 replies; 59+ messages in thread
From: Andreas Oberritter @ 2016-12-06 11:49 UTC (permalink / raw)
  To: openembedded-core

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	[flat|nested] 59+ messages in thread

* [PATCH 26/33] dpkg: remove unneeded do_configure override
  2016-12-06 11:49 [PATCH 00/33] Accumulated patches for deb packaging Andreas Oberritter
                   ` (24 preceding siblings ...)
  2016-12-06 11:49 ` [PATCH 25/33] dpkg: clean-up packaging of start-stop-daemon Andreas Oberritter
@ 2016-12-06 11:49 ` Andreas Oberritter
  2016-12-06 11:49 ` [PATCH 27/33] dpkg: simplify replacing perl interpreter in scripts Andreas Oberritter
                   ` (8 subsequent siblings)
  34 siblings, 0 replies; 59+ messages in thread
From: Andreas Oberritter @ 2016-12-06 11:49 UTC (permalink / raw)
  To: openembedded-core

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	[flat|nested] 59+ messages in thread

* [PATCH 27/33] dpkg: simplify replacing perl interpreter in scripts
  2016-12-06 11:49 [PATCH 00/33] Accumulated patches for deb packaging Andreas Oberritter
                   ` (25 preceding siblings ...)
  2016-12-06 11:49 ` [PATCH 26/33] dpkg: remove unneeded do_configure override Andreas Oberritter
@ 2016-12-06 11:49 ` Andreas Oberritter
  2016-12-06 11:49 ` [PATCH 28/33] dpkg: update packages and files to match Debian more closely Andreas Oberritter
                   ` (7 subsequent siblings)
  34 siblings, 0 replies; 59+ messages in thread
From: Andreas Oberritter @ 2016-12-06 11:49 UTC (permalink / raw)
  To: openembedded-core

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	[flat|nested] 59+ messages in thread

* [PATCH 28/33] dpkg: update packages and files to match Debian more closely
  2016-12-06 11:49 [PATCH 00/33] Accumulated patches for deb packaging Andreas Oberritter
                   ` (26 preceding siblings ...)
  2016-12-06 11:49 ` [PATCH 27/33] dpkg: simplify replacing perl interpreter in scripts Andreas Oberritter
@ 2016-12-06 11:49 ` Andreas Oberritter
  2016-12-06 20:13   ` Burton, Ross
  2016-12-06 11:49 ` [PATCH 29/33] dpkg: always install dpkg-configure.service Andreas Oberritter
                   ` (6 subsequent siblings)
  34 siblings, 1 reply; 59+ messages in thread
From: Andreas Oberritter @ 2016-12-06 11:49 UTC (permalink / raw)
  To: openembedded-core

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

diff --git a/meta/recipes-devtools/dpkg/dpkg.inc b/meta/recipes-devtools/dpkg/dpkg.inc
index 5e838ed..db37a7b 100644
--- a/meta/recipes-devtools/dpkg/dpkg.inc
+++ b/meta/recipes-devtools/dpkg/dpkg.inc
@@ -57,20 +57,63 @@ do_install_append () {
 	fi
 }
 
-PACKAGES =+ "start-stop-daemon update-alternatives-dpkg"
+PACKAGES =+ "dpkg-perl dselect libdpkg-perl 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 = ""
+RSUGGESTS_${PN} = "apt"
 
-FILES_start-stop-daemon = "${base_sbindir}/start-stop-daemon"
+RDEPENDS_dpkg-perl = "binutils libdpkg-perl make xz"
+RRECOMMENDS_dpkg-perl = "gnupg gpgv"
+
+RDEPENDS_dselect = "dpkg"
+RSUGGESTS_dselect = "perl"
+
+RDEPENDS_libdpkg-perl = "dpkg libtimedate-perl perl"
+RRECOMMENDS_libdpkg-perl = "xz"
+RSUGGESTS_libdpkg-perl = "binutils gnupg gpgv"
 
-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"
 
-PACKAGES += "${PN}-perl"
-FILES_${PN}-perl = "${libdir}/perl"
+FILES_dpkg-perl = " \
+    ${bindir}/dpkg-architecture \
+    ${bindir}/dpkg-buildflags \
+    ${bindir}/dpkg-buildpackage \
+    ${bindir}/dpkg-checkbuilddeps \
+    ${bindir}/dpkg-distaddfile \
+    ${bindir}/dpkg-genchanges \
+    ${bindir}/dpkg-gencontrol \
+    ${bindir}/dpkg-gensymbols \
+    ${bindir}/dpkg-mergechangelogs \
+    ${bindir}/dpkg-name \
+    ${bindir}/dpkg-parsechangelog \
+    ${bindir}/dpkg-scanpackages \
+    ${bindir}/dpkg-scansources \
+    ${bindir}/dpkg-shlibdeps \
+    ${bindir}/dpkg-source \
+    ${bindir}/dpkg-vendor \
+    ${datadir}/dpkg/*.mk \
+"
+
+FILES_dselect = "${bindir}/dselect"
+
+FILES_libdpkg-perl = " \
+    ${libdir}/dpkg/parsechangelog \
+    ${libdir}/perl \
+"
+
+FILES_start-stop-daemon = "${base_sbindir}/start-stop-daemon"
+
+FILES_update-alternatives-dpkg = " \
+    ${sysconfdir}/alternatives \
+    ${bindir}/update-alternatives \
+    ${localstatedir}/lib/dpkg/alternatives \
+"
+
+PKG_dpkg-dev = "libdpkg-dev"
+PKG_dpkg-perl = "dpkg-dev"
 
 BBCLASSEXTEND = "native"
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [PATCH 29/33] dpkg: always install dpkg-configure.service
  2016-12-06 11:49 [PATCH 00/33] Accumulated patches for deb packaging Andreas Oberritter
                   ` (27 preceding siblings ...)
  2016-12-06 11:49 ` [PATCH 28/33] dpkg: update packages and files to match Debian more closely Andreas Oberritter
@ 2016-12-06 11:49 ` Andreas Oberritter
  2016-12-06 11:49 ` [PATCH 30/33] dpkg: use correct path for perl libraries Andreas Oberritter
                   ` (5 subsequent siblings)
  34 siblings, 0 replies; 59+ messages in thread
From: Andreas Oberritter @ 2016-12-06 11:49 UTC (permalink / raw)
  To: openembedded-core

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	[flat|nested] 59+ messages in thread

* [PATCH 30/33] dpkg: use correct path for perl libraries
  2016-12-06 11:49 [PATCH 00/33] Accumulated patches for deb packaging Andreas Oberritter
                   ` (28 preceding siblings ...)
  2016-12-06 11:49 ` [PATCH 29/33] dpkg: always install dpkg-configure.service Andreas Oberritter
@ 2016-12-06 11:49 ` Andreas Oberritter
  2016-12-06 11:49 ` [PATCH 31/33] package_deb.bbclass: compress control.tar with the same algorithm as data.tar Andreas Oberritter
                   ` (4 subsequent siblings)
  34 siblings, 0 replies; 59+ messages in thread
From: Andreas Oberritter @ 2016-12-06 11:49 UTC (permalink / raw)
  To: openembedded-core

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	[flat|nested] 59+ messages in thread

* [PATCH 31/33] package_deb.bbclass: compress control.tar with the same algorithm as data.tar
  2016-12-06 11:49 [PATCH 00/33] Accumulated patches for deb packaging Andreas Oberritter
                   ` (29 preceding siblings ...)
  2016-12-06 11:49 ` [PATCH 30/33] dpkg: use correct path for perl libraries Andreas Oberritter
@ 2016-12-06 11:49 ` Andreas Oberritter
  2016-12-06 11:49 ` [PATCH 32/33] apt: fix rpath error during configure Andreas Oberritter
                   ` (3 subsequent siblings)
  34 siblings, 0 replies; 59+ messages in thread
From: Andreas Oberritter @ 2016-12-06 11:49 UTC (permalink / raw)
  To: openembedded-core

Yields better compression with xz and fixes a problem invoking gzip.

Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
---
 meta/classes/package_deb.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes/package_deb.bbclass b/meta/classes/package_deb.bbclass
index fb6034c..fa327dd 100644
--- a/meta/classes/package_deb.bbclass
+++ b/meta/classes/package_deb.bbclass
@@ -308,7 +308,7 @@ python do_package_deb () {
             conffiles.close()
 
         os.chdir(basedir)
-        ret = subprocess.call("PATH=\"%s\" dpkg-deb -b %s %s" % (localdata.getVar("PATH", True), root, pkgoutdir), shell=True)
+        ret = subprocess.call("PATH=\"%s\" dpkg-deb --uniform-compression -b %s %s" % (localdata.getVar("PATH", True), root, pkgoutdir), shell=True)
         if ret != 0:
             bb.utils.unlockfile(lf)
             bb.fatal("dpkg-deb execution failed")
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [PATCH 32/33] apt: fix rpath error during configure
  2016-12-06 11:49 [PATCH 00/33] Accumulated patches for deb packaging Andreas Oberritter
                   ` (30 preceding siblings ...)
  2016-12-06 11:49 ` [PATCH 31/33] package_deb.bbclass: compress control.tar with the same algorithm as data.tar Andreas Oberritter
@ 2016-12-06 11:49 ` Andreas Oberritter
  2016-12-06 11:49 ` [PATCH 33/33] apt: dselect depends on perl Andreas Oberritter
                   ` (2 subsequent siblings)
  34 siblings, 0 replies; 59+ messages in thread
From: Andreas Oberritter @ 2016-12-06 11:49 UTC (permalink / raw)
  To: openembedded-core

| checking for shared library run path origin... /bin/sh: ../apt-1.0.10.1/buildlib/config.rpath: No such file or directory

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 4d781a2..5dc50a4 100644
--- a/meta/recipes-devtools/apt/apt_1.2.12.bb
+++ b/meta/recipes-devtools/apt/apt_1.2.12.bb
@@ -28,7 +28,10 @@ UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/a/apt/"
 
 inherit autotools gettext useradd
 
+AUTOTOOLS_AUXDIR = "${S}/buildlib"
+
 EXTRA_AUTORECONF = "--exclude=autopoint,autoheader"
+EXTRA_OECONF = "--disable-rpath"
 
 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	[flat|nested] 59+ messages in thread

* [PATCH 33/33] apt: dselect depends on perl
  2016-12-06 11:49 [PATCH 00/33] Accumulated patches for deb packaging Andreas Oberritter
                   ` (31 preceding siblings ...)
  2016-12-06 11:49 ` [PATCH 32/33] apt: fix rpath error during configure Andreas Oberritter
@ 2016-12-06 11:49 ` Andreas Oberritter
  2016-12-06 14:36 ` [PATCH 00/33] Accumulated patches for deb packaging Burton, Ross
  2016-12-07 12:25 ` Alexander Kanavin
  34 siblings, 0 replies; 59+ messages in thread
From: Andreas Oberritter @ 2016-12-06 11:49 UTC (permalink / raw)
  To: openembedded-core

Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
---
 meta/recipes-devtools/apt/apt_1.2.12.bb | 2 +-
 1 file changed, 1 insertion(+), 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 5dc50a4..0b640f9 100644
--- a/meta/recipes-devtools/apt/apt_1.2.12.bb
+++ b/meta/recipes-devtools/apt/apt_1.2.12.bb
@@ -110,7 +110,7 @@ do_install_append_class-target() {
 PACKAGES =+ "${PN}-dselect ${PN}-transport-https ${PN}-utils lib${PN}-inst lib${PN}-pkg"
 
 RDEPENDS_${PN} = "dpkg debianutils"
-RDEPENDS_${PN}-dselect = "bash"
+RDEPENDS_${PN}-dselect = "bash perl"
 
 RRECOMMENDS_${PN} = "gnupg"
 RRECOMMENDS_${PN}_class-native = ""
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 59+ messages in thread

* Re: [PATCH 00/33] Accumulated patches for deb packaging
  2016-12-06 11:49 [PATCH 00/33] Accumulated patches for deb packaging Andreas Oberritter
                   ` (32 preceding siblings ...)
  2016-12-06 11:49 ` [PATCH 33/33] apt: dselect depends on perl Andreas Oberritter
@ 2016-12-06 14:36 ` Burton, Ross
  2016-12-06 16:00   ` Andreas Oberritter
  2016-12-07 12:25 ` Alexander Kanavin
  34 siblings, 1 reply; 59+ messages in thread
From: Burton, Ross @ 2016-12-06 14:36 UTC (permalink / raw)
  To: Andreas Oberritter; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 331 bytes --]

On 6 December 2016 at 11:49, Andreas Oberritter <obi@opendreambox.org>
wrote:

> These are most of my patches which accumulated since our distro
> switched from opkg to dpkg and apt two years ago. They were tested
> thoroughly on dora and krogoth and just a little bit on master.
>

Is this on a branch somewhere?

Ross

[-- Attachment #2: Type: text/html, Size: 741 bytes --]

^ permalink raw reply	[flat|nested] 59+ messages in thread

* Re: [PATCH 03/33] dpkg-native: hardcode SYSCONFDIR to /etc in update-alternatives
  2016-12-06 11:49 ` [PATCH 03/33] dpkg-native: hardcode SYSCONFDIR to /etc in update-alternatives Andreas Oberritter
@ 2016-12-06 15:39   ` Burton, Ross
  2016-12-06 16:08     ` Andreas Oberritter
  0 siblings, 1 reply; 59+ messages in thread
From: Burton, Ross @ 2016-12-06 15:39 UTC (permalink / raw)
  To: Andreas Oberritter; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 261 bytes --]

On 6 December 2016 at 11:49, Andreas Oberritter <obi@opendreambox.org>
wrote:

> +    sed -i -e 's|SYSCONFDIR|"/etc"|' ${S}/utils/update-alternatives.c
>

Hardcoding /etc is bad, can't you just remove the native sysroot prefix
from $sysconfdir?

Ross

[-- Attachment #2: Type: text/html, Size: 695 bytes --]

^ permalink raw reply	[flat|nested] 59+ messages in thread

* Re: [PATCH 00/33] Accumulated patches for deb packaging
  2016-12-06 14:36 ` [PATCH 00/33] Accumulated patches for deb packaging Burton, Ross
@ 2016-12-06 16:00   ` Andreas Oberritter
  0 siblings, 0 replies; 59+ messages in thread
From: Andreas Oberritter @ 2016-12-06 16:00 UTC (permalink / raw)
  To: Burton, Ross; +Cc: OE-core

On 06.12.2016 15:36, Burton, Ross wrote:
> 
> On 6 December 2016 at 11:49, Andreas Oberritter <obi@opendreambox.org
> <mailto:obi@opendreambox.org>> wrote:
> 
>     These are most of my patches which accumulated since our distro
>     switched from opkg to dpkg and apt two years ago. They were tested
>     thoroughly on dora and krogoth and just a little bit on master.
> 
> 
> Is this on a branch somewhere?

I just created a new branch here:

http://git.openembedded.org/openembedded-core-contrib/log/?h=obi/deb

Regards,
Andreas


^ permalink raw reply	[flat|nested] 59+ messages in thread

* Re: [PATCH 03/33] dpkg-native: hardcode SYSCONFDIR to /etc in update-alternatives
  2016-12-06 15:39   ` Burton, Ross
@ 2016-12-06 16:08     ` Andreas Oberritter
  2016-12-06 16:12       ` Burton, Ross
  0 siblings, 1 reply; 59+ messages in thread
From: Andreas Oberritter @ 2016-12-06 16:08 UTC (permalink / raw)
  To: Burton, Ross; +Cc: OE-core

On 06.12.2016 16:39, Burton, Ross wrote:
> 
> On 6 December 2016 at 11:49, Andreas Oberritter <obi@opendreambox.org
> <mailto:obi@opendreambox.org>> wrote:
> 
>     +    sed -i -e 's|SYSCONFDIR|"/etc"|' ${S}/utils/update-alternatives.c
> 
> 
> Hardcoding /etc is bad, can't you just remove the native sysroot prefix
> from $sysconfdir?

I guess ${sysconfdir_native} should work, unless someone overrides
STAGING_ETCDIR_NATIVE. Would this be ok?

Regards,
Andreas


^ permalink raw reply	[flat|nested] 59+ messages in thread

* Re: [PATCH 03/33] dpkg-native: hardcode SYSCONFDIR to /etc in update-alternatives
  2016-12-06 16:08     ` Andreas Oberritter
@ 2016-12-06 16:12       ` Burton, Ross
  2016-12-06 16:37         ` Andreas Oberritter
  0 siblings, 1 reply; 59+ messages in thread
From: Burton, Ross @ 2016-12-06 16:12 UTC (permalink / raw)
  To: Andreas Oberritter; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 384 bytes --]

On 6 December 2016 at 16:08, Andreas Oberritter <obi@opendreambox.org>
wrote:

> I guess ${sysconfdir_native} should work, unless someone overrides
> STAGING_ETCDIR_NATIVE. Would this be ok?
>

If the recipe inherits native then the class reassigns:

sysconfdir = "${STAGING_ETCDIR_NATIVE}"

So you'll need to take sysconfdir, and strip off the staging directory.

Ross

[-- Attachment #2: Type: text/html, Size: 1019 bytes --]

^ permalink raw reply	[flat|nested] 59+ messages in thread

* Re: [PATCH 03/33] dpkg-native: hardcode SYSCONFDIR to /etc in update-alternatives
  2016-12-06 16:12       ` Burton, Ross
@ 2016-12-06 16:37         ` Andreas Oberritter
  2016-12-06 17:07           ` Burton, Ross
  0 siblings, 1 reply; 59+ messages in thread
From: Andreas Oberritter @ 2016-12-06 16:37 UTC (permalink / raw)
  To: Burton, Ross; +Cc: OE-core

On 06.12.2016 17:12, Burton, Ross wrote:
> 
> On 6 December 2016 at 16:08, Andreas Oberritter <obi@opendreambox.org
> <mailto:obi@opendreambox.org>> wrote:
> 
>     I guess ${sysconfdir_native} should work, unless someone overrides
>     STAGING_ETCDIR_NATIVE. Would this be ok?
> 
> 
> If the recipe inherits native then the class reassigns:
> 
> sysconfdir = "${STAGING_ETCDIR_NATIVE}"
> 
> So you'll need to take sysconfdir, and strip off the staging directory.

I was asking because the result after stripping would essentially equal
${sysconfdir_native}:

STAGING_ETCDIR_NATIVE = "${STAGING_DIR_NATIVE}${sysconfdir_native}"

It wouldn't work if someone set it to "${STAGING_DIR_NATIVE}/foo"
without adjusting sysconfdir_native, but on the other hand someone could
just as well use "/path-outside-staging-dir-native/etc", which would
break attempts to strip the prefix, too. I'd guess the assumption that
STAGING_ETCDIR_NATIVE doesn't get changed alone should be safe.

Regards,
Andreas



^ permalink raw reply	[flat|nested] 59+ messages in thread

* Re: [PATCH 03/33] dpkg-native: hardcode SYSCONFDIR to /etc in update-alternatives
  2016-12-06 16:37         ` Andreas Oberritter
@ 2016-12-06 17:07           ` Burton, Ross
  0 siblings, 0 replies; 59+ messages in thread
From: Burton, Ross @ 2016-12-06 17:07 UTC (permalink / raw)
  To: Andreas Oberritter; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 693 bytes --]

On 6 December 2016 at 16:37, Andreas Oberritter <obi@opendreambox.org>
wrote:

> I was asking because the result after stripping would essentially equal
> ${sysconfdir_native}:
>
> STAGING_ETCDIR_NATIVE = "${STAGING_DIR_NATIVE}${sysconfdir_native}"
>
> It wouldn't work if someone set it to "${STAGING_DIR_NATIVE}/foo"
> without adjusting sysconfdir_native, but on the other hand someone could
> just as well use "/path-outside-staging-dir-native/etc", which would
> break attempts to strip the prefix, too. I'd guess the assumption that
> STAGING_ETCDIR_NATIVE doesn't get changed alone should be safe.
>

Ah yes, I misread the order of evaluation.  That should work.

Ross

[-- Attachment #2: Type: text/html, Size: 1288 bytes --]

^ permalink raw reply	[flat|nested] 59+ messages in thread

* Re: [PATCH 21/33] package_manager/deb: create Packages.xz
  2016-12-06 11:49 ` [PATCH 21/33] package_manager/deb: create Packages.xz Andreas Oberritter
@ 2016-12-06 17:22   ` Burton, Ross
  2016-12-06 18:41     ` Andreas Oberritter
  0 siblings, 1 reply; 59+ messages in thread
From: Burton, Ross @ 2016-12-06 17:22 UTC (permalink / raw)
  To: Andreas Oberritter; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 329 bytes --]

On 6 December 2016 at 11:49, Andreas Oberritter <obi@opendreambox.org>
wrote:

> +        xz = bb.utils.which(os.getenv('PATH'), "xz")
>

Are the relevant dependencies present to ensure that xz-native has been
staged?  Is it always present because apt links to a library in xz so the
binaries get pulled in too?

Ross

[-- Attachment #2: Type: text/html, Size: 761 bytes --]

^ permalink raw reply	[flat|nested] 59+ messages in thread

* Re: [PATCH 20/33] package_manager/deb: let apt-get handle postinst scripts
  2016-12-06 11:49 ` [PATCH 20/33] package_manager/deb: let apt-get handle postinst scripts Andreas Oberritter
@ 2016-12-06 17:26   ` Burton, Ross
  2016-12-06 18:20     ` Andreas Oberritter
  0 siblings, 1 reply; 59+ messages in thread
From: Burton, Ross @ 2016-12-06 17:26 UTC (permalink / raw)
  To: Andreas Oberritter; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 6678 bytes --]

Can you elaborate on why the old code can be deleted?

Ross

On 6 December 2016 at 11:49, Andreas Oberritter <obi@opendreambox.org>
wrote:

> 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
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>

[-- Attachment #2: Type: text/html, Size: 8969 bytes --]

^ permalink raw reply	[flat|nested] 59+ messages in thread

* Re: [PATCH 20/33] package_manager/deb: let apt-get handle postinst scripts
  2016-12-06 17:26   ` Burton, Ross
@ 2016-12-06 18:20     ` Andreas Oberritter
  2016-12-06 18:24       ` Burton, Ross
  0 siblings, 1 reply; 59+ messages in thread
From: Andreas Oberritter @ 2016-12-06 18:20 UTC (permalink / raw)
  To: Burton, Ross; +Cc: OE-core

On 06.12.2016 18:26, Burton, Ross wrote:
> Can you elaborate on why the old code can be deleted?

With all required environment variables and configuration options in
apt.conf in place, apt-get is able to install packages offline, i.e.
when creating the rootfs, including the execution of postinst scripts
and updating the package database. This is new behaviour.

At the time the deleted code would have executed, its work was already
done by apt-get.

> 
> Ross
> 
> On 6 December 2016 at 11:49, Andreas Oberritter <obi@opendreambox.org
> <mailto:obi@opendreambox.org>> wrote:
> 
>     Signed-off-by: Andreas Oberritter <obi@opendreambox.org
>     <mailto: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
>     <http://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
> 
>     --
>     _______________________________________________
>     Openembedded-core mailing list
>     Openembedded-core@lists.openembedded.org
>     <mailto:Openembedded-core@lists.openembedded.org>
>     http://lists.openembedded.org/mailman/listinfo/openembedded-core
>     <http://lists.openembedded.org/mailman/listinfo/openembedded-core>
> 
> 



^ permalink raw reply	[flat|nested] 59+ messages in thread

* Re: [PATCH 20/33] package_manager/deb: let apt-get handle postinst scripts
  2016-12-06 18:20     ` Andreas Oberritter
@ 2016-12-06 18:24       ` Burton, Ross
  0 siblings, 0 replies; 59+ messages in thread
From: Burton, Ross @ 2016-12-06 18:24 UTC (permalink / raw)
  To: Andreas Oberritter; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 421 bytes --]

On 6 December 2016 at 18:20, Andreas Oberritter <obi@opendreambox.org>
wrote:

> With all required environment variables and configuration options in
> apt.conf in place, apt-get is able to install packages offline, i.e.
> when creating the rootfs, including the execution of postinst scripts
> and updating the package database. This is new behaviour.
>

Can you update the commit with this rationale?

Ross

[-- Attachment #2: Type: text/html, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 59+ messages in thread

* Re: [PATCH 01/33] dpkg: implement offline mode for update-alternatives
  2016-12-06 11:49 ` [PATCH 01/33] dpkg: implement offline mode for update-alternatives Andreas Oberritter
@ 2016-12-06 18:31   ` Burton, Ross
  0 siblings, 0 replies; 59+ messages in thread
From: Burton, Ross @ 2016-12-06 18:31 UTC (permalink / raw)
  To: Andreas Oberritter; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 682 bytes --]

On 6 December 2016 at 11:49, Andreas Oberritter <obi@opendreambox.org>
wrote:

> +++ b/meta/recipes-devtools/dpkg/dpkg/0003-update-alternatives-
> Implement-offline-mode.patch
> @@ -0,0 +1,399 @@
> +From b4f0f6ced469095a2b21ddddb01b59c7aded057e Mon Sep 17 00:00:00 2001
> +From: Andreas Oberritter <obi@opendreambox.org>
> +Date: Thu, 28 Aug 2014 05:20:21 +0200
> +Subject: [PATCH] update-alternatives: Implement offline mode
> +
> +Lets update-alternatives manage symlinks inside a cross-arch root
> +filesystem in a directory specified by DPKG_ROOT.
> +
> +Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
>

This patch needs an Upstream-Status.

Ross

[-- Attachment #2: Type: text/html, Size: 1211 bytes --]

^ permalink raw reply	[flat|nested] 59+ messages in thread

* Re: [PATCH 21/33] package_manager/deb: create Packages.xz
  2016-12-06 17:22   ` Burton, Ross
@ 2016-12-06 18:41     ` Andreas Oberritter
  2016-12-06 18:46       ` Burton, Ross
  0 siblings, 1 reply; 59+ messages in thread
From: Andreas Oberritter @ 2016-12-06 18:41 UTC (permalink / raw)
  To: Burton, Ross; +Cc: OE-core

On 06.12.2016 18:22, Burton, Ross wrote:
> 
> On 6 December 2016 at 11:49, Andreas Oberritter <obi@opendreambox.org
> <mailto:obi@opendreambox.org>> wrote:
> 
>     +        xz = bb.utils.which(os.getenv('PATH'), "xz")
> 
> 
> Are the relevant dependencies present to ensure that xz-native has been
> staged?  Is it always present because apt links to a library in xz so
> the binaries get pulled in too?

That's a good question. I guess I didn't add anything, because there's
no direct dependency in place for gzip-native either.

I don't know if it counts, but there's a dependency on apt-native and
apt's source tarball, like many others, is compressed with xz. By
default, apt also depends on xz because of PACKAGECONFIG = "lzma", but
that may obviously get changed by users.

Regards,
Andreas


^ permalink raw reply	[flat|nested] 59+ messages in thread

* Re: [PATCH 21/33] package_manager/deb: create Packages.xz
  2016-12-06 18:41     ` Andreas Oberritter
@ 2016-12-06 18:46       ` Burton, Ross
  2016-12-07  1:24         ` Andreas Oberritter
  0 siblings, 1 reply; 59+ messages in thread
From: Burton, Ross @ 2016-12-06 18:46 UTC (permalink / raw)
  To: Andreas Oberritter; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 706 bytes --]

On 6 December 2016 at 18:41, Andreas Oberritter <obi@opendreambox.org>
wrote:

> That's a good question. I guess I didn't add anything, because there's
> no direct dependency in place for gzip-native either.
>
> I don't know if it counts, but there's a dependency on apt-native and
> apt's source tarball, like many others, is compressed with xz. By
> default, apt also depends on xz because of PACKAGECONFIG = "lzma", but
> that may obviously get changed by users.
>

I guess the use of xz to create Packages.xz should depend on xz being
present, and then package_deb should explicitly add dependencies to the
relevant tasks (as it does for do_package and do_packageindex already).

Ross

[-- Attachment #2: Type: text/html, Size: 1157 bytes --]

^ permalink raw reply	[flat|nested] 59+ messages in thread

* Re: [PATCH 02/33] dpkg: update-alternatives-dpkg should conflict with other providers
  2016-12-06 11:49 ` [PATCH 02/33] dpkg: update-alternatives-dpkg should conflict with other providers Andreas Oberritter
@ 2016-12-06 19:52   ` Burton, Ross
  2016-12-07  1:30     ` Andreas Oberritter
  0 siblings, 1 reply; 59+ messages in thread
From: Burton, Ross @ 2016-12-06 19:52 UTC (permalink / raw)
  To: Andreas Oberritter; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 1538 bytes --]

This needs more than just RCONFLICTS:

ERROR: dpkg-native-1.18.7-r0 do_populate_sysroot: The recipe dpkg-native is
trying to install files into a shared area when those files already exist.
Those files and their manifest location are:

 /data/poky-master/tmp-glibc/sysroots/x86_64-linux/usr/bin/update-alternatives

I have both package_deb and package_rpm enabled, and have a build from
master before trying your branch.

Ross

On 6 December 2016 at 11:49, Andreas Oberritter <obi@opendreambox.org>
wrote:

> Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
> ---
>  meta/recipes-devtools/dpkg/dpkg.inc | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/meta/recipes-devtools/dpkg/dpkg.inc
> b/meta/recipes-devtools/dpkg/dpkg.inc
> index ec0117b..f7d9e77 100644
> --- a/meta/recipes-devtools/dpkg/dpkg.inc
> +++ b/meta/recipes-devtools/dpkg/dpkg.inc
> @@ -63,6 +63,7 @@ do_install_append () {
>  PACKAGES =+ "update-alternatives-dpkg"
>  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"
>
>  PACKAGES += "${PN}-perl"
>  FILES_${PN}-perl = "${libdir}/perl"
> --
> 2.7.4
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>

[-- Attachment #2: Type: text/html, Size: 2363 bytes --]

^ permalink raw reply	[flat|nested] 59+ messages in thread

* Re: [PATCH 28/33] dpkg: update packages and files to match Debian more closely
  2016-12-06 11:49 ` [PATCH 28/33] dpkg: update packages and files to match Debian more closely Andreas Oberritter
@ 2016-12-06 20:13   ` Burton, Ross
  2016-12-07  1:41     ` Andreas Oberritter
  0 siblings, 1 reply; 59+ messages in thread
From: Burton, Ross @ 2016-12-06 20:13 UTC (permalink / raw)
  To: Andreas Oberritter; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 737 bytes --]

On 6 December 2016 at 11:49, Andreas Oberritter <obi@opendreambox.org>
wrote:

> +RRECOMMENDS_dpkg-perl = "gnupg gpgv"
>

With plain master this causes a build failure:

ERROR: Multiple versions of gnupg are due to be built
(/home/ross/Yocto/poky/meta/recipes-support/gnupg/gnupg_2.1.14.bb
/home/ross/Yocto/poky/meta/recipes-support/gnupg/gnupg_1.4.7.bb). Only one
version of a given PN should be built in any given build. You likely need
to set PREFERRED_VERSION_gnupg to select the correct version or don't
depend on multiple versions.

As gnupg 1.4.7 provides gpgv, but 2.1.14 doesn't.

No idea where 2.1.14 should, what gpgv is, or what the solution is, as it's
late and I'm going to crash on the sofa. :)

Ross

[-- Attachment #2: Type: text/html, Size: 1541 bytes --]

^ permalink raw reply	[flat|nested] 59+ messages in thread

* Re: [PATCH 21/33] package_manager/deb: create Packages.xz
  2016-12-06 18:46       ` Burton, Ross
@ 2016-12-07  1:24         ` Andreas Oberritter
  0 siblings, 0 replies; 59+ messages in thread
From: Andreas Oberritter @ 2016-12-07  1:24 UTC (permalink / raw)
  To: Burton, Ross; +Cc: OE-core

On 06.12.2016 19:46, Burton, Ross wrote:
> 
> On 6 December 2016 at 18:41, Andreas Oberritter <obi@opendreambox.org
> <mailto:obi@opendreambox.org>> wrote:
> 
>     That's a good question. I guess I didn't add anything, because there's
>     no direct dependency in place for gzip-native either.
> 
>     I don't know if it counts, but there's a dependency on apt-native and
>     apt's source tarball, like many others, is compressed with xz. By
>     default, apt also depends on xz because of PACKAGECONFIG = "lzma", but
>     that may obviously get changed by users.
> 
> 
> I guess the use of xz to create Packages.xz should depend on xz being
> present, and then package_deb should explicitly add dependencies to the
> relevant tasks (as it does for do_package and do_packageindex already).

I'd prefer to be deterministic and cause an error if xz is not available
for whatever reason. I'm going to add the necessary dependency to all
callers of write_index() for deb.

Regards,
Andreas


^ permalink raw reply	[flat|nested] 59+ messages in thread

* Re: [PATCH 02/33] dpkg: update-alternatives-dpkg should conflict with other providers
  2016-12-06 19:52   ` Burton, Ross
@ 2016-12-07  1:30     ` Andreas Oberritter
  2016-12-08 16:16       ` Burton, Ross
  0 siblings, 1 reply; 59+ messages in thread
From: Andreas Oberritter @ 2016-12-07  1:30 UTC (permalink / raw)
  To: Burton, Ross; +Cc: OE-core

On 06.12.2016 20:52, Burton, Ross wrote:
> This needs more than just RCONFLICTS:
> 
> ERROR: dpkg-native-1.18.7-r0 do_populate_sysroot: The recipe dpkg-native
> is trying to install files into a shared area when those files already
> exist. Those files and their manifest location are:
>  
>  /data/poky-master/tmp-glibc/sysroots/x86_64-linux/usr/bin/update-alternatives
> 
> I have both package_deb and package_rpm enabled, and have a build from
> master before trying your branch.

I'm going to address this in "dpkg: implement offline mode for update-
alternatives" with the following additions:

+PROVIDES = "${@bb.utils.contains('PACKAGECONFIG', 'update-alternatives', 'virtual/update-alternatives', '', d)}"

[...]

+UA = "update-alternatives"
+UA_native = "${@['', 'update-alternatives'][d.getVar('PREFERRED_PROVIDER_virtual/update-alternatives-native', True) == 'dpkg-native']}"
+
+PACKAGECONFIG ??= "${UA}"
+PACKAGECONFIG[update-alternatives] = "--enable-update-alternatives,--disable-update-alternatives"

Because update-alternative-dpkg and update-alternatives-opkg are using
incompatible databases, I don't think there are much better ways to
avoid this conflict.

Regards,
Andreas


^ permalink raw reply	[flat|nested] 59+ messages in thread

* Re: [PATCH 28/33] dpkg: update packages and files to match Debian more closely
  2016-12-06 20:13   ` Burton, Ross
@ 2016-12-07  1:41     ` Andreas Oberritter
  0 siblings, 0 replies; 59+ messages in thread
From: Andreas Oberritter @ 2016-12-07  1:41 UTC (permalink / raw)
  To: Burton, Ross; +Cc: OE-core

On 06.12.2016 21:13, Burton, Ross wrote:
> 
> On 6 December 2016 at 11:49, Andreas Oberritter <obi@opendreambox.org
> <mailto:obi@opendreambox.org>> wrote:
> 
>     +RRECOMMENDS_dpkg-perl = "gnupg gpgv"
> 
> 
> With plain master this causes a build failure:
> 
> ERROR: Multiple versions of gnupg are due to be built
> (/home/ross/Yocto/poky/meta/recipes-support/gnupg/gnupg_2.1.14.bb
> <http://gnupg_2.1.14.bb>
> /home/ross/Yocto/poky/meta/recipes-support/gnupg/gnupg_1.4.7.bb
> <http://gnupg_1.4.7.bb>). Only one version of a given PN should be built
> in any given build. You likely need to set PREFERRED_VERSION_gnupg to
> select the correct version or don't depend on multiple versions.
> 
> As gnupg 1.4.7 provides gpgv, but 2.1.14 doesn't.
> 
> No idea where 2.1.14 should, what gpgv is, or what the solution is, as
> it's late and I'm going to crash on the sofa. :)

Version 1.4.7 splits-out gpgv to its own package. It can be used to
verify signatures, but can't encrypt or sign anything. I'm using it in
an initramfs for its small size, unrelated to dpkg though.

I didn't notice this, because I have PREFERRED_VERSION_gnupg set to
1.4.7, which however RDEPENDS on gpgv, so the obvious fix is:

RRECOMMENDS_dpkg-perl = "gnupg"

I don't remember where it came from, maybe I took it from Debian.

Thank you for your review! I'm going to update my branch now (obi/deb on
openembedded-core-contrib) with all your comments addressed, hopefully.
Do you want me to submit v2 to the mailing list, too?

Regards,
Andreas



^ permalink raw reply	[flat|nested] 59+ messages in thread

* Re: [PATCH 00/33] Accumulated patches for deb packaging
  2016-12-06 11:49 [PATCH 00/33] Accumulated patches for deb packaging Andreas Oberritter
                   ` (33 preceding siblings ...)
  2016-12-06 14:36 ` [PATCH 00/33] Accumulated patches for deb packaging Burton, Ross
@ 2016-12-07 12:25 ` Alexander Kanavin
  2016-12-07 15:30   ` Andreas Oberritter
  34 siblings, 1 reply; 59+ messages in thread
From: Alexander Kanavin @ 2016-12-07 12:25 UTC (permalink / raw)
  To: openembedded-core

On 12/06/2016 01:49 PM, Andreas Oberritter wrote:
> These are most of my patches which accumulated since our distro
> switched from opkg to dpkg and apt two years ago. They were tested
> thoroughly on dora and krogoth and just a little bit on master.

How about updating apt and dpkg to latest upstream releases at the same 
time?

Alex



^ permalink raw reply	[flat|nested] 59+ messages in thread

* Re: [PATCH 00/33] Accumulated patches for deb packaging
  2016-12-07 12:25 ` Alexander Kanavin
@ 2016-12-07 15:30   ` Andreas Oberritter
  2016-12-07 16:02     ` Alexander Kanavin
  0 siblings, 1 reply; 59+ messages in thread
From: Andreas Oberritter @ 2016-12-07 15:30 UTC (permalink / raw)
  To: Alexander Kanavin, openembedded-core

Hi Alex,

On 07.12.2016 13:25, Alexander Kanavin wrote:
> On 12/06/2016 01:49 PM, Andreas Oberritter wrote:
>> These are most of my patches which accumulated since our distro
>> switched from opkg to dpkg and apt two years ago. They were tested
>> thoroughly on dora and krogoth and just a little bit on master.
> 
> How about updating apt and dpkg to latest upstream releases at the same
> time?

I don't see an advantage over updating at a later point in time.

Regards,
Andreas



^ permalink raw reply	[flat|nested] 59+ messages in thread

* Re: [PATCH 00/33] Accumulated patches for deb packaging
  2016-12-07 15:30   ` Andreas Oberritter
@ 2016-12-07 16:02     ` Alexander Kanavin
  0 siblings, 0 replies; 59+ messages in thread
From: Alexander Kanavin @ 2016-12-07 16:02 UTC (permalink / raw)
  To: Andreas Oberritter, openembedded-core

On 12/07/2016 05:30 PM, Andreas Oberritter wrote:
>>> These are most of my patches which accumulated since our distro
>>> switched from opkg to dpkg and apt two years ago. They were tested
>>> thoroughly on dora and krogoth and just a little bit on master.
>>
>> How about updating apt and dpkg to latest upstream releases at the same
>> time?
>
> I don't see an advantage over updating at a later point in time.

The advantage is that oe-core does not accumulate technical debt that way.

Specifically, it's better to do many incremental version updates than 
few massive updates (or avoid updates altogether until the ongoing 
maintenance becomes unbearable, in the worst case). There is less 
changes in upstream code to deal with, less dependency fixing, and less 
resistance from community. This is actually the preferred mode of 
operation in oe-core. We are constantly fighting back against the 
increase in debt, and you could really help us here a bit.


Regards,
Alex


^ permalink raw reply	[flat|nested] 59+ messages in thread

* Re: [PATCH 02/33] dpkg: update-alternatives-dpkg should conflict with other providers
  2016-12-07  1:30     ` Andreas Oberritter
@ 2016-12-08 16:16       ` Burton, Ross
  2016-12-08 19:22         ` Andreas Oberritter
  0 siblings, 1 reply; 59+ messages in thread
From: Burton, Ross @ 2016-12-08 16:16 UTC (permalink / raw)
  To: Andreas Oberritter; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 1920 bytes --]

With PACKAGE_CLASSES="package_rpm package_deb" this happens:

ERROR: dpkg-native-1.18.7-r0 do_populate_sysroot: The recipe dpkg-native is
trying to install files into a shared area when those files already exist.
Those files and their manifest location are:

 /data/poky-master/tmp-glibc/sysroots/x86_64-linux/usr/bin/update-alternatives
 Matched in b'manifest-x86_64-opkg-utils-native.populate_sysroot'

Whilst I agree that building multiple package types at the same time is a
bit weird, it's always worked in the past.

Ross

On 7 December 2016 at 01:30, Andreas Oberritter <obi@opendreambox.org>
wrote:

> On 06.12.2016 20:52, Burton, Ross wrote:
> > This needs more than just RCONFLICTS:
> >
> > ERROR: dpkg-native-1.18.7-r0 do_populate_sysroot: The recipe dpkg-native
> > is trying to install files into a shared area when those files already
> > exist. Those files and their manifest location are:
> >
> >  /data/poky-master/tmp-glibc/sysroots/x86_64-linux/usr/bin/
> update-alternatives
> >
> > I have both package_deb and package_rpm enabled, and have a build from
> > master before trying your branch.
>
> I'm going to address this in "dpkg: implement offline mode for update-
> alternatives" with the following additions:
>
> +PROVIDES = "${@bb.utils.contains('PACKAGECONFIG', 'update-alternatives',
> 'virtual/update-alternatives', '', d)}"
>
> [...]
>
> +UA = "update-alternatives"
> +UA_native = "${@['', 'update-alternatives'][d.getVar('PREFERRED_PROVIDER_
> virtual/update-alternatives-native', True) == 'dpkg-native']}"
> +
> +PACKAGECONFIG ??= "${UA}"
> +PACKAGECONFIG[update-alternatives] = "--enable-update-alternatives,
> --disable-update-alternatives"
>
> Because update-alternative-dpkg and update-alternatives-opkg are using
> incompatible databases, I don't think there are much better ways to
> avoid this conflict.
>
> Regards,
> Andreas
>

[-- Attachment #2: Type: text/html, Size: 2602 bytes --]

^ permalink raw reply	[flat|nested] 59+ messages in thread

* Re: [PATCH 02/33] dpkg: update-alternatives-dpkg should conflict with other providers
  2016-12-08 16:16       ` Burton, Ross
@ 2016-12-08 19:22         ` Andreas Oberritter
  2016-12-22 13:37           ` Andreas Oberritter
  0 siblings, 1 reply; 59+ messages in thread
From: Andreas Oberritter @ 2016-12-08 19:22 UTC (permalink / raw)
  To: Burton, Ross; +Cc: OE-core

On 08.12.2016 17:16, Burton, Ross wrote:
> With PACKAGE_CLASSES="package_rpm package_deb" this happens:
> 
> ERROR: dpkg-native-1.18.7-r0 do_populate_sysroot: The recipe dpkg-native
> is trying to install files into a shared area when those files already
> exist. Those files and their manifest location are:
>  
>  /data/poky-master/tmp-glibc/sysroots/x86_64-linux/usr/bin/update-alternatives
>  Matched in b'manifest-x86_64-opkg-utils-native.populate_sysroot'
> 
> Whilst I agree that building multiple package types at the same time is
> a bit weird, it's always worked in the past.

Yes, I used this feature myself some time ago and don't want to be the
one breaking it. ;-)

Does this happen with the branch I pushed yesterday? Since commit
472899be2a97bf6c5741f6b414433e13cfea1c7b it shouldn't happen unless you
either explicitly enable update-alternatives in dpkg's PACKAGECONFIG, or
set PREFERRED_PROVIDER_virtual/update-alternatives-native to dpkg-native.

Regards,
Andreas



^ permalink raw reply	[flat|nested] 59+ messages in thread

* Re: [PATCH 02/33] dpkg: update-alternatives-dpkg should conflict with other providers
  2016-12-08 19:22         ` Andreas Oberritter
@ 2016-12-22 13:37           ` Andreas Oberritter
  0 siblings, 0 replies; 59+ messages in thread
From: Andreas Oberritter @ 2016-12-22 13:37 UTC (permalink / raw)
  To: Burton, Ross; +Cc: OE-core

On 08.12.2016 20:22, Andreas Oberritter wrote:
> On 08.12.2016 17:16, Burton, Ross wrote:
>> With PACKAGE_CLASSES="package_rpm package_deb" this happens:
>>
>> ERROR: dpkg-native-1.18.7-r0 do_populate_sysroot: The recipe dpkg-native
>> is trying to install files into a shared area when those files already
>> exist. Those files and their manifest location are:
>>  
>>  /data/poky-master/tmp-glibc/sysroots/x86_64-linux/usr/bin/update-alternatives
>>  Matched in b'manifest-x86_64-opkg-utils-native.populate_sysroot'
>>
>> Whilst I agree that building multiple package types at the same time is
>> a bit weird, it's always worked in the past.
> 
> Yes, I used this feature myself some time ago and don't want to be the
> one breaking it. ;-)
> 
> Does this happen with the branch I pushed yesterday? Since commit
> 472899be2a97bf6c5741f6b414433e13cfea1c7b it shouldn't happen unless you
> either explicitly enable update-alternatives in dpkg's PACKAGECONFIG, or
> set PREFERRED_PROVIDER_virtual/update-alternatives-native to dpkg-native.

Ross, did look into this?

Regards,
Andreas


^ permalink raw reply	[flat|nested] 59+ messages in thread

end of thread, other threads:[~2016-12-22 13:37 UTC | newest]

Thread overview: 59+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-06 11:49 [PATCH 00/33] Accumulated patches for deb packaging Andreas Oberritter
2016-12-06 11:49 ` [PATCH 01/33] dpkg: implement offline mode for update-alternatives Andreas Oberritter
2016-12-06 18:31   ` Burton, Ross
2016-12-06 11:49 ` [PATCH 02/33] dpkg: update-alternatives-dpkg should conflict with other providers Andreas Oberritter
2016-12-06 19:52   ` Burton, Ross
2016-12-07  1:30     ` Andreas Oberritter
2016-12-08 16:16       ` Burton, Ross
2016-12-08 19:22         ` Andreas Oberritter
2016-12-22 13:37           ` Andreas Oberritter
2016-12-06 11:49 ` [PATCH 03/33] dpkg-native: hardcode SYSCONFDIR to /etc in update-alternatives Andreas Oberritter
2016-12-06 15:39   ` Burton, Ross
2016-12-06 16:08     ` Andreas Oberritter
2016-12-06 16:12       ` Burton, Ross
2016-12-06 16:37         ` Andreas Oberritter
2016-12-06 17:07           ` Burton, Ross
2016-12-06 11:49 ` [PATCH 04/33] apt-native: Use option --force-script-chrootless for rootfs Andreas Oberritter
2016-12-06 11:49 ` [PATCH 05/33] package_manager/deb: pass option --force-script-chrootless to dpkg Andreas Oberritter
2016-12-06 11:49 ` [PATCH 06/33] debianutils: Allow native builds Andreas Oberritter
2016-12-06 11:49 ` [PATCH 07/33] apt-native: merge apt-native.inc into .bb Andreas Oberritter
2016-12-06 11:49 ` [PATCH 08/33] apt: merge apt-package.inc " Andreas Oberritter
2016-12-06 11:49 ` [PATCH 09/33] apt-native: use sed to prepare apt.conf.sample Andreas Oberritter
2016-12-06 11:49 ` [PATCH 10/33] apt: use default packaging rules for manpages Andreas Oberritter
2016-12-06 11:49 ` [PATCH 11/33] apt: use default packaging rules for base package, prepend apt-utils Andreas Oberritter
2016-12-06 11:49 ` [PATCH 12/33] apt: use default packaging rules for -dev package Andreas Oberritter
2016-12-06 11:49 ` [PATCH 13/33] apt: rewrite do_install Andreas Oberritter
2016-12-06 11:49 ` [PATCH 14/33] apt-native: drop obsolete patches Andreas Oberritter
2016-12-06 11:49 ` [PATCH 15/33] apt: merge with apt-native Andreas Oberritter
2016-12-06 11:49 ` [PATCH 16/33] apt: merge apt.inc into .bb Andreas Oberritter
2016-12-06 11:49 ` [PATCH 17/33] apt: group variables (license, configuration, packaging) Andreas Oberritter
2016-12-06 11:49 ` [PATCH 18/33] apt: more fine-grained packaging Andreas Oberritter
2016-12-06 11:49 ` [PATCH 19/33] apt: recommend gnupg Andreas Oberritter
2016-12-06 11:49 ` [PATCH 20/33] package_manager/deb: let apt-get handle postinst scripts Andreas Oberritter
2016-12-06 17:26   ` Burton, Ross
2016-12-06 18:20     ` Andreas Oberritter
2016-12-06 18:24       ` Burton, Ross
2016-12-06 11:49 ` [PATCH 21/33] package_manager/deb: create Packages.xz Andreas Oberritter
2016-12-06 17:22   ` Burton, Ross
2016-12-06 18:41     ` Andreas Oberritter
2016-12-06 18:46       ` Burton, Ross
2016-12-07  1:24         ` Andreas Oberritter
2016-12-06 11:49 ` [PATCH 22/33] package_manager/deb: implement BAD_RECOMMENDATIONS Andreas Oberritter
2016-12-06 11:49 ` [PATCH 23/33] dpkg: use PACKAGECONFIG Andreas Oberritter
2016-12-06 11:49 ` [PATCH 24/33] dpkg: set license field to more common "GPLv2+" Andreas Oberritter
2016-12-06 11:49 ` [PATCH 25/33] dpkg: clean-up packaging of start-stop-daemon Andreas Oberritter
2016-12-06 11:49 ` [PATCH 26/33] dpkg: remove unneeded do_configure override Andreas Oberritter
2016-12-06 11:49 ` [PATCH 27/33] dpkg: simplify replacing perl interpreter in scripts Andreas Oberritter
2016-12-06 11:49 ` [PATCH 28/33] dpkg: update packages and files to match Debian more closely Andreas Oberritter
2016-12-06 20:13   ` Burton, Ross
2016-12-07  1:41     ` Andreas Oberritter
2016-12-06 11:49 ` [PATCH 29/33] dpkg: always install dpkg-configure.service Andreas Oberritter
2016-12-06 11:49 ` [PATCH 30/33] dpkg: use correct path for perl libraries Andreas Oberritter
2016-12-06 11:49 ` [PATCH 31/33] package_deb.bbclass: compress control.tar with the same algorithm as data.tar Andreas Oberritter
2016-12-06 11:49 ` [PATCH 32/33] apt: fix rpath error during configure Andreas Oberritter
2016-12-06 11:49 ` [PATCH 33/33] apt: dselect depends on perl Andreas Oberritter
2016-12-06 14:36 ` [PATCH 00/33] Accumulated patches for deb packaging Burton, Ross
2016-12-06 16:00   ` Andreas Oberritter
2016-12-07 12:25 ` Alexander Kanavin
2016-12-07 15:30   ` Andreas Oberritter
2016-12-07 16:02     ` Alexander Kanavin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.