new: add resolve_depends option to resolve function
This commit is contained in:
parent
ae83552e96
commit
8080299d7d
@ -74,10 +74,10 @@ lm_ctx_list_t *lm_ctx_list(lm_ctx_t *ctx, lm_ctx_list_t *list); // returns the s
|
|||||||
lm_pkg_t *lm_ctx_list_next(lm_ctx_list_t *list); // returns the next package in the list
|
lm_pkg_t *lm_ctx_list_next(lm_ctx_list_t *list); // returns the next package in the list
|
||||||
void lm_ctx_list_free(lm_ctx_list_t *list); // frees the package list state
|
void lm_ctx_list_free(lm_ctx_list_t *list); // frees the package list state
|
||||||
|
|
||||||
lm_ctx_resolve_list_t *lm_ctx_resolve(
|
lm_ctx_resolve_list_t *lm_ctx_resolve(lm_ctx_t *ctx, lm_pkg_t *pkg, bool resolve_depends,
|
||||||
lm_ctx_t *ctx, lm_pkg_t *pkg, lm_ctx_resolve_list_t *list); // resolves a package and returns a list of packages
|
lm_ctx_resolve_list_t *list); // resolves a package and returns a list of packages
|
||||||
lm_pkg_t *lm_ctx_resolve_next(lm_ctx_resolve_list_t *list); // returns the next package in the list
|
lm_pkg_t *lm_ctx_resolve_next(lm_ctx_resolve_list_t *list); // returns the next package in the list
|
||||||
void lm_ctx_resolve_free(lm_ctx_resolve_list_t *list); // frees the resolved list returned by lm_ctx_resolve
|
void lm_ctx_resolve_free(lm_ctx_resolve_list_t *list); // frees the resolved list returned by lm_ctx_resolve
|
||||||
|
|
||||||
lm_ctx_update_list_t *lm_ctx_update_list(lm_ctx_t *ctx); // get a list of entries to update
|
lm_ctx_update_list_t *lm_ctx_update_list(lm_ctx_t *ctx); // get a list of entries to update
|
||||||
lm_entry_t *lm_ctx_update_list_next(lm_ctx_update_list_t *list); // get the next entry in the update list
|
lm_entry_t *lm_ctx_update_list_next(lm_ctx_update_list_t *list); // get the next entry in the update list
|
||||||
|
@ -8,7 +8,7 @@ msgid ""
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: PACKAGE VERSION\n"
|
"Project-Id-Version: PACKAGE VERSION\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2024-08-08 16:08+0300\n"
|
"POT-Creation-Date: 2024-08-08 16:32+0300\n"
|
||||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||||
|
@ -7,11 +7,11 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
bool __lm_ctx_resolve(lm_ctx_t *ctx, lm_ctx_resolve_list_t *list, lm_pkg_t *pkg){
|
bool __lm_ctx_resolve(lm_ctx_t *ctx, lm_ctx_resolve_list_t *list, lm_pkg_t *pkg, bool resolve_depends){
|
||||||
if(pkglist_contains(list->packages, pkg))
|
if(pkglist_contains(list->packages, pkg))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if(NULL == pkg->data.depends)
|
if(!resolve_depends || NULL == pkg->data.depends)
|
||||||
goto end;
|
goto end;
|
||||||
|
|
||||||
list->resolving = pkglist_add_top(list->resolving, pkg);
|
list->resolving = pkglist_add_top(list->resolving, pkg);
|
||||||
@ -34,7 +34,7 @@ bool __lm_ctx_resolve(lm_ctx_t *ctx, lm_ctx_resolve_list_t *list, lm_pkg_t *pkg)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!__lm_ctx_resolve(ctx, list, depend))
|
if(!__lm_ctx_resolve(ctx, list, depend, resolve_depends))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -45,7 +45,7 @@ end:
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
lm_ctx_resolve_list_t *lm_ctx_resolve(lm_ctx_t *ctx, lm_pkg_t *pkg, lm_ctx_resolve_list_t *list){
|
lm_ctx_resolve_list_t *lm_ctx_resolve(lm_ctx_t *ctx, lm_pkg_t *pkg, bool resolve_depends, lm_ctx_resolve_list_t *list){
|
||||||
if(NULL == ctx || NULL == pkg){
|
if(NULL == ctx || NULL == pkg){
|
||||||
lm_error_set(LM_ERR_ArgNULL);
|
lm_error_set(LM_ERR_ArgNULL);
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -56,7 +56,7 @@ lm_ctx_resolve_list_t *lm_ctx_resolve(lm_ctx_t *ctx, lm_pkg_t *pkg, lm_ctx_resol
|
|||||||
bzero(list, sizeof(lm_ctx_resolve_list_t));
|
bzero(list, sizeof(lm_ctx_resolve_list_t));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!__lm_ctx_resolve(ctx, list, pkg)){
|
if(!__lm_ctx_resolve(ctx, list, pkg, resolve_depends)){
|
||||||
pkglist_free(list->resolving);
|
pkglist_free(list->resolving);
|
||||||
pkglist_free(list->packages);
|
pkglist_free(list->packages);
|
||||||
free(list);
|
free(list);
|
||||||
|
Loading…
Reference in New Issue
Block a user