vpick: Fix pick_filter_image_any

Currently, pick_filter_image_any matches any image
with any suffix, which is way more than it should
be doing. It should only be matching images with
the .raw suffix.

Let's address this shortcoming by allowing to pass
multiple filters to path_pick(), and define
pick_filter_image_any as the combination of the
raw and directory image filters.

Fixes #40083
This commit is contained in:
Daan De Meyer
2026-01-16 13:07:47 +01:00
parent 3f958812fd
commit 3fa3a4fd15
10 changed files with 518 additions and 226 deletions
+6 -3
View File
@@ -3013,13 +3013,14 @@ static int pick_paths(void) {
if (arg_directory) {
_cleanup_(pick_result_done) PickResult result = PICK_RESULT_NULL;
PickFilter filter = pick_filter_image_dir;
PickFilter filter = *pick_filter_image_dir;
filter.architecture = arg_architecture;
r = path_pick_update_warn(
&arg_directory,
&filter,
/* n_filters= */ 1,
PICK_ARCHITECTURE|PICK_TRIES,
&result);
if (r < 0) {
@@ -3032,13 +3033,14 @@ static int pick_paths(void) {
if (arg_image) {
_cleanup_(pick_result_done) PickResult result = PICK_RESULT_NULL;
PickFilter filter = pick_filter_image_raw;
PickFilter filter = *pick_filter_image_raw;
filter.architecture = arg_architecture;
r = path_pick_update_warn(
&arg_image,
&filter,
/* n_filters= */ 1,
PICK_ARCHITECTURE|PICK_TRIES,
&result);
if (r < 0)
@@ -3049,13 +3051,14 @@ static int pick_paths(void) {
if (arg_template) {
_cleanup_(pick_result_done) PickResult result = PICK_RESULT_NULL;
PickFilter filter = pick_filter_image_dir;
PickFilter filter = *pick_filter_image_dir;
filter.architecture = arg_architecture;
r = path_pick_update_warn(
&arg_template,
&filter,
/* n_filters= */ 1,
PICK_ARCHITECTURE,
&result);
if (r < 0)