]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
meson: validate the return code of subprocess commands
authorEli Schwartz <eschwartz@archlinux.org>
Wed, 13 Apr 2022 01:50:57 +0000 (21:50 -0400)
committerEli Schwartz <eschwartz@archlinux.org>
Wed, 13 Apr 2022 01:50:57 +0000 (21:50 -0400)
run_command() has an unfortunate early design quirk in that it doesn't
error when the command itself errors. Recent versions of Meson warn if
you do not explicitly specify whether the return code matters by passing
`check:` to it; this prevents building util-linux (including as a
subproject) with --fatal-meson-warnings.

meson.build

index 06c89b53e4b2eb68e6236c38a3f95f6026318fef..9c8db310ed802f7af78b07cee91fc3740043c1b9 100644 (file)
@@ -47,7 +47,7 @@ pc_version = []
 foreach code : codes
   res = run_command('bash', '-c',
                     '''echo '@0@' | awk -F. '@1@' '''.format(
-                      meson.project_version(), code))
+                      meson.project_version(), code), check: true)
   pc_version += res.stdout().strip()
 endforeach
 pc_version = '.'.join(pc_version)