build: fix handling of string options
[oweals/opkg-lede.git] / libopkg / opkg_download.c
index 55e71a6ebc0da384c75878b6d304f5488d63e9d2..33b6e7392d4e7395d3694f073c5d3eee32143da6 100644 (file)
@@ -17,8 +17,6 @@
    General Public License for more details.
 */
 
-#include "config.h"
-
 #include <sys/wait.h>
 #include <stdio.h>
 #include <unistd.h>
@@ -300,6 +298,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 +332,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;