Increase PROVIDES candidate score also in case the package name matches
a to-be-installed package listed.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
#include "opkg_configure.h"
#include "xsystem.h"
+int opkg_cli_argc = 0;
+char **opkg_cli_argv = NULL;
+
static void print_pkg(pkg_t * pkg)
{
char *version = pkg_version_str_alloc(pkg);
int opkg_cmd_exec(opkg_cmd_t * cmd, int argc, const char **argv)
{
+ opkg_cli_argc = argc;
+ opkg_cli_argv = argv;
return (cmd->fun) (argc, argv);
}
int opkg_cmd_exec(opkg_cmd_t * cmd, int argc, const char **argv);
extern int opkg_state_changed;
+extern int opkg_cli_argc;
+extern char **opkg_cli_argv;
#endif
#include "parse_util.h"
#include "pkg_parse.h"
#include "opkg_utils.h"
+#include "opkg_cmd.h"
#include "sprintf_alloc.h"
#include "file_util.h"
#include "libbb/libbb.h"
if (strcmp(matching->name, apkg->name) == 0)
score++;
+ for (j = 0; j < opkg_cli_argc; ++j) {
+ if (!strcmp(matching->name, opkg_cli_argv[j])) {
+ score++;
+ break;
+ }
+ }
+
opkg_msg(DEBUG, "Candidate: %s %s (score %d).\n",
matching->name, pkg_get_string(matching, PKG_VERSION),
score);