From e9405aa794b033500d17d75923b7358616b00c08 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Wed, 15 Feb 2017 23:54:13 +0100 Subject: [PATCH] libopkg: mark to-be-installed non-local, non-url packages for detail parsing When just a package name is passed to opkg install, we need to retrieve information about this package from the feeds list so stage an abstract package with the given name and flag it with SF_NEED_DETAIL. Packages specified as local file paths or direct download URLs do not need this special treatment as the required details can be extracted from their embedded control files. Signed-off-by: Jo-Philipp Wich --- libopkg/opkg_download.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libopkg/opkg_download.c b/libopkg/opkg_download.c index 55e71a6..73ff1ac 100644 --- a/libopkg/opkg_download.c +++ b/libopkg/opkg_download.c @@ -300,6 +300,7 @@ int opkg_prepare_url_for_install(const char *url, char **namep) { int err = 0; pkg_t *pkg; + abstract_pkg_t *ab_pkg; pkg = pkg_new(); @@ -333,6 +334,13 @@ int opkg_prepare_url_for_install(const char *url, char **namep) pkg->provided_by_hand = 1; } else { + ab_pkg = ensure_abstract_pkg_by_name(url); + + if (!(ab_pkg->state_flag & SF_NEED_DETAIL)) { + opkg_msg(DEBUG, "applying abpkg flag to %s\n", ab_pkg->name); + ab_pkg->state_flag |= SF_NEED_DETAIL; + } + pkg_deinit(pkg); free(pkg); return 0; -- 2.25.1