Rename data/ to quirks/

A better, less ambiguous name than just "datadir"

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2018-07-13 12:57:02 +10:00
parent e2d62645db
commit e6cad92005
31 changed files with 50 additions and 48 deletions

View file

@ -9,7 +9,7 @@ installed under `/usr/share/libinput/<filename>.quirks` and are standard
`.ini` files. A file may contain multiple section headers (`[some
identifier]`) followed by one or more `MatchFoo=Bar` directives, followed by
at least one of `ModelFoo=1` or `AttrFoo=bar` directive. See the
`data/README.md` file in the libinput source repository for more details on
`quirks/README.md` file in the libinput source repository for more details on
their contents.
@note Model quirks are internal API and may change at any time. No

View file

@ -99,7 +99,7 @@ installed.
$ cd path/to/libinput.git
# Use an approximate multiplier in the quirks file
$ cat > data/99-trackpont-override.quirks <<EOF
$ cat > quirks/99-trackpont-override.quirks <<EOF
[Trackpoint Override]
MatchUdevType=pointingstick
AttrTrackpointMultiplier=1.0
@ -125,7 +125,7 @@ Once the trackpoint behaves correctly you are ready to test the system
libinput:
@verbatim
$ sudo cp data/99-trackpoint-override.quirks /etc/libinput/local-overrides.quirks
$ sudo cp quirks/99-trackpoint-override.quirks /etc/libinput/local-overrides.quirks
@endverbatim
Now verify the override is seen by the system libinput

View file

@ -12,7 +12,7 @@ dir_libexec = join_paths(get_option('prefix'), get_option('libexecdir'), 'li
dir_lib = join_paths(get_option('prefix'), get_option('libdir'))
dir_man1 = join_paths(get_option('prefix'), get_option('mandir'), 'man1')
dir_system_udev = join_paths(get_option('prefix'), 'lib', 'udev')
dir_src_quirks = join_paths(meson.source_root(), 'data')
dir_src_quirks = join_paths(meson.source_root(), 'quirks')
dir_src_test = join_paths(meson.source_root(), 'test')
dir_src = join_paths(meson.source_root(), 'src')
@ -185,37 +185,37 @@ dep_libfilter = declare_dependency(link_with : libfilter)
############ libquirks.a #############
libinput_data_path = dir_data
libinput_data_override_path = join_paths(dir_sysconf, 'local-overrides.quirks')
config_h.set_quoted('LIBINPUT_DATA_DIR', dir_data)
config_h.set_quoted('LIBINPUT_DATA_OVERRIDE_FILE', libinput_data_override_path)
config_h.set_quoted('LIBINPUT_QUIRKS_DIR', dir_data)
config_h.set_quoted('LIBINPUT_QUIRKS_OVERRIDE_FILE', libinput_data_override_path)
quirks_data = [
'data/10-generic-keyboard.quirks',
'data/10-generic-lid.quirks',
'data/10-generic-trackball.quirks',
'data/30-vendor-aiptek.quirks',
'data/30-vendor-alps.quirks',
'data/30-vendor-cyapa.quirks',
'data/30-vendor-elantech.quirks',
'data/30-vendor-huion.quirks',
'data/30-vendor-ibm.quirks',
'data/30-vendor-logitech.quirks',
'data/30-vendor-microsoft.quirks',
'data/30-vendor-razer.quirks',
'data/30-vendor-synaptics.quirks',
'data/30-vendor-wacom.quirks',
'data/50-system-apple.quirks',
'data/50-system-asus.quirks',
'data/50-system-chicony.quirks',
'data/50-system-cyborg.quirks',
'data/50-system-dell.quirks',
'data/50-system-google.quirks',
'data/50-system-hp.quirks',
'data/50-system-lenovo.quirks',
'data/50-system-system76.quirks',
'quirks/10-generic-keyboard.quirks',
'quirks/10-generic-lid.quirks',
'quirks/10-generic-trackball.quirks',
'quirks/30-vendor-aiptek.quirks',
'quirks/30-vendor-alps.quirks',
'quirks/30-vendor-cyapa.quirks',
'quirks/30-vendor-elantech.quirks',
'quirks/30-vendor-huion.quirks',
'quirks/30-vendor-ibm.quirks',
'quirks/30-vendor-logitech.quirks',
'quirks/30-vendor-microsoft.quirks',
'quirks/30-vendor-razer.quirks',
'quirks/30-vendor-synaptics.quirks',
'quirks/30-vendor-wacom.quirks',
'quirks/50-system-apple.quirks',
'quirks/50-system-asus.quirks',
'quirks/50-system-chicony.quirks',
'quirks/50-system-cyborg.quirks',
'quirks/50-system-dell.quirks',
'quirks/50-system-google.quirks',
'quirks/50-system-hp.quirks',
'quirks/50-system-lenovo.quirks',
'quirks/50-system-system76.quirks',
]
config_h.set_quoted('LIBINPUT_DATA_FILES', ':'.join(quirks_data))
config_h.set_quoted('LIBINPUT_DATA_SRCDIR', dir_src_quirks)
config_h.set_quoted('LIBINPUT_QUIRKS_FILES', ':'.join(quirks_data))
config_h.set_quoted('LIBINPUT_QUIRKS_SRCDIR', dir_src_quirks)
install_data(quirks_data, install_dir : dir_data)

View file

@ -1734,10 +1734,10 @@ libinput_init_quirks(struct libinput *libinput)
/* If we fail, we'll fail next time too */
libinput->quirks_initialized = true;
data_path = getenv("LIBINPUT_DATA_DIR");
data_path = getenv("LIBINPUT_QUIRKS_DIR");
if (!data_path) {
data_path = LIBINPUT_DATA_DIR;
override_file = LIBINPUT_DATA_OVERRIDE_FILE;
data_path = LIBINPUT_QUIRKS_DIR;
override_file = LIBINPUT_QUIRKS_OVERRIDE_FILE;
}
quirks = quirks_init_subsystem(data_path,

View file

@ -866,7 +866,7 @@ litest_run_suite(struct list *tests, int which, int max, int error_fd)
struct name *n, *tmp;
struct list testnames;
quirks_context = quirks_init_subsystem(getenv("LIBINPUT_DATA_DIR"),
quirks_context = quirks_init_subsystem(getenv("LIBINPUT_QUIRKS_DIR"),
NULL,
quirk_log_handler,
NULL,
@ -1095,12 +1095,12 @@ litest_run(int argc, char **argv)
verbose = 1;
#if DISABLE_DEVICE_TESTS
quirks_dir = safe_strdup(LIBINPUT_DATA_SRCDIR);
quirks_dir = safe_strdup(LIBINPUT_QUIRKS_SRCDIR);
#else
litest_init_udev_rules(&created_files_list);
quirks_dir = litest_install_quirks(&created_files_list);
#endif
setenv("LIBINPUT_DATA_DIR", quirks_dir, 1);
setenv("LIBINPUT_QUIRKS_DIR", quirks_dir, 1);
free(quirks_dir);
litest_setup_sighandler(SIGINT);
@ -1296,19 +1296,21 @@ litest_install_quirks(struct list *created_files_list)
litest_assert_notnull(mkdtemp(dirname));
litest_assert_int_ne(chmod(dirname, 0755), -1);
quirks = strv_from_string(LIBINPUT_DATA_FILES, ":");
quirks = strv_from_string(LIBINPUT_QUIRKS_FILES, ":");
litest_assert(quirks);
q = quirks;
while (*q) {
const char *quirksdir = "quirks/";
char *filename;
char dest[PATH_MAX];
char src[PATH_MAX];
litest_assert(strneq(*q, "data/", 5));
filename = &(*q)[5];
litest_assert(strneq(*q, quirksdir, strlen(quirksdir)));
filename = &(*q)[strlen(quirksdir)];
snprintf(src, sizeof(src), "%s/%s", LIBINPUT_DATA_SRCDIR, filename);
snprintf(src, sizeof(src), "%s/%s",
LIBINPUT_QUIRKS_SRCDIR, filename);
snprintf(dest, sizeof(dest), "%s/%s", dirname, filename);
file = litest_copy_file(dest, src, NULL);
list_append(created_files_list, &file->link);

View file

@ -74,10 +74,10 @@ static void
usage(void)
{
printf("Usage:\n"
" libinput quirks list [--data-dir /path/to/data/dir] /dev/input/event0\n"
" libinput quirks list [--data-dir /path/to/quirks/dir] /dev/input/event0\n"
" Print the quirks for the given device\n"
"\n"
" libinput quirks validate [--data-dir /path/to/data/dir]\n"
" libinput quirks validate [--data-dir /path/to/quirks/dir]\n"
" Validate the database\n");
}
@ -166,11 +166,11 @@ main(int argc, char **argv)
builddir = tools_execdir_is_builddir();
if (builddir) {
data_path = LIBINPUT_DATA_SRCDIR;
data_path = LIBINPUT_QUIRKS_SRCDIR;
free(builddir);
} else {
data_path = LIBINPUT_DATA_DIR;
override_file = LIBINPUT_DATA_OVERRIDE_FILE;
data_path = LIBINPUT_QUIRKS_DIR;
override_file = LIBINPUT_QUIRKS_OVERRIDE_FILE;
}
}

View file

@ -1688,8 +1688,8 @@ print_device_quirks(struct record_context *ctx, struct record_device *dev)
struct udev_device *udev_device = NULL;
struct stat st;
struct quirks_context *quirks;
const char *data_path = LIBINPUT_DATA_DIR;
const char *override_file = LIBINPUT_DATA_OVERRIDE_FILE;
const char *data_path = LIBINPUT_QUIRKS_DIR;
const char *override_file = LIBINPUT_QUIRKS_OVERRIDE_FILE;
if (stat(dev->devnode, &st) < 0)
return;