[pacman-dev] [PATCH 1/2] Add alpm_option_match_noextract

Allan McRae allan at archlinux.org
Tue Nov 18 02:52:10 UTC 2014


This is useful for frontends testing whether a file is in NoExtract

Signed-off-by: Allan McRae <allan at archlinux.org>
---
 lib/libalpm/alpm.h   | 1 +
 lib/libalpm/handle.c | 5 +++++
 2 files changed, 6 insertions(+)

diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h
index 1831fcf..234bd6b 100644
--- a/lib/libalpm/alpm.h
+++ b/lib/libalpm/alpm.h
@@ -827,6 +827,7 @@ alpm_list_t *alpm_option_get_noextracts(alpm_handle_t *handle);
 int alpm_option_add_noextract(alpm_handle_t *handle, const char *path);
 int alpm_option_set_noextracts(alpm_handle_t *handle, alpm_list_t *noextract);
 int alpm_option_remove_noextract(alpm_handle_t *handle, const char *path);
+int alpm_option_match_noextract(alpm_handle_t *handle, const char *path);
 /** @} */
 
 /** @name Accessors to the list of ignored packages.
diff --git a/lib/libalpm/handle.c b/lib/libalpm/handle.c
index 6545592..5ef619e 100644
--- a/lib/libalpm/handle.c
+++ b/lib/libalpm/handle.c
@@ -542,6 +542,11 @@ int SYMEXPORT alpm_option_remove_noextract(alpm_handle_t *handle, const char *pa
 	return _alpm_option_strlist_rem(handle, &(handle->noextract), path);
 }
 
+int SYMEXPORT alpm_option_match_noextract(alpm_handle_t *handle, const char *path)
+{
+	return _alpm_fnmatch_patterns(handle->noextract, path);
+}
+
 int SYMEXPORT alpm_option_add_ignorepkg(alpm_handle_t *handle, const char *pkg)
 {
 	return _alpm_option_strlist_add(handle, &(handle->ignorepkg), pkg);
-- 
2.1.3


More information about the pacman-dev mailing list