]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
meson: use meson features instead of bash
authorsewn <sewn@disroot.org>
Sat, 29 Jul 2023 02:50:41 +0000 (05:50 +0300)
committersewn <sewn@disroot.org>
Sat, 29 Jul 2023 04:01:13 +0000 (07:01 +0300)
meson.build

index 6c6dc527b28f078e10bcd39f7b48702d6b47c417..067cfa9a1fc5178ef8e86222f3d884fbeecf97ea 100644 (file)
@@ -41,16 +41,13 @@ conf.set_quoted('PACKAGE_VERSION', meson.project_version())
 package_string = '@0@ @1@'.format(meson.project_name(), meson.project_version())
 conf.set_quoted('PACKAGE_STRING', package_string)
 
-codes = [''' {print $1}  ''',
-         ''' {sub("-.*","",$2); print $2} ''',
-         ''' {sub("-.*","",$3); print $3 ~ /^[0-9]+$/ ? $3 : 0} ''']
 pc_version = []
-foreach code : codes
-  res = run_command('bash', '-c',
-                    '''echo '@0@' | awk -F. '@1@' '''.format(
-                      meson.project_version(), code), check: true)
-  pc_version += res.stdout().strip()
-endforeach
+pc_version = meson.project_version().split('-')[0].split('.')
+
+if pc_version.length() < 3
+    pc_version += '0'
+endif
+
 pc_version = '.'.join(pc_version)
 
 conf.set_quoted('LIBBLKID_VERSION', libblkid_version)
@@ -2890,7 +2887,7 @@ endif
 syscalls_h = custom_target('syscalls.h',
   input : 'tools/all_syscalls',
   output : 'syscalls.h',
-  command : ['bash', '@INPUT@', cc.cmd_array()],
+  command : ['tools/all_syscalls', cc.cmd_array()] 
 )
 
 if cc.compiles(fs.read('include/audit-arch.h'), name : 'has AUDIT_ARCH_NATIVE')