From 39c20ad4f1d5f6e915b5be8976b6a94885ca3b0c Mon Sep 17 00:00:00 2001 From: Andrew Gregory Date: Mon, 3 Jun 2019 00:32:36 -0700 Subject: hooks: rename type File to Path Make it clearer that the targets are matched against both directories and regular files and free up File to potentially refer specifically to regular files in the future. File is retained as a deprecated alias for Path for the time being to avoid breaking existing hooks and will be removed in a future release. See FS#53136. Signed-off-by: Andrew Gregory Signed-off-by: Allan McRae --- lib/libalpm/hook.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lib/libalpm') diff --git a/lib/libalpm/hook.c b/lib/libalpm/hook.c index d90ed2da..6143ea0f 100644 --- a/lib/libalpm/hook.c +++ b/lib/libalpm/hook.c @@ -38,7 +38,7 @@ enum _alpm_hook_op_t { enum _alpm_trigger_type_t { ALPM_HOOK_TYPE_PACKAGE = 1, - ALPM_HOOK_TYPE_FILE, + ALPM_HOOK_TYPE_PATH, }; struct _alpm_trigger_t { @@ -303,7 +303,11 @@ static int _alpm_hook_parse_cb(const char *file, int line, if(strcmp(value, "Package") == 0) { t->type = ALPM_HOOK_TYPE_PACKAGE; } else if(strcmp(value, "File") == 0) { - t->type = ALPM_HOOK_TYPE_FILE; + _alpm_log(handle, ALPM_LOG_DEBUG, + "File targets are deprecated, use Path instead\n"); + t->type = ALPM_HOOK_TYPE_PATH; + } else if(strcmp(value, "Path") == 0) { + t->type = ALPM_HOOK_TYPE_PATH; } else { error(_("hook %s line %d: invalid value %s\n"), file, line, value); } -- cgit v1.2.3-24-g4f1b