From 4e307280d6eef34742087419577156628ced9498 Mon Sep 17 00:00:00 2001 From: Eirik Nygaard Date: Thu, 27 Jan 2022 15:53:18 +0100 Subject: [PATCH] Make entire path for plocate database configurable --- meson.build | 6 +++--- meson_options.txt | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/meson.build b/meson.build index 435cd0a..7f47516 100644 --- a/meson.build +++ b/meson.build @@ -2,8 +2,7 @@ project('plocate', 'cpp', default_options: ['buildtype=debugoptimized','cpp_std= add_project_arguments('-DGROUPNAME="' + get_option('locategroup') + '"', language: 'cpp') add_project_arguments('-DUPDATEDB_CONF="/etc/updatedb.conf"', language: 'cpp') -dbdir = join_paths(get_option('sharedstatedir'), 'plocate') -dbfile = join_paths(dbdir, 'plocate.db') +dbfile = join_paths(get_option('sharedstatedir'), get_option('dbpath')) add_project_arguments('-DDBFILE="' + dbfile + '"', language: 'cpp') add_project_arguments('-DPACKAGE_NAME="plocate"', language: 'cpp') add_project_arguments('-DPACKAGE_VERSION="' + meson.project_version() + '"', language: 'cpp') @@ -56,7 +55,8 @@ update_script = configure_file(input: 'update-plocate.sh', output: 'update-plocate.sh', configuration: conf_data) -meson.add_install_script('mkdir.sh', dbdir) +fs = import('fs') +meson.add_install_script('mkdir.sh', fs.parent(dbfile)) if get_option('install_cron') install_data(update_script, diff --git a/meson_options.txt b/meson_options.txt index 8ac13c5..a9f3358 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -3,3 +3,4 @@ option('install_systemd', type: 'boolean', value: true, description: 'Install sy option('systemunitdir', type: 'string', description: 'Where to install systemd units to (default: autodetect)') option('locategroup', type: 'string', value: 'plocate', description: 'Group that the install script will use for the .db file') option('updatedb_progname', type: 'string', value: 'updatedb', description: 'Binary name of updatedb') +option('dbpath', type: 'string', value: 'plocate/plocate.db', description: 'Path to plocate database relative to "sharedstatedir"') -- 2.39.2