[2/4] examples: simplify getting list of all examples

Message ID 20190423220644.54589-3-bruce.richardson@intel.com (mailing list archive)
State Superseded, archived
Headers
Series add testing of libdpdk pkg-config file |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Bruce Richardson April 23, 2019, 10:06 p.m. UTC
  Using find rather than shelling out to a one-liner script is easier to
read and understand, as well as allowing shorter lines in the code.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 examples/meson.build | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
  

Patch

diff --git a/examples/meson.build b/examples/meson.build
index 1a6134f12..19f2686b2 100644
--- a/examples/meson.build
+++ b/examples/meson.build
@@ -8,8 +8,9 @@  endif
 
 execinfo = cc.find_library('execinfo', required: false)
 
-all_examples = run_command('sh', '-c',
-	'cd $MESON_SOURCE_ROOT/$MESON_SUBDIR && for d in * ; do if [ -d $d ] ; then echo $d ; fi ; done'
+all_examples = run_command('find', meson.current_source_dir(),
+	'-maxdepth', '1', '-mindepth', '1',
+	'-type', 'd', '-printf', '%f '
 	).stdout().split()
 # install all example code on install - irrespective of whether the example in
 # question is to be built as part of this build or not.