summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Gregory <andrew.gregory.8@gmail.com>2015-07-17 01:05:34 +0200
committerAllan McRae <allan@archlinux.org>2015-08-08 02:42:26 +0200
commitae97082e98b6c3984799ba9f3f6ccc6ef5da6034 (patch)
tree3e849778a67c3687dfdebebd8cfc9815513241ad
parent48f4efd9a18966509bd599684e77d3ad49d5b082 (diff)
downloadpacman-ae97082e98b6c3984799ba9f3f6ccc6ef5da6034.tar.gz
pacman-ae97082e98b6c3984799ba9f3f6ccc6ef5da6034.tar.xz
fill in name_hash for assumeinstalled options
alpm_depend_t is an exposed data type. Front-ends may opt for alloc'ing one and filling the fields manually, but alpm's _alpm_hash_sdbm is not exposed, making it impossible for them to fill in the name_hash field. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
-rw-r--r--lib/libalpm/handle.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/libalpm/handle.c b/lib/libalpm/handle.c
index f336bf2b..a12ac50d 100644
--- a/lib/libalpm/handle.c
+++ b/lib/libalpm/handle.c
@@ -597,6 +597,8 @@ int SYMEXPORT alpm_option_add_assumeinstalled(alpm_handle_t *handle, const alpm_
RET_ERR(handle, ALPM_ERR_WRONG_ARGS, -1));
ASSERT((depcpy = _alpm_dep_dup(dep)), RET_ERR(handle, ALPM_ERR_MEMORY, -1));
+ /* fill in name_hash in case dep was built by hand */
+ depcpy->name_hash = _alpm_hash_sdbm(dep->name);
handle->assumeinstalled = alpm_list_add(handle->assumeinstalled, depcpy);
return 0;
}