all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
blob 7cc3f97451ff3a24cdc2877e4a09cf22916565bd 2246 bytes (raw)
name: gnu/packages/patches/eudev-rules-directory.patch 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
 
Add $EUDEV_RULES_DIRECTORY to the list of rules directories.

The old udev 182 supported $UDEV_CONFIG_FILE, which in turn allowed
the search path to be customized, but eudev no longer has this, hence
this hack.

Index: eudev/src/udev/udev-rules.c
===================================================================
--- eudev.orig/src/udev/udev-rules.c
+++ eudev/src/udev/udev-rules.c
@@ -48,15 +48,11 @@ struct uid_gid {
         };
 };
 
-static const char* const rules_dirs[] = {
+static const char* rules_dirs[] = {
+        NULL,			/* placeholder for $EUDEV_RULES_DIRECTORY */
         UDEV_CONF_DIR "/rules.d",
         UDEV_RULES_DIR,
-        UDEV_ROOT_RUN "/udev/rules.d",
         UDEV_LIBEXEC_DIR "/rules.d",
-#ifdef HAVE_SPLIT_USR
-        "/lib/udev/rules.d",
-        "/usr/lib/udev/rules.d",
-#endif
         NULL};
 
 struct udev_rules {
@@ -1691,6 +1687,14 @@ static int parse_file(struct udev_rules
         return 0;
 }
 
+static const char** rules_dirs_real()
+{
+        if (rules_dirs[0])
+                return rules_dirs;
+        else
+                return rules_dirs + 1;
+}
+
 struct udev_rules *udev_rules_new(struct udev *udev, int resolve_names) {
         struct udev_rules *rules;
         struct udev_list file_list;
@@ -1717,7 +1721,10 @@ struct udev_rules *udev_rules_new(struct
 
         udev_rules_check_timestamp(rules);
 
-        r = conf_files_list_strv(&files, ".rules", NULL, rules_dirs);
+        /* Allow the user to specify an additional rules directory.  */
+        rules_dirs[0] = getenv("EUDEV_RULES_DIRECTORY");
+
+        r = conf_files_list_strv(&files, ".rules", NULL, rules_dirs_real ());
         if (r < 0) {
                 log_error_errno(r, "failed to enumerate rules files: %m");
                 return udev_rules_unref(rules);
@@ -1776,7 +1783,9 @@ bool udev_rules_check_timestamp(struct u
         if (!rules)
                 return false;
 
-        return paths_check_timestamp(rules_dirs, &rules->dirs_ts_usec, true);
+        return paths_check_timestamp(rules_dirs_real (),
+                                     &rules->dirs_ts_usec,
+                                     true);
 }
 
 static int match_key(struct udev_rules *rules, struct token *token, const char *val) {

debug log:

solving 7cc3f97451 ...
found 7cc3f97451 in https://yhetil.org/guix/06ea6673ca13ed6bc7fb00336dafc7a3457412ee.1684178049.git.liliana.prikler@gmail.com/
found 54fc01c6d5 in https://git.savannah.gnu.org/cgit/guix.git
preparing index
index prepared:
100644 54fc01c6d5c8509c8bcc96bd2eef410ec795e251	gnu/packages/patches/eudev-rules-directory.patch

applying [1/1] https://yhetil.org/guix/06ea6673ca13ed6bc7fb00336dafc7a3457412ee.1684178049.git.liliana.prikler@gmail.com/
diff --git a/gnu/packages/patches/eudev-rules-directory.patch b/gnu/packages/patches/eudev-rules-directory.patch
index 54fc01c6d5..7cc3f97451 100644

1:38: trailing whitespace.
 
1:67: trailing whitespace.
 
1:73: trailing whitespace.
 
Checking patch gnu/packages/patches/eudev-rules-directory.patch...
Applied patch gnu/packages/patches/eudev-rules-directory.patch cleanly.
warning: 3 lines add whitespace errors.

index at:
100644 7cc3f97451ff3a24cdc2877e4a09cf22916565bd	gnu/packages/patches/eudev-rules-directory.patch

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.