[PATCH 2.5/4 libinput] test: install hwdb.d files in /etc, not /run
Peter Hutterer
peter.hutterer at who-t.net
Wed Jun 10 16:43:51 PDT 2015
systemd is dropping support for /run/udev/hwdb.d (which it never really
supported except some documentation mentioning it). So drop our hwdb.d files
into /etc/udev/hwdb.d instead and mark them with a REMOVEME and a comment that
if that file is left after the tests, it should be removed by the user.
https://github.com/systemd/systemd/issues/127
Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
I'll squash this in with 2/4 before pushing, but sent as separate patch for
easier review.
test/litest.c | 22 +++++++++++++++++-----
1 file changed, 17 insertions(+), 5 deletions(-)
diff --git a/test/litest.c b/test/litest.c
index e7bfbb8..74d1292 100644
--- a/test/litest.c
+++ b/test/litest.c
@@ -50,9 +50,9 @@
#define UDEV_RULES_D "/run/udev/rules.d"
#define UDEV_RULE_PREFIX "99-litest-"
-#define UDEV_HWDB_D "/run/udev/hwdb.d"
+#define UDEV_HWDB_D "/etc/udev/hwdb.d"
#define UDEV_COMMON_RULE_FILE UDEV_RULES_D "/91-litest-model-quirks.rules"
-#define UDEV_COMMON_HWDB_FILE UDEV_HWDB_D "/91-litest-model-quirks.hwdb"
+#define UDEV_COMMON_HWDB_FILE UDEV_HWDB_D "/91-litest-model-quirks-REMOVEME.hwdb"
static int in_debugger = -1;
static int verbose = 0;
@@ -893,12 +893,16 @@ merge_events(const int *orig, const int *override)
}
static inline void
-litest_copy_file(const char *dest, const char *src)
+litest_copy_file(const char *dest, const char *src, const char *header)
{
int in, out;
out = open(dest, O_CREAT|O_WRONLY, 0644);
litest_assert_int_gt(out, -1);
+
+ if (header)
+ write(out, header, strlen(header));
+
in = open(src, O_RDONLY);
litest_assert_int_gt(in, -1);
/* lazy, just check for error and empty file copy */
@@ -910,8 +914,16 @@ litest_copy_file(const char *dest, const char *src)
static inline void
litest_install_model_quirks(void)
{
- litest_copy_file(UDEV_COMMON_RULE_FILE, LIBINPUT_UDEV_RULES_FILE);
- litest_copy_file(UDEV_COMMON_HWDB_FILE, LIBINPUT_UDEV_HWDB_FILE);
+ litest_copy_file(UDEV_COMMON_RULE_FILE, LIBINPUT_UDEV_RULES_FILE, NULL);
+ litest_copy_file(UDEV_COMMON_HWDB_FILE,
+ LIBINPUT_UDEV_HWDB_FILE,
+ "#################################################################\n"
+ "# WARNING: REMOVE THIS FILE\n"
+ "# This is the run-time hwdb file for the libinput test suite and\n"
+ "# should be removed on exit. If the test-suite is not currently \n"
+ "# running, remove this file and update your hwdb: \n"
+ "# sudo udevadm hwdb --update\n"
+ "#################################################################\n\n");
}
static inline void
--
2.4.1
More information about the wayland-devel
mailing list