[pacman-dev] [PATCH 03/13] Add files option to handle

Allan McRae allan at archlinux.org
Tue Jun 23 12:52:30 UTC 2015


This option will be used to determine if the .files database should be used
for reading sync information.

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

diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h
index 06e080b..a6cabc9 100644
--- a/lib/libalpm/alpm.h
+++ b/lib/libalpm/alpm.h
@@ -155,6 +155,12 @@ typedef enum _alpm_pkgfrom_t {
 	ALPM_PKG_FROM_SYNCDB
 } alpm_pkgfrom_t;
 
+/** Database extension options */
+typedef enum _alpm_dbtype_t {
+	ALPM_DBTYPE_DB,
+	ALPM_DBTYPE_FILES
+} alpm_dbtype_t;
+
 /** Method used to validate a package. */
 typedef enum _alpm_pkgvalidation_t {
 	ALPM_PKG_VALIDATION_UNKNOWN = 0,
@@ -859,6 +865,9 @@ int alpm_option_set_deltaratio(alpm_handle_t *handle, double ratio);
 int alpm_option_get_checkspace(alpm_handle_t *handle);
 int alpm_option_set_checkspace(alpm_handle_t *handle, int checkspace);
 
+alpm_dbtype_t alpm_option_get_dbtype(alpm_handle_t *handle);
+int alpm_option_set_dbtype(alpm_handle_t *handle, alpm_dbtype_t dbtype);
+
 alpm_siglevel_t alpm_option_get_default_siglevel(alpm_handle_t *handle);
 int alpm_option_set_default_siglevel(alpm_handle_t *handle, alpm_siglevel_t level);
 
diff --git a/lib/libalpm/handle.c b/lib/libalpm/handle.c
index 4915d0b..df81f0d 100644
--- a/lib/libalpm/handle.c
+++ b/lib/libalpm/handle.c
@@ -284,6 +284,12 @@ int SYMEXPORT alpm_option_get_checkspace(alpm_handle_t *handle)
 	return handle->checkspace;
 }
 
+alpm_dbtype_t SYMEXPORT alpm_option_get_dbtype(alpm_handle_t *handle)
+{
+	CHECK_HANDLE(handle, return -1);
+	return handle->dbtype;
+}
+
 int SYMEXPORT alpm_option_set_logcb(alpm_handle_t *handle, alpm_cb_log cb)
 {
 	CHECK_HANDLE(handle, return -1);
@@ -664,6 +670,13 @@ int SYMEXPORT alpm_option_set_checkspace(alpm_handle_t *handle, int checkspace)
 	return 0;
 }
 
+int SYMEXPORT alpm_option_set_dbtype(alpm_handle_t *handle, alpm_dbtype_t dbtype)
+{
+	CHECK_HANDLE(handle, return -1);
+	handle->dbtype = dbtype;
+	return 0;
+}
+
 int SYMEXPORT alpm_option_set_default_siglevel(alpm_handle_t *handle,
 		alpm_siglevel_t level)
 {
diff --git a/lib/libalpm/handle.h b/lib/libalpm/handle.h
index 5893139..7fd470e 100644
--- a/lib/libalpm/handle.h
+++ b/lib/libalpm/handle.h
@@ -95,6 +95,7 @@ struct __alpm_handle_t {
 	double deltaratio;       /* Download deltas if possible; a ratio value */
 	int usesyslog;           /* Use syslog instead of logfile? */ /* TODO move to frontend */
 	int checkspace;          /* Check disk space before installing */
+	alpm_dbtype_t dbtype;    /* Set the database type (extension) */
 	alpm_siglevel_t siglevel;   /* Default signature verification level */
 	alpm_siglevel_t localfilesiglevel;  /* Signature verification level for local file
 	                                       upgrade operations */
-- 
2.4.4


More information about the pacman-dev mailing list