[pacman-dev] [PATCH 2/4] check assumeinstalled for meaningful mod
Andrew Gregory
andrew.gregory.8 at gmail.com
Thu Jul 16 23:05:32 UTC 2015
assumeinstalled options are used as provisions for which MOD_EQ and
MOD_ANY are the only meaningful settings.
Signed-off-by: Andrew Gregory <andrew.gregory.8 at gmail.com>
---
lib/libalpm/handle.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/lib/libalpm/handle.c b/lib/libalpm/handle.c
index 1be2484..15c60cd 100644
--- a/lib/libalpm/handle.c
+++ b/lib/libalpm/handle.c
@@ -585,6 +585,8 @@ int SYMEXPORT alpm_option_remove_ignoregroup(alpm_handle_t *handle, const char *
int SYMEXPORT alpm_option_add_assumeinstalled(alpm_handle_t *handle, const alpm_depend_t *dep)
{
CHECK_HANDLE(handle, return -1);
+ ASSERT(dep->mod == ALPM_DEP_MOD_EQ || dep->mod == ALPM_DEP_MOD_ANY,
+ RET_ERR(handle, ALPM_ERR_WRONG_ARGS, -1));
handle->assumeinstalled = alpm_list_add(handle->assumeinstalled, (void *)dep);
return 0;
--
2.4.6
More information about the pacman-dev
mailing list