opkg.git
3 weeks agoopkg-key: whitelist gpg.conf during reset master
Alejandro del Castillo [Fri, 22 Feb 2019 18:25:08 +0000 (12:25 -0600)]
opkg-key: whitelist gpg.conf during reset

Exclude gpg.conf file from reset, since that file is meant to be used to
customize how gpg works.

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
4 weeks agolibsolv_solver_execute_transaction: propagate download error
Alejandro del Castillo [Tue, 12 Feb 2019 20:39:29 +0000 (14:39 -0600)]
libsolv_solver_execute_transaction: propagate download error

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
4 weeks agoopkg_download: propagate error if download fails
Alejandro del Castillo [Tue, 12 Feb 2019 20:38:30 +0000 (14:38 -0600)]
opkg_download: propagate error if download fails

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
5 weeks agolibopkg/pkg.c: Check downloaded file size in pkg_verify()
Haris Okanovic [Mon, 4 Feb 2019 21:40:30 +0000 (15:40 -0600)]
libopkg/pkg.c: Check downloaded file size in pkg_verify()

Hash algorithms (particularly weak ones like md5) are susceptible to
hash collisions -- a condition where two files/strings results in the
same hash. This can be exploited, e.g. to defeat digital signatures, by
padding malicious files with garbage data to coerce an identical hash
to that of legitimately signed files. Such exploits are significantly
harder when file size cannot change.

This change adds a file size constraint to pkg_verify() before checking
hashes: Downloaded IPKs must have the same file size that's encoded in
feed index (Packages file).

This is particularly useful when using opkg with signed feeds, I.e.
feeds with signed Packages files of otherwise unsigned IPKs. It makes
it harder to defeat the enclosed hashes.

Signed-off-by: Haris Okanovic <haris.okanovic@ni.com>
Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
5 weeks agotests/opkgcl.py: Add DEBUG_OPKG_CMDS env flag
Haris Okanovic [Mon, 4 Feb 2019 21:40:29 +0000 (15:40 -0600)]
tests/opkgcl.py: Add DEBUG_OPKG_CMDS env flag

Running `DEBUG_OPKG_CMDS=1 make check` prints every opkg cmdline and
it's resulting stdout/stderr during tests. This change makes it easier
to debug problems during tests. Seeing opkg's stderr on failures is
particularly useful.

Signed-off-by: Haris Okanovic <haris.okanovic@ni.com>
Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
6 weeks agolibopkg: add --add-ignore-recommends option
Alejandro del Castillo [Fri, 1 Feb 2019 00:16:08 +0000 (18:16 -0600)]
libopkg: add --add-ignore-recommends option

Add option to ignore specific recommended packages. On the libsolv
backed, this feature will only work on libsolv version > 0.7.2 [1].

[1] https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_openSUSE_libsolv_issues_254&d=DwIBaQ&c=I_0YwoKy7z5LMTVdyO6YCiE2uzI1jjZZuIPelcSjixA&r=wNcrL2akRn6jfxhHaKavUrJB_C9JAMXtynjLd8ZzgXQ&m=GObNHzFJpWpf_PripIrf-K2RhsktYdAUEieAJexXOKw&s=3G-meChUqClFggFPqsrAxIZBfLnRKIHm62Uuy1X6nQQ&e=

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
6 weeks agolibsolv_solver_init: make --no-install-recommends case consistent
Alejandro del Castillo [Thu, 31 Jan 2019 20:00:59 +0000 (14:00 -0600)]
libsolv_solver_init: make --no-install-recommends case consistent

Currently, the --no-install-recommends case doesn't set the flag
SOLVER_FLAG_INSTALL_ALSO_UPDATES, which causes inconsitent behavior
between installs with/without the flag. To be consistent, always set the
flag.

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
6 weeks agoopkg_gpg: Move pubkeys from /etc/opkg/*.gpg --> /etc/opkg/gpg/
Haris Okanovic [Sat, 26 Jan 2019 00:50:21 +0000 (18:50 -0600)]
opkg_gpg: Move pubkeys from /etc/opkg/*.gpg --> /etc/opkg/gpg/

gpgme/gpg generates many files during runtime inside it's homedir.
Many are undocumented implementation details that may change
version-to-version, and thus difficult to manage by opkg.
Dual-purposing opkg's config dir this way makes it impossible to sanely
implement `opkg-key reset` and adds otherwise unnecessary noise around
opkg's configuration files.

This change moves gpg's homedir to /etc/opkg/gpg/, a subdirectory of
opkg's config dir, and fixes `opkg-key reset` to delete everything.

Additionally, it simplifies how gpg in invoked to add/remove/list keys.
This is necessary to avoid a format change of gpg's homedir on when
using gpg 2.2+. gpg is now invoked with a `--homedir /etc/opkg/gpg/`
parameter instead specifying individual files.

This are unfortunately a breaking change (if gpg is enabled)!

You can preserve existing pubkeys in gpg_dir one of the following ways:

 (a) Move trusted.gpg, secring.gpg, and trustdb.gpg to the new gpg
     subdirectory under opkg's config dir. This is only safe before
     first use (while gpg dir is empty), otherwise it may overwrite
     newly added keys.

 (b) Add `option gpg_dir /etc/opkg` in opkg.conf to revert back to
     old directory layout. You should avoid using opkg-key in this
     case, since it doesn't respect non-default gpg_dir.

Also note that running `opkg-key populate` still reloads key files from
/usr/share/opkg/keyrings/. If you keep a copy of trusted pubkeys in that
directory, it may be sufficient to simply re-populate them instead of
migrating gpg_dir.

Signed-off-by: Haris Okanovic <haris.okanovic@ni.com>
Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
6 weeks agoopkg_gpg: Load pubkeys with gpgme_op_keylist_*()
Haris Okanovic [Sat, 26 Jan 2019 00:50:20 +0000 (18:50 -0600)]
opkg_gpg: Load pubkeys with gpgme_op_keylist_*()

Load public keys using gpgme_op_keylist_*() API to better decouple opkg
from gpg internals. Paths and formats of files within gpg's homedir can
change versions-to-version. E.g. gpg 2.2 requires pubkeys to be present
in pubring.kbx to verify signatures, among other changes to homedir.
Using the keylist insulates opkg from such changes.

Signed-off-by: Haris Okanovic <haris.okanovic@ni.com>
Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
6 weeks agofile_util.c: file_mkdir_hier(): Avoid overly permissive umask
Haris Okanovic [Sat, 26 Jan 2019 00:50:19 +0000 (18:50 -0600)]
file_util.c: file_mkdir_hier(): Avoid overly permissive umask

This change runs mkdir() with the caller's mode in addition to setting
it explicitly with chmod(). It ensure newly created directories never
have overly permissive access, regardless of the process umask.

Prior to this change, file_mkdir_hier() would create directories by
calling mkdir(mode=0777) then chmod() to set a more appropriate mode.
This is normally not an issue when a sane umask is set. However, there's
a brief security risk when called with an overly permissive umask:
New directories briefly had world write access.

Signed-off-by: Haris Okanovic <haris.okanovic@ni.com>
Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
7 weeks agobump version to 0.4.1-SNAPSHOT
Alejandro del Castillo [Mon, 28 Jan 2019 21:44:27 +0000 (15:44 -0600)]
bump version to 0.4.1-SNAPSHOT

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
2 months agoNEWS: update to v0.4.0 v0.4.0
Alejandro del Castillo [Wed, 26 Dec 2018 17:22:43 +0000 (11:22 -0600)]
NEWS: update to v0.4.0

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
2 months agoconfigure.ac: bump version to 0.4.0
Alejandro del Castillo [Wed, 26 Dec 2018 16:43:25 +0000 (10:43 -0600)]
configure.ac: bump version to 0.4.0

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
2 months agoopkg: clean and consolidate help
Alejandro del Castillo [Thu, 20 Dec 2018 21:21:03 +0000 (15:21 -0600)]
opkg: clean and consolidate help

The man page was out of sync with the command line help. Make help
consistent.

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
2 months agolibopkg: error out if feeds are sha256 and --enable-sha256=false
Alejandro del Castillo [Thu, 20 Dec 2018 21:49:08 +0000 (15:49 -0600)]
libopkg: error out if feeds are sha256 and --enable-sha256=false

If a feed only has SHA256sum checksums, and opkg is not configured with
--enable-sha256 (and --force-checsum was not specified), the checksum is
not enforced. Abort operation instead.

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
3 months agolibopkg: Add --short-description command line argument.
Dan Mondrik [Wed, 28 Nov 2018 22:26:02 +0000 (16:26 -0600)]
libopkg: Add --short-description command line argument.

The commands 'info' and 'status' now support the --short-description flag to
display only the first line of the Description. This allows client parsing of
the results to be simpler and faster.

Signed-off-by: Dan Mondrik <dan.mondrik@ni.com>
Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
3 months agolibopkg: add --fields command line argument
Dan Mondrik [Wed, 28 Nov 2018 22:09:57 +0000 (16:09 -0600)]
libopkg: add --fields command line argument

The commands 'info' and 'status' now support the --fields command line
argument with a comma delimited list of fields the user wants displayed.
This allows client parsing of the results to be simpler and faster.

Signed-off-by: Dan Mondrik <dan.mondrik@ni.com>
Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
3 months agolibopkg: add support for lz4 compression
Alejandro del Castillo [Mon, 19 Nov 2018 16:04:42 +0000 (10:04 -0600)]
libopkg: add support for lz4 compression

Add optional support for lz4 compression (disabled by default).

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
4 months agoEnsure octal mode values are always printed with a 0 prefix.
Michael Hansen [Wed, 14 Nov 2018 22:37:07 +0000 (14:37 -0800)]
Ensure octal mode values are always printed with a 0 prefix.

This fixes an error with my previous change which could cause the mode
number to be misinterpreted by readers of the .list file.

Signed-off-by: Michael Hansen <michael.j.hansen@hp.com>
Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
4 months agopkg.c: Write the mode and symlink target to the .list file and use it if possible...
Michael Hansen [Tue, 13 Nov 2018 21:00:47 +0000 (13:00 -0800)]
pkg.c: Write the mode and symlink target to the .list file and use it if possible instead of re-checking every file's mode and symlink target. This should fix #12648.

Note that the .list reader already treats the new fields as optional,
so list files created by previous versions of opkg should "just work",
and will only be rewritten with the new format when the package is
reinstalled.

Signed-off-by: Michael Hansen <michael.j.hansen@hp.com>
Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
6 months agoremove_maintainer_scripts: use strict matching
Alejandro del Castillo [Tue, 4 Sep 2018 23:06:00 +0000 (18:06 -0500)]
remove_maintainer_scripts: use strict matching

The function is using a glob to select which metadata files needs to be
deleted during package removal, on the info_dir. However, the glob may
match metadata files from packages with similar names. For example,
during removal of package glibc-binary-localedata-de-at, the current
logic was also removing the metadata for
glibc-binary-localedata-de-at.iso-8859-1. Add check for an exact match
before deletion.

Fixes bugzilla: 12905

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
6 months agolibsolv_solver_execute_transaction: abort transaction on first failure
Alejandro del Castillo [Thu, 30 Aug 2018 16:58:15 +0000 (11:58 -0500)]
libsolv_solver_execute_transaction: abort transaction on first failure

If package A depends on B, and B is corrupted, if you install A, opkg
will try to install B, fail and continue installing A. Change logic to
abort the transaction on first failure. This is consistent with the
internal solver behavior.

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
8 months agopopulate_installed_repo: add Essential field support
Alejandro del Castillo [Tue, 19 Jun 2018 18:55:45 +0000 (13:55 -0500)]
populate_installed_repo: add Essential field support

Debian "Essential" field is being enforced at package removal time,
instead of at solve time. This is problematic, since other packages can
be removed before the Essential package is processed. For each installed
Essential package, add a job that will ensure the package will stay
installed (but upgradable).

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
11 months agolibsolv_solver_transaction_preamble: add arch information to get matching package
Alejandro del Castillo [Wed, 28 Mar 2018 18:53:56 +0000 (13:53 -0500)]
libsolv_solver_transaction_preamble: add arch information to get matching package

The function pkg_hash_fetch_by_name_version is called to find the pkg
object that corresponds to the solvable returned by libsolv. The
matching is done using name and version, which is incomplete as there
might be several packages with the same name/version, but with different
architecture. Add architecture information to the comparision.

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
12 months agosrc/opkg.c: remove getopt_long_only case
Alejandro del Castillo [Thu, 22 Feb 2018 20:21:50 +0000 (14:21 -0600)]
src/opkg.c: remove getopt_long_only case

Opkg doesn't document the use of long option with only one minus (like
-verbose=4). On commit a77bdf, a configure option was added to support
both getopt_long and getopt_long_only since it was late on the 0.3.6
release. Now that we are starting the development window for 0.4.0, make
sense to remove getopt_long_only all together.

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
12 months agobump version to 0.4.0-SNAPSHOT
Alejandro del Castillo [Thu, 22 Feb 2018 20:07:01 +0000 (14:07 -0600)]
bump version to 0.4.0-SNAPSHOT

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
12 months agoNEWS: update to v0.3.6 v0.3.6
Alejandro del Castillo [Mon, 19 Feb 2018 17:08:43 +0000 (11:08 -0600)]
NEWS: update to v0.3.6

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
12 months agoconfigure.ac: bump version to 0.3.6
Alejandro del Castillo [Mon, 19 Feb 2018 16:46:35 +0000 (10:46 -0600)]
configure.ac: bump version to 0.3.6

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
12 months agolibopkg/pkg_hash.c: fix possible infinite loop
Michał Łyszczek [Fri, 16 Feb 2018 22:58:05 +0000 (23:58 +0100)]
libopkg/pkg_hash.c: fix possible infinite loop

Checking if unsigned type is bigger or equal to zero is always true
which leads to infinite loop.

Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
12 months agosrc/opkg.c: use getopt_long if getopt_long_only is not available
Michał Łyszczek [Fri, 16 Feb 2018 22:51:17 +0000 (23:51 +0100)]
src/opkg.c: use getopt_long if getopt_long_only is not available

Some systems lack getopt_long_only function (for example NetBSD) which
leads to unidefined symbols during linking step. Use getopt_long
if getopt_long_only is not available. This prevents users from
using long option with only one minus (like -verbose=4) but it's
better than compilation error.

Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
12 months agosrc, libopkg: don't use non-portable malloc.h
Michał Łyszczek [Fri, 16 Feb 2018 22:25:30 +0000 (23:25 +0100)]
src, libopkg: don't use non-portable malloc.h

Since malloc.h is an extension to the language and is not available
on all systems (like BSD family), stdlib.h should be used instead,
which defines malloc function family.

Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
13 months agopopulate_available_repos: make missing packages solvable non-version constrained
Alejandro del Castillo [Mon, 12 Feb 2018 20:18:05 +0000 (14:18 -0600)]
populate_available_repos: make missing packages solvable non-version constrained

If a Package index is stale, installations might fail, leaving the
status file with entries for missing packages. Those entries add
solvables that need to match specific versions, which is too
restrictive as newer versions of the same package are likely to satisfy
the dependency tree.

Fixes bugzilla #8351
(test case provided by Julia Cartwright)

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
13 months agoopkg_conf_write_status_file: avoid duplicate entries
Alejandro del Castillo [Mon, 12 Feb 2018 20:18:04 +0000 (14:18 -0600)]
opkg_conf_write_status_file: avoid duplicate entries

If a pkg creates an entry at a particular version during a failed
install (out of date index), a later install may create a duplicated
entry at a different version. Avoid duplication, and make sure the
installed version takes precedence.

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
13 months agoopk.py: add removeOpk method
Julia Cartwright [Mon, 12 Feb 2018 20:18:03 +0000 (14:18 -0600)]
opk.py: add removeOpk method

Signed-off-by: Julia Cartwright <julia.cartwright@ni.com>
Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
13 months agoopk.py: return opk object on add
Julia Cartwright [Mon, 12 Feb 2018 20:18:02 +0000 (14:18 -0600)]
opk.py: return opk object on add

Signed-off-by: Julia Cartwright <julia.cartwright@ni.com>
Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
13 months agoopkg_download.c: add missing libgen.h include
Michał Łyszczek [Sat, 10 Feb 2018 22:12:02 +0000 (23:12 +0100)]
opkg_download.c: add missing libgen.h include

Without libgen.h compiler doesn't know prototype for basename, and it
makes some bad assumptions which causes segfault on amd64 dragonfly os.

Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
13 months agolibsolv_solver_execute_transaction: add case for obsolete packages
Alejandro del Castillo [Tue, 30 Jan 2018 16:14:07 +0000 (10:14 -0600)]
libsolv_solver_execute_transaction: add case for obsolete packages

Given a system that have package 'a' installed, where both package 'a'
and 'b' Replaces/Conflicts/Provides 'v'. Installing package 'b' should
remove 'a' first. Currently, that operation is expressed as install b,
remove a, which end up running the maintainer scripts in the wrong
order. Add code to treat the Obsolete operation separetely, as a remove
a, install b.

bugzilla #11362

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
13 months agoopkg_install_pkg: remove unused parameter from_upgrade
Alejandro del Castillo [Mon, 29 Jan 2018 18:03:14 +0000 (12:03 -0600)]
opkg_install_pkg: remove unused parameter from_upgrade

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
13 months agotests/misc/update_loses_autoinstalled_flag.py: update test
Alejandro del Castillo [Mon, 29 Jan 2018 11:39:19 +0000 (05:39 -0600)]
tests/misc/update_loses_autoinstalled_flag.py: update test

- Remove old bug switch
- Only execute last case when using the internalsolver. Upgrade
behavior on libsolv doesn't remove packages, which makes the case not
applicable to libsolv.

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
15 months agolibopkg: add compress_list_files option
Alejandro del Castillo [Wed, 22 Nov 2017 22:02:47 +0000 (16:02 -0600)]
libopkg: add compress_list_files option

When enabled, this option stores the list files on list_dir as gz
compressed. Useful to reduce disk space usage.

bugzilla #11912

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
15 months agofile_gz_compress: add
Alejandro del Castillo [Wed, 22 Nov 2017 20:41:48 +0000 (14:41 -0600)]
file_gz_compress: add

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
15 months agogz_write_archive: add
Alejandro del Castillo [Wed, 22 Nov 2017 20:39:10 +0000 (14:39 -0600)]
gz_write_archive: add

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
15 months agocheckpatch.pl: make compatible with Perl 5.22 and later
Alejandro del Castillo [Wed, 29 Nov 2017 21:53:06 +0000 (15:53 -0600)]
checkpatch.pl: make compatible with Perl 5.22 and later

Perl 5.22 complains about "Unescaped left brace in regex is deprecated"
if left brace characters are left unescaped.

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
17 months agoregress/issue9059.py: remove expected failure
Alejandro del Castillo [Tue, 10 Oct 2017 16:48:54 +0000 (11:48 -0500)]
regress/issue9059.py: remove expected failure

This test was fixed on commit f773dda06357f1e02e865d8c03eeabfc0b808262.

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
17 months agoregress/issue165b: make xfail output more verbose
Alejandro del Castillo [Tue, 10 Oct 2017 16:43:18 +0000 (11:43 -0500)]
regress/issue165b: make xfail output more verbose

This is an issue for the internal solver and libsolv < 0.6.28. Make this
information part of the output.

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
17 months agoImplement list-upgradable for the external libsolv solver
Böszörményi Zoltán [Fri, 29 Sep 2017 07:44:33 +0000 (09:44 +0200)]
Implement list-upgradable for the external libsolv solver

Copy&pasted and modified opkg_solver_upgrade() and
libsolv_solver_execute_transaction() in
libopkg/solvers/libsolv/opkg_solver_libsolv.c to only print
the transaction.

Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
Removed unused include in opkg_cmd.c

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
17 months agoSpeed up file_hash_set_file_owner()
Böszörményi Zoltán [Wed, 27 Sep 2017 13:40:57 +0000 (15:40 +0200)]
Speed up file_hash_set_file_owner()

file_hash_set_file_owner() uses this sequence:

pkg_get_installed_files(old_owning_pkg);
file_list_remove_elt(old_owning_pkg->installed_files, file_name);
pkg_free_installed_files(old_owning_pkg);

pkg_get_installed_files() and pkg_free_installed_files() use
reference count for the file list but at least when calling
file_hash_set_file_owner() from check_data_file_clashes(), the
pkg->installed_files pointer is NULL so when a package is upgraded,
the behaviour of this functions is to always open, read and close
the packagename.list file and this is a very heavy operation.

For an IPK package with 12,000+ files, upgrading the package takes
over 5 minutes while with this change it goes down to 6 seconds
on a fast machine.

I tested it with Valgrind but it doesn't seem to cause any leaks.

Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
19 months agois_pkg_a_provides: stick to name comparison for satisfied dependencies
Alejandro del Castillo [Wed, 26 Jul 2017 00:05:32 +0000 (19:05 -0500)]
is_pkg_a_provides: stick to name comparison for satisfied dependencies

Limit comparison to package names when checking if a satisfied
dependency Provides is already installed. This enable upgrades of
installed packages that Provide virtual packages already installed.

fixes bugzilla 11826

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
21 months agoNEWS: update to v0.3.5 v0.3.5
Alejandro del Castillo [Thu, 15 Jun 2017 16:56:40 +0000 (11:56 -0500)]
NEWS: update to v0.3.5

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
21 months agoconfigure.ac: bump version to 0.3.5
Alejandro del Castillo [Thu, 15 Jun 2017 16:56:39 +0000 (11:56 -0500)]
configure.ac: bump version to 0.3.5

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
21 months agotest: add test case for dist-upgrade
Alejandro del Castillo [Wed, 17 May 2017 22:50:31 +0000 (17:50 -0500)]
test: add test case for dist-upgrade

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
21 months agoopkgcl.py: add support for dist-upgrade
Alejandro del Castillo [Wed, 17 May 2017 22:50:30 +0000 (17:50 -0500)]
opkgcl.py: add support for dist-upgrade

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
21 months agolibsolv_solver_add_job: force target dist-upgrade operation
Alejandro del Castillo [Wed, 17 May 2017 22:50:29 +0000 (17:50 -0500)]
libsolv_solver_add_job: force target dist-upgrade operation

Use SOLVER_TARGETED libsolv flag on dist-upgrade operations to configure
libsolv to prefer an upgrade of the same package over an upgrade to a
package that replaces the targeted package.

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
21 months agoopkg_distupgrade_cmd: add dist-upgrade support for libsolv
Alejandro del Castillo [Wed, 17 May 2017 22:50:28 +0000 (17:50 -0500)]
opkg_distupgrade_cmd: add dist-upgrade support for libsolv

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
21 months agoparse_userfields: avoid buffer overrun with user fields > 1023
Alejandro del Castillo [Mon, 15 May 2017 22:32:49 +0000 (17:32 -0500)]
parse_userfields: avoid buffer overrun with user fields > 1023

User defined fields longer than 1023 bytes were causing a buffer
overrun since no max length was specified on sscanf. Increase the user
defined field maximum length to 4095 characters, and enforce a limit on
the sscanf, to avoid the overrun.

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
22 months agosolv_solver_solve: print solver errors to stderr
Alejandro del Castillo [Wed, 3 May 2017 23:02:38 +0000 (18:02 -0500)]
solv_solver_solve: print solver errors to stderr

opkg_message(NOTICE, ....) logs to stdout, while opkg_message(ERROR,
...) logs to stderr. Logging from solver_printsolution is done via
 printsolution_callback.

Fixes bugzilla #10407

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
22 months agocalculate_dependencies_for: skip error message if --force-depends
Alejandro del Castillo [Wed, 3 May 2017 23:02:37 +0000 (18:02 -0500)]
calculate_dependencies_for: skip error message if --force-depends

Fixes bugzilla #9060

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
22 months agotest: add test for issue 10781
Alejandro del Castillo [Mon, 1 May 2017 21:00:38 +0000 (16:00 -0500)]
test: add test for issue 10781

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
22 months agois_provides_installed: check all installed and to be installed pkgs
Alejandro del Castillo [Mon, 1 May 2017 21:00:37 +0000 (16:00 -0500)]
is_provides_installed: check all installed and to be installed pkgs

Previously, only installed providers were searched, which left out
providers that were already set to be installed.

fixes bugzilla #10781

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
22 months agopkg_hash_fetch_all_installed: add option for installed and to be installed pkgs
Alejandro del Castillo [Mon, 1 May 2017 21:00:36 +0000 (16:00 -0500)]
pkg_hash_fetch_all_installed: add option for installed and to be installed pkgs

Will be use in is_provides_installed to check if a provider is installed
or if a provider is already set to be installed.

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
22 months agois_pkg_a_provides: extend check to Provides of pkg
Alejandro del Castillo [Mon, 1 May 2017 21:00:35 +0000 (16:00 -0500)]
is_pkg_a_provides: extend check to Provides of pkg

Currently this function is only checking for packages that provide
pkg_scout->name. However, if pkg_scout->provides_count == 2 (package
provides itself and only one virtual package), the check needs to be
extended to cover the package provided by pkg_scout.

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
22 months agointernal_solver_solv: do not return if provider is already installed
Alejandro del Castillo [Mon, 1 May 2017 21:00:34 +0000 (16:00 -0500)]
internal_solver_solv: do not return if provider is already installed

If package 'a' Provides 'd' and is installed, and 'b' also Provides 'd'
and is available, when:

opkg install 'd'

'd' should be able to be installed. The unnecessary
is_provides_installed check is currently incorrectly succeeding since it
only checks for providers that match the package name, instead of
also checking the Provides field of the package.

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
22 months agocalculate_dependencies_for: check return value on recursive call
Alejandro del Castillo [Mon, 1 May 2017 21:00:33 +0000 (16:00 -0500)]
calculate_dependencies_for: check return value on recursive call

Currently, calculate_dependencies_for return values are being ignored
when called from calculate_dependencies_for. If a conflict is detected,
an error is reported, but the operation is allowed to continue.

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
22 months agoparse_userfields: parse values until newline
Alejandro del Castillo [Fri, 14 Apr 2017 21:37:20 +0000 (16:37 -0500)]
parse_userfields: parse values until newline

Enable multi-word user-defined fields. Parsing will end at newline.

Fixes bugzilla #11194

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
22 months agobuildProvides: trim Provides strings
Alejandro del Castillo [Fri, 14 Apr 2017 21:37:19 +0000 (16:37 -0500)]
buildProvides: trim Provides strings

All other dependency fields (Depends, Conflicts, Replaces, etc) already
trim the strings on the control file.

Fixes bugzilla #11332

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
23 months agoAdd support for installing packages with version constraints other than '='
Michael Hansen [Fri, 14 Apr 2017 17:24:51 +0000 (10:24 -0700)]
Add support for installing packages with version constraints other than '='

Signed-off-by: Michael Hansen <michael.j.hansen@hp.com>
Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
23 months agotest/regress: standardize libsolv xfails
Alejandro del Castillo [Mon, 27 Mar 2017 23:04:58 +0000 (18:04 -0500)]
test/regress: standardize libsolv xfails

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
23 months agoregress/issue165b.py: make failure solver agnostic
Alejandro del Castillo [Mon, 27 Mar 2017 23:04:57 +0000 (18:04 -0500)]
regress/issue165b.py: make failure solver agnostic

The libsolv flag SOLVER_FLAG_STRONG_RECOMMENDS was added on commit
9022024. A side effect of the flag is that it breaks use case 165b.
There is an on-going discussion [1] to fix the flag on libsolv. In the
meantime, signal that this failure is not internalsolv specific.

[1] https://github.com/openSUSE/libsolv/issues/63

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
23 months agotest/regress: remove xfail from issue156.py & issue163.py
Alejandro del Castillo [Mon, 27 Mar 2017 23:04:56 +0000 (18:04 -0500)]
test/regress: remove xfail from issue156.py & issue163.py

Tests are no longer failing.

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
23 months agopkg_run_script: use pkg->dest in half installed case
Alejandro del Castillo [Mon, 27 Mar 2017 21:58:17 +0000 (16:58 -0500)]
pkg_run_script: use pkg->dest in half installed case

Fixes bugzilla #11245

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
23 months agopkg_get_provider_replacees: do not add duplicated replacees
Alejandro del Castillo [Mon, 27 Mar 2017 21:58:16 +0000 (16:58 -0500)]
pkg_get_provider_replacees: do not add duplicated replacees

If package 'a' Provides X, and package 'b' Provides/Replaces/Conflicts
X, and 'a' is installed, installing 'b' fails, since 'a' is removed
twice.

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
23 months agopkg_get_installed_replacees: do not add duplicated replacees
Alejandro del Castillo [Mon, 27 Mar 2017 21:58:15 +0000 (16:58 -0500)]
pkg_get_installed_replacees: do not add duplicated replacees

Since every package provides itself, replacees were added two times to
the list of installed_replacees. Ensure there is no duplication.

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
23 months agobuildProvides: do not add duplicated ab_pkg to provided_by list
Alejandro del Castillo [Mon, 27 Mar 2017 21:58:14 +0000 (16:58 -0500)]
buildProvides: do not add duplicated ab_pkg to provided_by list

buildProvides unconditionally adds ab_pkg to ab_pkg->provided_by list,
since every package provides itself. However, buildProvides is called
every time a pkg is processed, which means that the function can be
called multiple times for the same ab_pkg.

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
23 months agoopkgcl.py: add --force-postinstall flag to install, remove and upgrade
Alejandro del Castillo [Mon, 27 Mar 2017 21:58:13 +0000 (16:58 -0500)]
opkgcl.py: add --force-postinstall flag to install, remove and upgrade

The testsuite runs using an offline root, which makes opkg skip the run
of  maintainer scripts. To better reflect opkg usage, use
--force-postinstall to run maintainer scripts, if available.

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
23 months agoUpdate required libsolv version to 0.6.25 for changes in 90220245
Michael Hansen [Wed, 22 Mar 2017 16:24:34 +0000 (09:24 -0700)]
Update required libsolv version to 0.6.25 for changes in 90220245

Signed-off-by: Michael Hansen <michael.j.hansen@hp.com>
Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
2 years agolibsolv_solver_init: upgrade recommended dependencies
Alejandro del Castillo [Thu, 9 Mar 2017 22:12:01 +0000 (16:12 -0600)]
libsolv_solver_init: upgrade recommended dependencies

During targeted install/upgrade operations, also upgrade Recommends.
This is consistent with dpkg behavior.

Fixes bugzilla #9939

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
2 years agolibopkg/opkg_cmd.c: more robust PATH handling
Glenn Strauss [Thu, 2 Mar 2017 22:53:42 +0000 (17:53 -0500)]
libopkg/opkg_cmd.c: more robust PATH handling

preserve semantics of PATH when PATH is not set in environment

error and undefined behavior reported in
  https://github.com/openwrt/packages/issues/1922
when PATH not set in environment
(lighttpd executes CGI with empty base env, plus standard CGI env vars)

Signed-off-by: Glenn Strauss <gstrauss@gluelogic.com>
Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
2 years agolibopkg: specify "/bin/sh" instead of "sh"
Glenn Strauss [Thu, 2 Mar 2017 22:53:09 +0000 (17:53 -0500)]
libopkg: specify "/bin/sh" instead of "sh"

avoid strange behavior with execvp() when PATH is not set in environment
(in which case confstr(_CS_PATH) should return something reasonable)

reproducable running openwrt 15.05 and 15.05.1 and attempting to install
a software package (e.g. libuuid) via LuCI (prior to openwrt/luci#1048).
(https://github.com/openwrt/luci/pull/1048) libuuid.postinst fails with
status 255 on 15.05 and opkg segfaults in 15.05.1.  This probably merits
further exploration.

Originally reported in https://github.com/openwrt/packages/issues/1922

Signed-off-by: Glenn Strauss <gstrauss@gluelogic.com>
Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
2 years agolibopkg: add support for user defined fields
Alejandro del Castillo [Wed, 22 Feb 2017 23:32:11 +0000 (17:32 -0600)]
libopkg: add support for user defined fields

If the verbose_status_file option is enabled, non recognized fields will
be identified as user-defined fields and will be copied to the status
file.

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
2 years agolibopkg: add option verbose_status_file
Alejandro del Castillo [Wed, 22 Feb 2017 23:32:10 +0000 (17:32 -0600)]
libopkg: add option verbose_status_file

Enabling this option makes opkg store all the package information in
the status file, instead of just a subset. This is desirable to make
such fields available offline, when there is no connection to the repo.
Disabled by default.

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
2 years agopkg_formatted_field: error out in all unknown fields
Alejandro del Castillo [Wed, 22 Feb 2017 23:32:09 +0000 (17:32 -0600)]
pkg_formatted_field: error out in all unknown fields

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
2 years agoset_flags_from_control: remove function
Alejandro del Castillo [Wed, 22 Feb 2017 23:32:08 +0000 (17:32 -0600)]
set_flags_from_control: remove function

During installs, install_data_files calls set_flags_from_control to
capture the case where fields, such as "Essential", are present in the
package control file but are missing on the Packages file. This
operation is expensive (re-parses the control file) and is catering to a
case that should not be supported on the first place.

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
2 years agoopkg_install: Only allow identical symlinks if the target is a directory
Michael Hansen [Thu, 23 Feb 2017 18:47:04 +0000 (10:47 -0800)]
opkg_install: Only allow identical symlinks if the target is a directory

Signed-off-by: Michael Hansen <michael.j.hansen@hp.com>
Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
2 years agoopkg_install: Allow packages to provide the same symlink if it is identical
Michael Hansen [Thu, 23 Feb 2017 00:36:27 +0000 (16:36 -0800)]
opkg_install: Allow packages to provide the same symlink if it is identical

Signed-off-by: Michael Hansen <michael.j.hansen@hp.com>
Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
2 years agolibopkg: Fix #11033 by checking package's file type against existing file.
Michael Hansen [Mon, 13 Feb 2017 23:38:55 +0000 (15:38 -0800)]
libopkg: Fix #11033 by checking package's file type against existing file.

Signed-off-by: Michael Hansen <michael.j.hansen@hp.com>
Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
2 years agolibopkg: Extend installed files data structure to also track file mode
Michael Hansen [Mon, 13 Feb 2017 23:38:54 +0000 (15:38 -0800)]
libopkg: Extend installed files data structure to also track file mode

Signed-off-by: Michael Hansen <michael.j.hansen@hp.com>
Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
2 years agoopkg_solver_internal.c: do not process orphans if --download-only
Alejandro del Castillo [Thu, 2 Feb 2017 22:15:33 +0000 (16:15 -0600)]
opkg_solver_internal.c: do not process orphans if --download-only

Fixes bugzilla #10243

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
2 years agopopulate_installed_repo: make autoinstalled packages removable
Alejandro del Castillo [Fri, 9 Dec 2016 21:24:18 +0000 (15:24 -0600)]
populate_installed_repo: make autoinstalled packages removable

In a system that has package 'a' & 'b' installed, where package 'a'
recommends 'b', trying to install package 'c', which depends on 'd'
(which conflicts with 'b'), the expected behavior is for the package
manager to uninstall the recommended package 'b', then proceed to
install 'c' & 'd'. By making autoinstalled packages potentially removable,
libsolv will correctly remove installed recommended packages that
conflict with a to be installed package (or any of it's dependencies).

Fixes bugzilla 10777 (libsolv only)

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
2 years agoconffile: gracefully handle deleted conffiles in conffile_has_been_modified
Ross Burton [Tue, 10 Jan 2017 16:15:36 +0000 (16:15 +0000)]
conffile: gracefully handle deleted conffiles in conffile_has_been_modified

Handle conffiles that don't exist gracefully so that instead of showing an error
message from file_md5sum_alloc() a notice that the file has been deleted is
shown instead.

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
2 years agoopkg_cmd: only look at conffile status if we're going to output it
Ross Burton [Tue, 10 Jan 2017 16:15:35 +0000 (16:15 +0000)]
opkg_cmd: only look at conffile status if we're going to output it

The loop to compare the recorded conffile hash with their hash on disk is
outputted at level INFO but the loop was executed at level NOTICE and higher.

This means that if a conffile had been deleted the status operation would
produce error messages for output it isn't displaying.

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
2 years agoconfigure.ac: bump version to 0.3.5-SNAPSHOT
Alejandro del Castillo [Thu, 12 Jan 2017 19:22:55 +0000 (13:22 -0600)]
configure.ac: bump version to 0.3.5-SNAPSHOT

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
2 years agoNEWS: update to v0.3.4 v0.3.4
Alejandro del Castillo [Thu, 22 Dec 2016 17:04:54 +0000 (11:04 -0600)]
NEWS: update to v0.3.4

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
2 years agoconfigure.ac: bump version to 0.3.4
Alejandro del Castillo [Thu, 22 Dec 2016 17:04:53 +0000 (11:04 -0600)]
configure.ac: bump version to 0.3.4

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
2 years agoopkg_list_upgradable_packages: fix libokgapi implementation
Alejandro del Castillo [Thu, 22 Dec 2016 17:04:52 +0000 (11:04 -0600)]
opkg_list_upgradable_packages: fix libokgapi implementation

The --with-libopkgapi build is currently broken since the
prepare_upgrade_list function changed to use standard list types. Adapt
call site to new prototype.

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
2 years agolibopkg: make the /var and /etc directories configurable at compile time.
Florin Gherendi [Mon, 19 Dec 2016 10:25:38 +0000 (12:25 +0200)]
libopkg: make the /var and /etc directories configurable at compile time.

This is necessary for OpenWRT or other distros, to place opkg.conf in a
non-volatile, writable or distro specific directory (e.g /opt/etc).

- added SYSCONFDIR and VARDIR variables set by configure in Makefile.am
  (as --sysconfdir and --localstatedir)
- added SYSCONFDIR and VARDIR as prefixes for /etc and /var in
  libopkg/opkg_conf.h
- tests[/*]/*.py: changed hard-coded paths with the ones configured at
  compile time

Signed-off-by: Florin Gherendi <floring2502@gmail.com>
Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
2 years agoopen_outer: add gzip support
Florin Gherendi [Thu, 15 Dec 2016 18:49:21 +0000 (20:49 +0200)]
open_outer: add gzip support

Restore support for tar.gzipped ipk packages (as used in OpenWRT/DD-WRT
repositories), that has been lost when opkg opted to use libarchive in
recent versions. Now opkg version 0.3.x can be used on OpenWRT/DD-WRT
instead of the older 0.1.8 version provided in the distribution.

Signed-off-by: Florin Gherendi <floring2502@gmail.com>
Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
2 years agoopkg: Extend 'opkg list' command to optionally display package size
Florin Gherendi [Thu, 15 Dec 2016 18:30:09 +0000 (20:30 +0200)]
opkg: Extend 'opkg list' command to optionally display package size

'opkg list' command only displays the available packages' name, version and
description. It would be useful to also see the approximate size of the
available package.

This patch extends "opkg list" command with "--size" to optionally show also
the *.ipk size.
* Default behaviour is to list the available packages as earlier:
    "name - version - description"
* with "--size" the output of is "name - version - size - description".

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@46980 3c298f89-4303-0410-b956-a3cf2f4a3e73

The patch was imported from OpenWRT git server (git://git.openwrt.org/openwrt.git) as of commit id 97e7e2bae9beced5b079d352035a5e914e9715e2

Some modifications were made to match opkg version 0.3.x:
 libopkg/opkg_cmd.c:  changes in patch code: in static void print_pkg(pkg_t * pkg), instead of:
+ if (conf->size)
+ printf(" - %lu", pkg->size);

 use:
+    if (opkg_config->size) {
+ if(pkg->state_status == SS_INSTALLED || pkg->state_status == SS_UNPACKED)
+     printf(" - %lu", pkg->installed_size);
+ else
+     printf(" - %lu", pkg->size);
+ }
 man/opkg.1.in: added description for --size switch
 src/opkg.c: is patched in version 0.3.x instead of src/opkg-cl.c in version 0.1.8

Signed-off-by: Florin Gherendi <floring2502@gmail.com>
Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
2 years agoopkg: expose lists_dir option as command line argument
Florin Gherendi [Thu, 15 Dec 2016 18:15:36 +0000 (20:15 +0200)]
opkg: expose lists_dir option as command line argument

Expose the "lists_dir" configuration file option as command line switch
so that we can override it for the Image Builder environment.

Also add a more standard PKG_MAINTAINER variable while touching the
Makefile.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@46911 3c298f89-4303-0410-b956-a3cf2f4a3e73

The patch was imported from OpenWRT git server
(git://git.openwrt.org/openwrt.git) as of commit id
91a4816bcdff36a903a69e8e2659c83c6a42e490.

Modifications for opkg version 0.3.x:
src/opkg.c is patched with the same code as src/opkg-cl.c in the 0.1.8 version
man/opkg.1.in - add description for the --lists-dir switch

Signed-off-by: Florin Gherendi <floring2502@gmail.com>
Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
2 years agoopkg: introduce a --force-checksum cmdline flag to be ale to ignore mismatching md5sums
Florin Gherendi [Thu, 15 Dec 2016 17:56:25 +0000 (19:56 +0200)]
opkg: introduce a --force-checksum cmdline flag to be ale to ignore mismatching md5sums

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@40766 3c298f89-4303-0410-b956-a3cf2f4a3e73

The patch was imported from OpenWRT git server
(git://git.openwrt.org/openwrt.git) as of commit id
37a0e124d1c685f0503b7b96351e29548fbe71cc.

Parts have been re-written to match opkg version 0.3.x:
 libopkg/opkg_install.c is no longer patched; error messages for md5sum
 mismatch no longer exist in this version of opkg. Patching libopkg/pkg.c
 instead, for ignoring checksum mismatch (new code) patching information
 for src/opkg-cl.c (version 0.1.8) used now to patch src/opkg.c (the new
 program source)
 man/opkg.1.in - add description for the "--force-checksum" command line switch.
 man/opkg.5.in - add description for the "force_checksum" config option.

Signed-off-by: Florin Gherendi <floring2502@gmail.com>
Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
2 years agoopkg: introduce "find" command which searches package names and descriptions (e.g...
Florin Gherendi [Thu, 15 Dec 2016 15:21:23 +0000 (17:21 +0200)]
opkg: introduce "find" command which searches package names and descriptions (e.g. opkg -i find "*autoconfig*")

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@34202 3c298f89-4303-0410-b956-a3cf2f4a3e73

Based on one of a series of patches imported from OpenWRT git server
(git://git.openwrt.org/openwrt.git) as of commit id
d6a1959e5168377d5358d257ebc2afe6abdf7eb8, author jow
<jow@3c298f89-4303-0410-b956-a3cf2f4a3e73>, not signed off.

Modifications to match opkg version 0.3.x:
 libopkg/opkg_cmd.c:
static int opkg_list_find_cmd(int argc, char **argv, int use_desc): occurrences of conf->nocase replaced with 0
static int opkg_list_installed_cmd(int argc, char **argv): {"find", 1, (opkg_cmd_fun_t)opkg_find_cmd, PFM_SOURCE} replaced with
{"find", 1, (opkg_cmd_fun_t) opkg_find_cmd, PFM_DESCRIPTION | PFM_SOURCE}
man/opkg.1.in - add description for the "find" command
patching information from src/opkg-cl.c (initial) used for src/opkg.c (the new program source)

Signed-off-by: Florin Gherendi <floring2502@gmail.com>
Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>