Alejandro del Castillo | 27 Aug 22:56 2015

[PATCH] opkg_archive: add support for empty compressed files

Regression from 0.2.x: opkg used to support empty Package.gz files.

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@...>
 libopkg/opkg_archive.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/libopkg/opkg_archive.c b/libopkg/opkg_archive.c
index be903e4..0a66606 100644
--- a/libopkg/opkg_archive.c
+++ b/libopkg/opkg_archive.c
 <at>  <at>  -121,6 +121,9  <at>  <at>  static int copy_to_stream(struct archive *a, FILE * stream)
     int eof;
     size_t len = EXTRACT_BUFFER_LEN;

+    if (archive_format(a) == ARCHIVE_FORMAT_EMPTY)
+	return 0;
     buffer = xmalloc(len);

     while (1) {
 <at>  <at>  -654,6 +657,13  <at>  <at>  static struct archive *open_compressed_file(const char *filename)
         goto err_cleanup;

+    r = archive_read_support_format_empty(ar);
+    if (r != ARCHIVE_OK) {
+        opkg_msg(ERROR, "Empty format not supported: %s\n",
+                 archive_error_string(ar));
+        goto err_cleanup;
(Continue reading)

Eric Yu | 14 Aug 18:27 2015

[PATCH 0/3] Add support for external dependency solvers.

This patch series introduces a plug-in architecture to enable opkg to use
external solvers to solve package dependencies and adds support to use
libsolv as an external solver. A github repo with all three patches can be
found at to make it easier to
see these changes.

Patch #1:
The first patch sets up the plug-in architecture for enabling the use of an
external solver. The --enable-solver=<SOLVER> option is added to
so that if it is enabled, solver specific code will be built and otherwise
opkg's default behaviour is preserved. Some of the code in opkg_cmd.c was moved
to its own file opkg_action.c to make the distinction between what is built with
a solver enabled and what is built without one cleaner. If an external solver is
enabled, opkg_solver.c will be built and opkg_cmd will make calls to the
functions withing opkg_solver. Otherwise, opkg_action.c will be built and opkg
will do what opkg currently does when given commands for install, remove, and
upgrade. To add functionality for a specific solver, first add an option in Then one can create a file (e.g opkg_solver_somesolver.c) which
will handle calls to the solver, and then edit opkg_solver.c by adding #ifdef
directives (e.g #ifdef HAVE_SOMESOLVER) and calls to functions in that file to
handle install, remove, and upgrade. For an example, see the third patch which
adds functionality for using libsolv.

Patch #2:
The second patch attempts to make it so opkg does not build code used for
ad-hoc dependency solving when it is configured to use an external solver.
This is done by moving functions involved in opkg's ad-hoc solving in the
opkg_install.c, opkg_remove.c, and pkg_depends.c files to the end of the file
and surrounding them with an #ifndef HAVE_SOLVER. Because this change involved
shuffling some functions around to minimize the number of #ifndef directives
(Continue reading)

Alejandro del Castillo | 10 Aug 22:19 2015

Opkg SAT Solver support


For the next opkg release, I have been helping Eric Yu add support for a SAT
solver backend for opkg. I am pretty excited with the results so far, as using a
solver (in this case, libsolv, but the architecture allows for other backends)
removes all the dependency complexity from opkg and into a library used by other
package mangers (DMF, Zypper). By enabling the backed, issues 85, 162, 163 & 165
were automatically solved.

The price to pay is a dependency on libsolv (~600k library on x64). For targets
that need to stay small, the current ad-hoc solver will continue to be available.

Eric will be submitting patches with his work pretty soon.




Nicholas Clark | 6 Aug 01:33 2015

OPKG patches

Hi all,

Long-time user, first time contributer! :)

I have a few patches to submit for OPKG. They're built against v0.3.0.

In order:

Patch #1: Adds a missing <stdio.h> inclusion to file_util.h, to allow
OPKG to compile for Cygwin.
Patch #2: Adds (int) casts where required to eliminate warnings issued
by -Wchar-subscripts.
Patch #3: Fixes a segfault under Cygwin when calling OPKG with certain
faulty command-line arguments.
Patch #4: Adds an optional 'ignore_uids' field to the OPKG conf
structure. When activated in a config file, OPKG tells librarchive to
ignore UIDs/GIDs while installing packages.


You received this message because you are subscribed to the Google Groups "opkg-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to opkg-devel+unsubscribe@...
For more options, visit
Alejandro del Castillo | 5 Aug 23:51 2015

Opkg bug reporting move to bugzilla


Since google code is going away, the new home for opkg bugs will be bugzilla,
under the Yocto project umbrella ( There is
already a new category for opkg, so all new bugs should be filed on bugzilla,
instead of on google code.

On the next few days I will be migrating all the open issues on google code into
bugzilla. As part of the migration, I will rename the existing failing tests
with their new bugzilla number (and add notes to reference google code). I will
also upload to the repo a document with all the closed bugs, for future
reference, in case it's needed.

I encourage everyone to file the bugs you encounter during opkg use. We don't
have that many reported bugs (and I am pretty sure there are several lurking



Eric Yu | 5 Aug 20:45 2015

[PATCH] pkg_hash.c: Fix bug in pkg_hash_fetch_by_name_version

This change fixes a bug in pkg_hash_fetch_by_name_version where an
incorrectly written comparison causes the wrong package to be returned.

Signed-off-by: Eric Yu <eric.yu@...>
Acked-by: Alejandro del Castillo <alejandro.delcastillo@...>
 libopkg/pkg_hash.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libopkg/pkg_hash.c b/libopkg/pkg_hash.c
index 5d04ee2..1123244 100644
--- a/libopkg/pkg_hash.c
+++ b/libopkg/pkg_hash.c
 <at>  <at>  -581,7 +581,7  <at>  <at>  pkg_t *pkg_hash_fetch_by_name_version(const char *pkg_name, const char *version)

     for (i = 0; i < vec->len; i++) {
         version_str = pkg_version_str_alloc(vec->pkgs[i]);
-        if (strcmp(version_str, version) != 0) {
+        if (strcmp(version_str, version) == 0) {


Eric Yu | 4 Aug 00:57 2015

[PATCH 0/8] Add missing tests

This patch series adds tests for several features including essential packages, relational
dependencies, force options, --prefer-arch-to-version, and autoremove. This series also adds tests
for issues 162, 163, and 165.

Eric Yu (8):
  tests/ Add support for essential
  tests/ support flags in upgrade and is_installed
  tests/core: Add tests for several options
  tests/core: Add test for --prefer-arch-to-version
  tests/regress: Add test for issue 162
  tests/regress: Add test for issue 163
  tests/regress: Add tests for issue 165
  tests/core: Add tests for relational dependencies

 tests/Makefile                          | 16 +++++++++
 tests/core/             | 51 ++++++++++++++++++++++++++
 tests/core/  | 55 ++++++++++++++++++++++++++++
 tests/core/          | 47 ++++++++++++++++++++++++
 tests/core/                 | 26 ++++++++++++++
 tests/core/              | 48 +++++++++++++++++++++++++
 tests/core/ | 42 ++++++++++++++++++++++
 tests/core/             | 48 +++++++++++++++++++++++++
 tests/core/           | 61 +++++++++++++++++++++++++++++++
 tests/core/             | 61 +++++++++++++++++++++++++++++++
 tests/core/           | 63 +++++++++++++++++++++++++++++++++
 tests/core/             | 48 +++++++++++++++++++++++++
 tests/                            |  2 +-
 tests/                         |  8 ++---
 tests/regress/               | 57 +++++++++++++++++++++++++++++
 tests/regress/               | 52 +++++++++++++++++++++++++++
(Continue reading)

Alejandro del Castillo | 31 Jul 23:47 2015

[PATCH 1/2] test/regress: Add test for issue 156

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@...>
 tests/Makefile            |  1 +
 tests/regress/ | 61 +++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 62 insertions(+)
 create mode 100755 tests/regress/

diff --git a/tests/Makefile b/tests/Makefile
index 707434f..7269d32 100644
--- a/tests/Makefile
+++ b/tests/Makefile
 <at>  <at>  -39,6 +39,7  <at>  <at>  REGRESSION_TESTS := core/ \
 		    regress/ \
 		    regress/ \
 		    regress/ \
+		    regress/ \
 		    misc/ \
 RUN_TESTS := $(
diff --git a/tests/regress/ b/tests/regress/
new file mode 100755
index 0000000..eca864d
--- /dev/null
+++ b/tests/regress/
 <at>  <at>  -0,0 +1,61  <at>  <at> 
+# Reporter: alexeytech@...
+# What steps will reproduce the problem?
(Continue reading)

opkg | 31 Jul 22:13 2015

Issue 167 in opkg: With circular dependencies, all installed packages are marked as autoinstalled

Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 167 by ericaust...@...: With circular dependencies,
installed packages are marked as autoinstalled

What steps will reproduce the problem?
1. Create package 'a' that depends on 'b'
2. Create package 'b' that depends on 'a'
3. opkg install a

What is the expected output? What do you see instead?
I expect 'a' and 'b' to be installed, and 'b' to be marked  
as 'autoinstalled' while 'a' is not marked as autoinstalled because it was  
explicitly installed.

Instead both 'a' and 'b' are marked as autoinstalled.

What version of the product are you using? On what operating system?
0.3.0 Linux Mint 17.1 x64

Please provide any additional information below.


You received this message because this project is configured to send all  
issue notifications to this address.
You may adjust your notification preferences at:
(Continue reading)

opkg | 23 Jul 22:48 2015

Issue 166 in opkg: opkg compare_versions is broken

Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 166 by ericaust...@...: opkg compare_versions is broken

What steps will reproduce the problem?
1. in a shell, run `opkg compare_versions` with various versions and  

What is the expected output? What do you see instead?
When comparing things in Linux, it is typical for 0 to be returned if a  
condition is satisfied and a non-zero value otherwise. The compare_versions  
command in opkg does the opposite. Furthermore, several checks return the  
incorrect value (e.g. 1.0 '=' 1.0 and 1.0 '<<' 1.0 will return 0, while  
1.0 '>>' 1.0 will return 1). For reference, calling `dpkg  
--compare-versions 1.0 '=' 1.0` will return 0, while `dpkg  
--compare-versions 1.0 '<<' 1.0` and `dpkg --compare-versions 1.0 '>>' 1.0`  
return 1.

What version of the product are you using? On what operating system?
0.3.0, Linux Mint 17.1 x64

Please provide any additional information below.
Functionality for checking versions is also provided in opkg-utils in  
opkg-compare-versions.c . Since the current implementation in opkg_cmd.c is  
broken and the proper functionality is included in opkg-utils, perhaps we  
can pull this command out from opkg and encourage the use of the version  
comparison functionality in opkg-utils instead?
(Continue reading)

opkg | 17 Jul 18:02 2015

Issue 165 in opkg: Packages fail to install when Recommends can't be installed

Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 165 by ericaust...@...: Packages fail to install when  
Recommends can't be installed

What steps will reproduce the problem?
1.Create packages 'x', 'a', and 'b' such that 'a' recommends 'b', and 'b'  
conflicts 'x'
2. Install 'x'
3. Try to install 'a'

What is the expected output? What do you see instead?
I expect 'a' to be installed, since 'b' is not an absolute dependency  
of 'a'.

Instead, nothing is installed.

What version of the product are you using? On what operating system?

Please provide any additional information below.
There are several other set-ups that cause related problems. For example  
if 'a' recommends 'b' and 'c', but 'c' conflicts with 'x', then only 'b' is  
installed and 'a' remains uninstalled. Note this is different from issue  
162 since we do expect the non-conflicting packages to be installed in this  
case since recommends does not signal an absolute dependency. Similarly,  
if 'a' recommends 'b' and 'b' recommends 'c', but 'c' conflicts with 'x',  
(Continue reading)