meson: avoid calling the shell to resolve efi_libdir
authorMike Gilbert <floppym@gentoo.org>
Sun, 30 Sep 2018 20:18:43 +0000 (16:18 -0400)
committerFelipe Sateler <fsateler@debian.org>
Thu, 6 Dec 2018 00:03:34 +0000 (00:03 +0000)
(cherry picked from commit 5f723125aece111f1990f9ff6d3572fb2509ad19)

Gbp-Pq: Name meson-avoid-calling-the-shell-to-resolve-efi_libdir.patch

src/boot/efi/meson.build

index 04ca02f164cbbe25f27b3a7f7d788a6a42894c0b..77b311b254da79c3c3573593bbe90a73248b40a0 100644 (file)
@@ -57,10 +57,13 @@ if conf.get('ENABLE_EFI') == 1 and get_option('gnu-efi') != 'false'
 
         efi_libdir = get_option('efi-libdir')
         if efi_libdir == ''
-                cmd = 'cd /usr/lib/$(@0@ -print-multi-os-directory) && pwd'.format(' '.join(efi_cc))
-                ret = run_command('sh', '-c', cmd)
+                ret = run_command(efi_cc + ['-print-multi-os-directory'])
                 if ret.returncode() == 0
-                        efi_libdir = ret.stdout().strip()
+                        path = join_paths('/usr/lib', ret.stdout().strip())
+                        ret = run_command('realpath', '-e', path)
+                        if ret.returncode() == 0
+                                efi_libdir = ret.stdout().strip()
+                        endif
                 endif
         endif