libopkg: flag package with SF_NEED_DETAIL in pkg_init_from_file()
authorJo-Philipp Wich <jo@mein.io>
Thu, 16 Feb 2017 11:12:04 +0000 (12:12 +0100)
committerJo-Philipp Wich <jo@mein.io>
Thu, 16 Feb 2017 16:02:30 +0000 (17:02 +0100)
Flag the package loaded from file as SF_NEED_DETAIL to properly fetch and
resolve dependencies.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
libopkg/pkg.c

index 023cf75..a76e152 100644 (file)
@@ -346,6 +346,11 @@ int pkg_init_from_file(pkg_t * pkg, const char *filename)
 
        pkg_init(pkg);
 
+       if (!(pkg->state_flag & SF_NEED_DETAIL)) {
+               opkg_msg(DEBUG, "applying abpkg flag to %s\n", filename);
+               pkg->state_flag |= SF_NEED_DETAIL;
+       }
+
        pkg_set_string(pkg, PKG_LOCAL_FILENAME, filename);
 
        tmp = xstrdup(filename);