summaryrefslogtreecommitdiffstats
path: root/lib/libalpm/handle.c
diff options
context:
space:
mode:
authorAndrew Gregory <andrew.gregory.8@gmail.com>2017-04-10 02:42:01 +0200
committerAllan McRae <allan@archlinux.org>2017-04-12 03:47:33 +0200
commit04d211effa8d65020887112ee30c7b3b0fc28ad3 (patch)
tree9939b65851a6fc5bb6a0863d286b8da0d4876e74 /lib/libalpm/handle.c
parent86f5c74694cb0403eaf11fa4734f307a0df345cb (diff)
downloadpacman-04d211effa8d65020887112ee30c7b3b0fc28ad3.tar.gz
pacman-04d211effa8d65020887112ee30c7b3b0fc28ad3.tar.xz
add --overwrite option to ignore file conflicts
Allows for safer, more fine-grained control for overwriting files than --force's all-or-nothing approach. Implements FS#31549. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'lib/libalpm/handle.c')
-rw-r--r--lib/libalpm/handle.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/libalpm/handle.c b/lib/libalpm/handle.c
index f08f614c..b6b27881 100644
--- a/lib/libalpm/handle.c
+++ b/lib/libalpm/handle.c
@@ -283,6 +283,12 @@ alpm_list_t SYMEXPORT *alpm_option_get_ignoregroups(alpm_handle_t *handle)
return handle->ignoregroup;
}
+alpm_list_t SYMEXPORT *alpm_option_get_overwrite_files(alpm_handle_t *handle)
+{
+ CHECK_HANDLE(handle, return NULL);
+ return handle->overwrite_files;
+}
+
alpm_list_t SYMEXPORT *alpm_option_get_assumeinstalled(alpm_handle_t *handle)
{
CHECK_HANDLE(handle, return NULL);
@@ -657,6 +663,21 @@ int SYMEXPORT alpm_option_remove_ignoregroup(alpm_handle_t *handle, const char *
return _alpm_option_strlist_rem(handle, &(handle->ignoregroup), grp);
}
+int SYMEXPORT alpm_option_add_overwrite_file(alpm_handle_t *handle, const char *glob)
+{
+ return _alpm_option_strlist_add(handle, &(handle->overwrite_files), glob);
+}
+
+int SYMEXPORT alpm_option_set_overwrite_files(alpm_handle_t *handle, alpm_list_t *globs)
+{
+ return _alpm_option_strlist_set(handle, &(handle->overwrite_files), globs);
+}
+
+int SYMEXPORT alpm_option_remove_overwrite_file(alpm_handle_t *handle, const char *glob)
+{
+ return _alpm_option_strlist_rem(handle, &(handle->overwrite_files), glob);
+}
+
int SYMEXPORT alpm_option_add_assumeinstalled(alpm_handle_t *handle, const alpm_depend_t *dep)
{
alpm_depend_t *depcpy;