opkg:master

Last commit made on 2024-04-29
Get this branch:
git clone -b master https://git.launchpad.net/opkg

Branch merges

Branch information

Name:
master
Repository:
lp:opkg

Recent commits

b1f1936... by Alex Stewart <email address hidden>

configure.ac: bump to version 0.7.0+git

This next version bump will include several API-breaking changes.
Including:
* marking the internal sat solver as formally deprecated.
* changes to the CLI arguments.
* changes to the error reporting strings.

Due to these changes, bump the minor rev.

Signed-off-by: Alex Stewart <email address hidden>

13ae7ea... by Etienne Cordonnier <email address hidden>

libopkg: make error messages easier to grep for

opkg is used e.g. as part of the yocto rootfs creation, where many packages are
installed. When there is an error, a log file with thousands of lines is
created, and people typically search for "error".

Thus, let's prefix error messages with "error: " instead of "* " which is easy to miss.

Before:
    * check_data_file_clashes: Package systemd wants to install file build/tmp-glibc/work/my-arch/my-image/1234/rootfs/usr/bin/foobar
    But that file is already provided by package * foo-package

After:
    error: check_data_file_clashes: Package systemd wants to install file build/tmp-glibc/work/my-arch/my-image/1234/rootfs/usr/bin/foobar
    But that file is already provided by package foo-package

Signed-off-by: Etienne Cordonnier <email address hidden>
Signed-off-by: Alex Stewart <email address hidden>

c35d971... by Philip Lorenz <email address hidden>

opkg: Fix memory leaks in config handling

* fields_filter is a CLI-only option but was never freed
* The temporary buffer used to hold the tmpdir template was never freed
  when mkdtemp failed

Signed-off-by: Philip Lorenz <email address hidden>
Signed-off-by: Alex Stewart <email address hidden>

889f57d... by Philip Lorenz <email address hidden>

opkg: Add --install-recommends command line option

The command line option can be used to enforce installation of
recommendations even when they are disabled via the
"no_install_recommends" configuration option.

Signed-off-by: Philip Lorenz <email address hidden>
Signed-off-by: Alex Stewart <email address hidden>

b0a3d28... by Philip Lorenz <email address hidden>

opkg: Split command line argument parsing into 2 stages

Currently, command line arguments are parsed before the configuration
file is read, hence making it impossible to disable boolean options once
they have been enabled via a configuration file option.

To enable this functionality, this patch splits command line argument
parsing into the following stages:

1. Parse all command line arguments needed for configuration file
   parsing. This includes verbosity settings, the offline root and the
   path to a custom configuration file.
2. Parse all other command line arguments.

Stage 2 is only performed after the configuration file has been loaded
thus allowing all options read from the configuration to be overridden
again.

Signed-off-by: Philip Lorenz <email address hidden>
Signed-off-by: Alex Stewart <email address hidden>

6643d6c... by Philip Lorenz <email address hidden>

opkg: Clean up command line parsing

The special value ':' will only be returned if the option string beings
with the ':' modifier. As this isn't the case here it doesn't need to be
handled specifically.

Additionally, rephrase the error message printed when an unhandled
return value is encountered.

Signed-off-by: Philip Lorenz <email address hidden>
Signed-off-by: Alex Stewart <email address hidden>

fe5e2db... by Philip Lorenz <email address hidden>

libopkg: Split out config finalization from config loading

opkg_conf_load() currently loads the configuration from a file and then
proceeds to finalize the config structure by filling in default values
or building the final config values based on other config parameters
(e.g. the offline root).

To enable overwriting of config options from the command line the
finalization phase is split out so it can be called only after the
command line arguments have been processed for the second time.

To retain API compatibility, opkg_conf_load() continues to read and
finalize the config. If the staged approach is desired opkg_conf_read()
followed by a opkg_conf_finalize() shall be used.

Signed-off-by: Philip Lorenz <email address hidden>
Signed-off-by: Alex Stewart <email address hidden>

f12d41f... by Philip Lorenz <email address hidden>

libopkg: Simplify cleanup of opkg_conf

Move freeing of resources claimed by opkg_config into a dedicated helper
function. This allows reuse in the upcoming two stage argument parsing
and also reduces the numbers of labels needed to perform the actual
freeing of memory.

This change is safe as the individual cleanup methods already check
whether the resource that should be freed has actually been allocated.

Signed-off-by: Philip Lorenz <email address hidden>
Signed-off-by: Alex Stewart <email address hidden>

b5cc53d... by Philip Lorenz <email address hidden>

libopkg: Drop spurious error check

"r" was never changed in between this and the previous check.

Signed-off-by: Philip Lorenz <email address hidden>
Signed-off-by: Alex Stewart <email address hidden>

ee74987... by Philip Lorenz <email address hidden>

tests: Fix typo

The variable is named DEBUG_OPKG_CMDS

Signed-off-by: Alex Stewart <email address hidden>