meson: reformat with meson formatter
Apply the `meson format` results.
Change-Id: Ide29bf7e4bef23e31328a7e425ff700ea0aab39b
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/meson.build b/meson.build
index 12042d7..3ac632d 100644
--- a/meson.build
+++ b/meson.build
@@ -1,12 +1,15 @@
-project('phosphor-psu-code-mgmt', 'cpp',
- version: '0.1',
- meson_version: '>=1.1.1',
- default_options: [
- 'warning_level=3',
- 'werror=true',
- 'cpp_std=c++23',
- 'b_lto=true',
- ])
+project(
+ 'phosphor-psu-code-mgmt',
+ 'cpp',
+ version: '0.1',
+ meson_version: '>=1.1.1',
+ default_options: [
+ 'warning_level=3',
+ 'werror=true',
+ 'cpp_std=c++23',
+ 'b_lto=true',
+ ],
+)
systemd = dependency('systemd')
servicedir = systemd.get_variable('systemdsystemunitdir')
@@ -19,7 +22,10 @@
cdata.set_quoted('VERSION_IFACE', 'xyz.openbmc_project.Software.Version')
cdata.set_quoted('FILEPATH_IFACE', 'xyz.openbmc_project.Common.FilePath')
cdata.set_quoted('BUSNAME_UPDATER', 'xyz.openbmc_project.Software.Psu.Updater')
-cdata.set_quoted('PSU_INVENTORY_IFACE', 'xyz.openbmc_project.Inventory.Item.PowerSupply')
+cdata.set_quoted(
+ 'PSU_INVENTORY_IFACE',
+ 'xyz.openbmc_project.Inventory.Item.PowerSupply',
+)
cdata.set_quoted('ACTIVATION_FWD_ASSOCIATION', 'inventory')
cdata.set_quoted('ACTIVATION_REV_ASSOCIATION', 'activation')
cdata.set_quoted('ACTIVE_FWD_ASSOCIATION', 'active')
@@ -35,16 +41,25 @@
cdata.set_quoted('SOFTWARE_OBJPATH', get_option('SOFTWARE_OBJPATH'))
cdata.set_quoted('MANIFEST_FILE', get_option('MANIFEST_FILE'))
-cdata.set_quoted('PSU_INVENTORY_PATH_BASE', get_option('PSU_INVENTORY_PATH_BASE'))
+cdata.set_quoted(
+ 'PSU_INVENTORY_PATH_BASE',
+ get_option('PSU_INVENTORY_PATH_BASE'),
+)
cdata.set_quoted('PSU_VERSION_UTIL', get_option('PSU_VERSION_UTIL'))
cdata.set_quoted('PSU_MODEL_UTIL', get_option('PSU_MODEL_UTIL'))
-cdata.set_quoted('PSU_VERSION_COMPARE_UTIL', get_option('PSU_VERSION_COMPARE_UTIL'))
+cdata.set_quoted(
+ 'PSU_VERSION_COMPARE_UTIL',
+ get_option('PSU_VERSION_COMPARE_UTIL'),
+)
cdata.set_quoted('PSU_UPDATE_SERVICE', get_option('PSU_UPDATE_SERVICE'))
cdata.set_quoted('IMG_DIR', get_option('IMG_DIR'))
cdata.set_quoted('IMG_DIR_PERSIST', get_option('IMG_DIR_PERSIST'))
cdata.set_quoted('IMG_DIR_BUILTIN', get_option('IMG_DIR_BUILTIN'))
-cdata.set10('ALWAYS_USE_BUILTIN_IMG_DIR', get_option('ALWAYS_USE_BUILTIN_IMG_DIR'))
+cdata.set10(
+ 'ALWAYS_USE_BUILTIN_IMG_DIR',
+ get_option('ALWAYS_USE_BUILTIN_IMG_DIR'),
+)
phosphor_dbus_interfaces = dependency('phosphor-dbus-interfaces')
phosphor_logging = dependency('phosphor-logging')
@@ -57,9 +72,9 @@
build_examples = get_option('examples')
if build_examples
- subdir('vendor-example')
+ subdir('vendor-example')
endif
if not build_tests.disabled()
- subdir('test')
+ subdir('test')
endif
diff --git a/meson.options b/meson.options
index 68b3cfb..8149a6c 100644
--- a/meson.options
+++ b/meson.options
@@ -1,74 +1,106 @@
option('tests', type: 'feature', description: 'Build tests')
-option('oe-sdk', type: 'feature', value: 'disabled', description: 'Enable OE SDK')
-option('examples', type: 'boolean', value: true, description: 'Build vendor-example')
+option(
+ 'oe-sdk',
+ type: 'feature',
+ value: 'disabled',
+ description: 'Enable OE SDK',
+)
+option(
+ 'examples',
+ type: 'boolean',
+ value: true,
+ description: 'Build vendor-example',
+)
-option('MANIFEST_FILE',
- type: 'string',
- value: 'MANIFEST',
- description: 'The path of the MANIFEST file')
+option(
+ 'MANIFEST_FILE',
+ type: 'string',
+ value: 'MANIFEST',
+ description: 'The path of the MANIFEST file',
+)
-option('SOFTWARE_OBJPATH',
- type: 'string',
- value: '/xyz/openbmc_project/software',
- description: 'The software manager Dbus root')
+option(
+ 'SOFTWARE_OBJPATH',
+ type: 'string',
+ value: '/xyz/openbmc_project/software',
+ description: 'The software manager Dbus root',
+)
-option('PSU_INVENTORY_PATH_BASE',
- type: 'string',
- value: '/xyz/openbmc_project/inventory/system',
- description: 'The base path for PSU inventory')
+option(
+ 'PSU_INVENTORY_PATH_BASE',
+ type: 'string',
+ value: '/xyz/openbmc_project/inventory/system',
+ description: 'The base path for PSU inventory',
+)
-option('IMG_DIR',
- type: 'string',
- value: '/tmp/images',
- description: 'The directory where downloaded or uploaded PSU images are placed and extracted')
+option(
+ 'IMG_DIR',
+ type: 'string',
+ value: '/tmp/images',
+ description: 'The directory where downloaded or uploaded PSU images are placed and extracted',
+)
# The PSU_VERSION_UTIL specifies an executable that accepts the PSU
# inventory path as input, and output the version string, e.g
# psutils --get-version /xyz/openbmc_project/inventory/system/chassis/motherboard/powersupply0
# or in vendor-example
# get_version <some-psu-path>
-option('PSU_VERSION_UTIL',
- type: 'string',
- value: '/usr/bin/psutils --raw --get-version',
- description: 'The command and arguments to get PSU version')
+option(
+ 'PSU_VERSION_UTIL',
+ type: 'string',
+ value: '/usr/bin/psutils --raw --get-version',
+ description: 'The command and arguments to get PSU version',
+)
# The PSU_MODEL_UTIL specifies an executable that accepts the PSU
# inventory path as input and outputs the PSU model string.
# For example:
# psutils --get-model /xyz/openbmc_project/inventory/system/chassis/motherboard/powersupply0
-option('PSU_MODEL_UTIL',
- type: 'string',
- value: '/usr/bin/psutils --raw --get-model',
- description: 'The command and arguments to get the PSU model')
+option(
+ 'PSU_MODEL_UTIL',
+ type: 'string',
+ value: '/usr/bin/psutils --raw --get-model',
+ description: 'The command and arguments to get the PSU model',
+)
# The PSU_VERSION_COMPARE_UTIL specifies an executable that accepts the PSU
# versions as input, and outputs which version is the newest, e.g.
# psutils get-version 0001 0002 0003 # May output 0003
# or in vendor-example
# get_latest_version 0001 0002 0003 # output 0003
-option('PSU_VERSION_COMPARE_UTIL',
- type: 'string',
- value: '/usr/bin/psutils --raw --compare',
- description: 'The command and arguments to compare PSU versions')
+option(
+ 'PSU_VERSION_COMPARE_UTIL',
+ type: 'string',
+ value: '/usr/bin/psutils --raw --compare',
+ description: 'The command and arguments to compare PSU versions',
+)
# The PSU update service
# It shall take a path containing the PSU image(s) as the input
-option('PSU_UPDATE_SERVICE',
- type: 'string',
- value: 'psu-update@.service',
- description: 'The PSU update service')
+option(
+ 'PSU_UPDATE_SERVICE',
+ type: 'string',
+ value: 'psu-update@.service',
+ description: 'The PSU update service',
+)
-option('IMG_DIR_PERSIST',
- type: 'string',
- value: '/var/lib/obmc/psu',
- description: 'The writable directory to store updated PSU images persistently')
+option(
+ 'IMG_DIR_PERSIST',
+ type: 'string',
+ value: '/var/lib/obmc/psu',
+ description: 'The writable directory to store updated PSU images persistently',
+)
-option('IMG_DIR_BUILTIN',
- type: 'string',
- value: '/usr/share/obmc/psu',
- description: 'The read-only directory where the built-in PSU images are stored')
+option(
+ 'IMG_DIR_BUILTIN',
+ type: 'string',
+ value: '/usr/share/obmc/psu',
+ description: 'The read-only directory where the built-in PSU images are stored',
+)
-option('ALWAYS_USE_BUILTIN_IMG_DIR',
+option(
+ 'ALWAYS_USE_BUILTIN_IMG_DIR',
type: 'boolean',
value: false,
- description: 'Only scan for PSU images in IMG_BUILTIN_DIR')
+ description: 'Only scan for PSU images in IMG_BUILTIN_DIR',
+)
diff --git a/services/meson.build b/services/meson.build
index e94eeed..3abbe71 100644
--- a/services/meson.build
+++ b/services/meson.build
@@ -1,13 +1,9 @@
unit_files = [
'xyz.openbmc_project.Software.Psu.Updater.service',
- 'psu-update@.service'
+ 'psu-update@.service',
]
fs = import('fs')
foreach unit : unit_files
- fs.copyfile(
- unit,
- install: true,
- install_dir: servicedir
- )
+ fs.copyfile(unit, install: true, install_dir: servicedir)
endforeach
diff --git a/src/meson.build b/src/meson.build
index 75ab69a..083d02c 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -1,21 +1,15 @@
-configure_file(output: 'config.h',
- configuration: cdata,
-)
+configure_file(output: 'config.h', configuration: cdata)
psu_inc = include_directories('.')
executable(
- 'phosphor-psu-code-manager',
- 'activation.cpp',
- 'item_updater.cpp',
- 'main.cpp',
- 'version.cpp',
- 'utils.cpp',
- include_directories: psu_inc,
- dependencies: [
- phosphor_logging,
- phosphor_dbus_interfaces,
- sdbusplus,
- ssl,
- ],
- install: true,
- install_dir: get_option('bindir'))
+ 'phosphor-psu-code-manager',
+ 'activation.cpp',
+ 'item_updater.cpp',
+ 'main.cpp',
+ 'version.cpp',
+ 'utils.cpp',
+ include_directories: psu_inc,
+ dependencies: [phosphor_logging, phosphor_dbus_interfaces, sdbusplus, ssl],
+ install: true,
+ install_dir: get_option('bindir'),
+)
diff --git a/test/meson.build b/test/meson.build
index fdf2908..36f87ff 100644
--- a/test/meson.build
+++ b/test/meson.build
@@ -1,62 +1,76 @@
oe_sdk = get_option('oe-sdk')
if oe_sdk.allowed()
- # Setup OE SYSROOT
- OECORE_TARGET_SYSROOT = run_command('sh', '-c', 'echo $OECORE_TARGET_SYSROOT').stdout().strip()
- if OECORE_TARGET_SYSROOT == ''
- error('Unable to get $OECORE_TARGET_SYSROOT, check your environment.')
- endif
- message('OE_SYSROOT: ' + OECORE_TARGET_SYSROOT)
- rpath = ':'.join([OECORE_TARGET_SYSROOT + '/lib', OECORE_TARGET_SYSROOT + '/usr/lib'])
- ld_so = run_command('sh', '-c', 'find ' + OECORE_TARGET_SYSROOT + '/lib/ld-*.so | sort -r -n | head -n1').stdout().strip()
- dynamic_linker = ['-Wl,-dynamic-linker,' + ld_so]
+ # Setup OE SYSROOT
+ OECORE_TARGET_SYSROOT = run_command(
+ 'sh',
+ '-c',
+ 'echo $OECORE_TARGET_SYSROOT',
+ ).stdout().strip()
+ if OECORE_TARGET_SYSROOT == ''
+ error('Unable to get $OECORE_TARGET_SYSROOT, check your environment.')
+ endif
+ message('OE_SYSROOT: ' + OECORE_TARGET_SYSROOT)
+ rpath = ':'.join(
+ [OECORE_TARGET_SYSROOT + '/lib', OECORE_TARGET_SYSROOT + '/usr/lib'],
+ )
+ ld_so = run_command(
+ 'sh',
+ '-c',
+ 'find ' + OECORE_TARGET_SYSROOT + '/lib/ld-*.so | sort -r -n | head -n1',
+ ).stdout().strip()
+ dynamic_linker = ['-Wl,-dynamic-linker,' + ld_so]
else
- dynamic_linker = []
+ dynamic_linker = []
endif
gtest = dependency('gtest', main: true, disabler: true, required: build_tests)
gmock = dependency('gmock', disabler: true, required: build_tests)
-configure_file(output: 'config.h',
- configuration: cdata,
-)
+configure_file(output: 'config.h', configuration: cdata)
test_inc = include_directories('.')
test_util = executable(
- 'test_util',
- '../src/utils.cpp',
- 'test_utils.cpp',
- include_directories: [psu_inc, test_inc],
- link_args: dynamic_linker,
- build_rpath: oe_sdk.allowed() ? rpath : '',
- dependencies: [
- gtest,
- gmock,
- phosphor_logging,
- phosphor_dbus_interfaces,
- sdbusplus,
- ssl,
- ])
+ 'test_util',
+ '../src/utils.cpp',
+ 'test_utils.cpp',
+ include_directories: [psu_inc, test_inc],
+ link_args: dynamic_linker,
+ build_rpath: oe_sdk.allowed() ? rpath : '',
+ dependencies: [
+ gtest,
+ gmock,
+ phosphor_logging,
+ phosphor_dbus_interfaces,
+ sdbusplus,
+ ssl,
+ ],
+)
test_phosphor_psu_manager = executable(
- 'test_phosphor_psu_manager',
- '../src/activation.cpp',
- '../src/item_updater.cpp',
- '../src/version.cpp',
- 'test_item_updater.cpp',
- 'test_activation.cpp',
- 'test_version.cpp',
- include_directories: [psu_inc, test_inc],
- link_args: dynamic_linker,
- build_rpath: oe_sdk.allowed() ? rpath : '',
- dependencies: [
- gtest,
- gmock,
- phosphor_logging,
- phosphor_dbus_interfaces,
- sdbusplus,
- ssl,
- ])
+ 'test_phosphor_psu_manager',
+ '../src/activation.cpp',
+ '../src/item_updater.cpp',
+ '../src/version.cpp',
+ 'test_item_updater.cpp',
+ 'test_activation.cpp',
+ 'test_version.cpp',
+ include_directories: [psu_inc, test_inc],
+ link_args: dynamic_linker,
+ build_rpath: oe_sdk.allowed() ? rpath : '',
+ dependencies: [
+ gtest,
+ gmock,
+ phosphor_logging,
+ phosphor_dbus_interfaces,
+ sdbusplus,
+ ssl,
+ ],
+)
test('util', test_util)
#test('phosphor_psu_manager', test_phosphor_psu_manager)
-test('phosphor_psu_manager', test_phosphor_psu_manager, workdir: meson.current_source_dir())
+test(
+ 'phosphor_psu_manager',
+ test_phosphor_psu_manager,
+ workdir: meson.current_source_dir(),
+)
diff --git a/vendor-example/meson.build b/vendor-example/meson.build
index 7c779a3..4c4b5d6 100644
--- a/vendor-example/meson.build
+++ b/vendor-example/meson.build
@@ -1,27 +1,37 @@
oe_sdk = get_option('oe-sdk')
if oe_sdk.allowed()
- # Setup OE SYSROOT
- OECORE_TARGET_SYSROOT = run_command('sh', '-c', 'echo $OECORE_TARGET_SYSROOT').stdout().strip()
- if OECORE_TARGET_SYSROOT == ''
- error('Unable to get $OECORE_TARGET_SYSROOT, check your environment.')
- endif
- message('OE_SYSROOT: ' + OECORE_TARGET_SYSROOT)
- rpath = ':'.join([OECORE_TARGET_SYSROOT + '/lib', OECORE_TARGET_SYSROOT + '/usr/lib'])
- ld_so = run_command('sh', '-c', 'find ' + OECORE_TARGET_SYSROOT + '/lib/ld-*.so | sort -r -n | head -n1').stdout().strip()
- dynamic_linker = ['-Wl,-dynamic-linker,' + ld_so]
+ # Setup OE SYSROOT
+ OECORE_TARGET_SYSROOT = run_command(
+ 'sh',
+ '-c',
+ 'echo $OECORE_TARGET_SYSROOT',
+ ).stdout().strip()
+ if OECORE_TARGET_SYSROOT == ''
+ error('Unable to get $OECORE_TARGET_SYSROOT, check your environment.')
+ endif
+ message('OE_SYSROOT: ' + OECORE_TARGET_SYSROOT)
+ rpath = ':'.join(
+ [OECORE_TARGET_SYSROOT + '/lib', OECORE_TARGET_SYSROOT + '/usr/lib'],
+ )
+ ld_so = run_command(
+ 'sh',
+ '-c',
+ 'find ' + OECORE_TARGET_SYSROOT + '/lib/ld-*.so | sort -r -n | head -n1',
+ ).stdout().strip()
+ dynamic_linker = ['-Wl,-dynamic-linker,' + ld_so]
else
- dynamic_linker = []
+ dynamic_linker = []
endif
-examples = [
- 'get_version',
- 'get_latest_version',
-]
+examples = ['get_version', 'get_latest_version']
foreach example : examples
- executable(example, example + '.cpp',
- implicit_include_directories: false,
- link_args: dynamic_linker,
- build_rpath: oe_sdk.allowed() ? rpath : '')
+ executable(
+ example,
+ example + '.cpp',
+ implicit_include_directories: false,
+ link_args: dynamic_linker,
+ build_rpath: oe_sdk.allowed() ? rpath : '',
+ )
endforeach