Skip to content

Commit

Permalink
Merge pull request #926 from vojtechtrefny/master_versioned-conf-dire…
Browse files Browse the repository at this point in the history
…ctory

Make the conf.d directory versioned
  • Loading branch information
vojtechtrefny authored Jul 4, 2023
2 parents 84e0361 + 28d5d8c commit b4c568d
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ AS_IF([test "x$with_nvme" != "xno"],
],
[])

AC_SUBST([MAJOR_VER], [\"2\"])
AC_SUBST([MAJOR_VER], [3])

CFLAGS="$CFLAGS -std=gnu99"

Expand Down
2 changes: 1 addition & 1 deletion data/conf.d/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
libbdconfdir = $(sysconfdir)/libblockdev/conf.d
libbdconfdir = $(sysconfdir)/libblockdev/@MAJOR_VER@/conf.d
dist_libbdconf_DATA = ${srcdir}/00-default.cfg

if WITH_LVM_DBUS
Expand Down
6 changes: 3 additions & 3 deletions dist/libblockdev.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -641,8 +641,8 @@ find %{buildroot} -type f -name "*.la" | xargs %{__rm}
%{_libdir}/girepository*/BlockDev*.typelib
%endif
%dir %{_sysconfdir}/libblockdev
%dir %{_sysconfdir}/libblockdev/conf.d
%config %{_sysconfdir}/libblockdev/conf.d/00-default.cfg
%dir %{_sysconfdir}/libblockdev/@MAJOR_VER@/conf.d
%config %{_sysconfdir}/libblockdev/@MAJOR_VER@/conf.d/00-default.cfg

%files devel
%{_libdir}/libblockdev.so
Expand Down Expand Up @@ -751,7 +751,7 @@ find %{buildroot} -type f -name "*.la" | xargs %{__rm}
%if %{with_lvm_dbus}
%files lvm-dbus
%{_libdir}/libbd_lvm-dbus.so.*
%config %{_sysconfdir}/libblockdev/conf.d/10-lvm-dbus.cfg
%config %{_sysconfdir}/libblockdev/@MAJOR_VER@/conf.d/10-lvm-dbus.cfg

%files lvm-dbus-devel
%{_libdir}/libbd_lvm-dbus.so
Expand Down
16 changes: 8 additions & 8 deletions src/lib/blockdev.c.in
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
*
*/

#define DEFAULT_CONF_DIR_PATH "/etc/libblockdev/conf.d/"
#define DEFAULT_CONF_DIR_PATH "/etc/libblockdev/@MAJOR_VER@/conf.d/"

static GMutex init_lock;
static gboolean initialized = FALSE;
Expand All @@ -55,13 +55,13 @@ typedef void* (*LoadFunc) (const gchar *so_name);

/* KEEP THE ORDERING OF THESE ARRAYS MATCHING THE BDPluginName ENUM! */
static gchar * default_plugin_so[BD_PLUGIN_UNDEF] = {
"libbd_lvm.so."@MAJOR_VER@, "libbd_btrfs.so."@MAJOR_VER@,
"libbd_swap.so."@MAJOR_VER@, "libbd_loop.so."@MAJOR_VER@,
"libbd_crypto.so."@MAJOR_VER@, "libbd_mpath.so."@MAJOR_VER@,
"libbd_dm.so."@MAJOR_VER@, "libbd_mdraid.so."@MAJOR_VER@,
"libbd_s390.so."@MAJOR_VER@, "libbd_part.so."@MAJOR_VER@,
"libbd_fs.so."@MAJOR_VER@, "libbd_nvdimm.so."@MAJOR_VER@,
"libbd_nvme.so."@MAJOR_VER@
"libbd_lvm.so.@MAJOR_VER@", "libbd_btrfs.so.@MAJOR_VER@",
"libbd_swap.so.@MAJOR_VER@", "libbd_loop.so.@MAJOR_VER@",
"libbd_crypto.so.@MAJOR_VER@", "libbd_mpath.so.@MAJOR_VER@",
"libbd_dm.so.@MAJOR_VER@", "libbd_mdraid.so.@MAJOR_VER@",
"libbd_s390.so.@MAJOR_VER@", "libbd_part.so.@MAJOR_VER@",
"libbd_fs.so.@MAJOR_VER@", "libbd_nvdimm.so.@MAJOR_VER@",
"libbd_nvme.so.@MAJOR_VER@"
};
static BDPluginStatus plugins[BD_PLUGIN_UNDEF] = {
{{BD_PLUGIN_LVM, NULL}, NULL},
Expand Down
2 changes: 1 addition & 1 deletion tests/run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ def _parse_skip_config(config):
args = parse_args()
if args.installed:
os.environ['LIBBLOCKDEV_TESTS_SKIP_OVERRIDE'] = ''
os.environ['LIBBLOCKDEV_CONFIG_DIR'] = '/etc/libblockdev/conf.d/'
os.environ['LIBBLOCKDEV_CONFIG_DIR'] = '/etc/libblockdev/3/conf.d/'
else:
if 'LD_LIBRARY_PATH' not in os.environ and 'GI_TYPELIB_PATH' not in os.environ:
os.environ['LD_LIBRARY_PATH'] = LIBDIRS
Expand Down

0 comments on commit b4c568d

Please sign in to comment.