From 076ff866c5bff168f4da819e685a3c6025ddf069 Mon Sep 17 00:00:00 2001 From: turbobastii <10424668+turbobastii@users.noreply.github.com> Date: Sat, 1 Oct 2022 09:27:27 +0200 Subject: [PATCH 1/4] Fix meson warning for run_command --- cursors/meson.build | 11 +++++++---- meson.build | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/cursors/meson.build b/cursors/meson.build index 1b5eab6d3..e33d6e5d8 100644 --- a/cursors/meson.build +++ b/cursors/meson.build @@ -85,7 +85,7 @@ sizes = [ ] foreach size: sizes - run_command('mkdir', join_paths (meson.build_root(), 'cursors', size + 'x' + size)) + run_command('mkdir', join_paths (meson.build_root(), 'cursors', size + 'x' + size), check: false) foreach cursor : cursors message('rendering: ' + size + 'x' + size + '/' + cursor + '.png') @@ -94,7 +94,8 @@ foreach size: sizes rsvg, '--format', 'png', '--width=@0@'.format(size), '--height=@0@'.format(size), '--output', '@0@.png'.format(join_paths (meson.build_root(), 'cursors', size + 'x' + size, cursor)), - join_paths ('24', cursor + '.svg') + join_paths ('24', cursor + '.svg'), + check: false ) endforeach @@ -105,7 +106,8 @@ foreach size: sizes rsvg, '--format', 'png', '--width=@0@'.format(size), '--height=@0@'.format(size), '--output', '@0@.png'.format(join_paths (meson.build_root(), 'cursors', size + 'x' + size, watch)), - join_paths ('24', watch + '.svg') + join_paths ('24', watch + '.svg'), + check: false ) endforeach endforeach @@ -122,7 +124,8 @@ foreach cursor : cursors xcursorgen, cursor + '.in', '-p', join_paths (meson.build_root(), 'cursors'), - join_paths (meson.build_root(), 'cursors', cursor) + join_paths (meson.build_root(), 'cursors', cursor), + check: false ) install_data( diff --git a/meson.build b/meson.build index 1ce46ccab..5721a846c 100644 --- a/meson.build +++ b/meson.build @@ -91,7 +91,7 @@ foreach directory_entry : directories directory = directory_entry[0] directory_context = directory_entry[1] foreach size: sizes - result = run_command(ls, join_paths(meson.source_root (), directory, size)) + result = run_command(ls, join_paths(meson.source_root (), directory, size), check: false) if (result.returncode() == 0) foreach scale_factor : scale_factors # The Scale=1 attribute is useless, don't add it From 3e95fc3d61380e02ae5cf10ac820b28e5513d146 Mon Sep 17 00:00:00 2001 From: turbobastii <10424668+turbobastii@users.noreply.github.com> Date: Sun, 2 Oct 2022 08:09:53 +0200 Subject: [PATCH 2/4] Make meson run_command fail on error --- cursors/meson.build | 8 ++++---- meson.build | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cursors/meson.build b/cursors/meson.build index e33d6e5d8..4adcf9940 100644 --- a/cursors/meson.build +++ b/cursors/meson.build @@ -85,7 +85,7 @@ sizes = [ ] foreach size: sizes - run_command('mkdir', join_paths (meson.build_root(), 'cursors', size + 'x' + size), check: false) + run_command('mkdir', join_paths (meson.build_root(), 'cursors', size + 'x' + size), check: true) foreach cursor : cursors message('rendering: ' + size + 'x' + size + '/' + cursor + '.png') @@ -95,7 +95,7 @@ foreach size: sizes '--width=@0@'.format(size), '--height=@0@'.format(size), '--output', '@0@.png'.format(join_paths (meson.build_root(), 'cursors', size + 'x' + size, cursor)), join_paths ('24', cursor + '.svg'), - check: false + check: true ) endforeach @@ -107,7 +107,7 @@ foreach size: sizes '--width=@0@'.format(size), '--height=@0@'.format(size), '--output', '@0@.png'.format(join_paths (meson.build_root(), 'cursors', size + 'x' + size, watch)), join_paths ('24', watch + '.svg'), - check: false + check: true ) endforeach endforeach @@ -125,7 +125,7 @@ foreach cursor : cursors cursor + '.in', '-p', join_paths (meson.build_root(), 'cursors'), join_paths (meson.build_root(), 'cursors', cursor), - check: false + check: true ) install_data( diff --git a/meson.build b/meson.build index 5721a846c..55394a84c 100644 --- a/meson.build +++ b/meson.build @@ -91,7 +91,7 @@ foreach directory_entry : directories directory = directory_entry[0] directory_context = directory_entry[1] foreach size: sizes - result = run_command(ls, join_paths(meson.source_root (), directory, size), check: false) + result = run_command(ls, join_paths(meson.source_root (), directory, size), check: true) if (result.returncode() == 0) foreach scale_factor : scale_factors # The Scale=1 attribute is useless, don't add it From 240145fc51937dc77408dfc3481c20544a6b6745 Mon Sep 17 00:00:00 2001 From: turbobastii <10424668+turbobastii@users.noreply.github.com> Date: Sun, 2 Oct 2022 08:25:45 +0200 Subject: [PATCH 3/4] Replace meson run_command with more appropriate fs.is_dir call --- meson.build | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 55394a84c..8601fb2bd 100644 --- a/meson.build +++ b/meson.build @@ -5,6 +5,7 @@ project ( ) i18n = import('i18n') +fs = import('fs') icon_dir = join_paths(get_option('datadir'), 'icons', 'elementary') @@ -91,8 +92,8 @@ foreach directory_entry : directories directory = directory_entry[0] directory_context = directory_entry[1] foreach size: sizes - result = run_command(ls, join_paths(meson.source_root (), directory, size), check: true) - if (result.returncode() == 0) + dir_exists = fs.is_dir(join_paths(meson.source_root (), directory, size)) + if (dir_exists == true) foreach scale_factor : scale_factors # The Scale=1 attribute is useless, don't add it if (scale_factor.to_int() > 1) From 745880833e84c74f7dee7106f88c018622ccc84f Mon Sep 17 00:00:00 2001 From: turbobastii <10424668+turbobastii@users.noreply.github.com> Date: Sun, 2 Oct 2022 08:47:21 +0200 Subject: [PATCH 4/4] Simplify the meson is_dir check --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 8601fb2bd..caa8b1aef 100644 --- a/meson.build +++ b/meson.build @@ -93,7 +93,7 @@ foreach directory_entry : directories directory_context = directory_entry[1] foreach size: sizes dir_exists = fs.is_dir(join_paths(meson.source_root (), directory, size)) - if (dir_exists == true) + if dir_exists foreach scale_factor : scale_factors # The Scale=1 attribute is useless, don't add it if (scale_factor.to_int() > 1)