From: Jo-Philipp Wich Date: Wed, 15 Feb 2017 23:21:05 +0000 (+0100) Subject: libopkg: propagate SF_NEED_DETAIL from abstract to discrete package X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=d79ee5c52f301aaa721f9061daf2c1d0c11e5615;p=oweals%2Fopkg-lede.git libopkg: propagate SF_NEED_DETAIL from abstract to discrete package During parsing, propagate the state of the SF_NEED_DETAIL flag from the related abstract package to the discrete pkg_t instance getting assembled. This is required to ensure that subsequent parsing of pkg_t's dependency lists considers the state of SF_NEED_DETAIL. Signed-off-by: Jo-Philipp Wich --- diff --git a/libopkg/pkg_parse.c b/libopkg/pkg_parse.c index d8b7b52..c4637b2 100644 --- a/libopkg/pkg_parse.c +++ b/libopkg/pkg_parse.c @@ -194,8 +194,17 @@ int pkg_parse_line(void *ptr, const char *line, uint mask) break; case 'P': - if ((mask & PFM_PACKAGE) && is_field("Package", line)) + if ((mask & PFM_PACKAGE) && is_field("Package", line)) { pkg->name = parse_simple("Package", line); + ab_pkg = abstract_pkg_fetch_by_name(pkg->name); + + if (ab_pkg && (ab_pkg->state_flag & SF_NEED_DETAIL)) { + if (!(pkg->state_flag & SF_NEED_DETAIL)) { + opkg_msg(DEPEND, "propagating abpkg flag to pkg %s\n", pkg->name); + pkg->state_flag |= SF_NEED_DETAIL; + } + } + } else if ((mask & PFM_PRIORITY) && is_field("Priority", line)) pkg_set_string(pkg, PKG_PRIORITY, line + strlen("Priority") + 1); else if ((mask & PFM_PROVIDES) && is_field("Provides", line))