1 |
commit: d2742fad0ebcdb912763f84637a3a52b7a13d895 |
2 |
Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Aug 2 18:35:55 2018 +0000 |
4 |
Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Aug 2 18:40:30 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d2742fad |
7 |
|
8 |
app-metrics/collectd: fix UDEV usage in disk plugin |
9 |
|
10 |
Closes: https://bugs.gentoo.org/662488 |
11 |
Package-Manager: Portage-2.3.44, Repoman-2.3.10 |
12 |
RepoMan-Options: --force |
13 |
|
14 |
...lectd-5.8.0.ebuild => collectd-5.8.0-r1.ebuild} | 2 + |
15 |
.../collectd-5.8.0-disk-plugin-udev-fix.patch | 98 ++++++++++++++++++++++ |
16 |
2 files changed, 100 insertions(+) |
17 |
|
18 |
diff --git a/app-metrics/collectd/collectd-5.8.0.ebuild b/app-metrics/collectd/collectd-5.8.0-r1.ebuild |
19 |
similarity index 99% |
20 |
rename from app-metrics/collectd/collectd-5.8.0.ebuild |
21 |
rename to app-metrics/collectd/collectd-5.8.0-r1.ebuild |
22 |
index 65229f538d9..a401e6d8c24 100644 |
23 |
--- a/app-metrics/collectd/collectd-5.8.0.ebuild |
24 |
+++ b/app-metrics/collectd/collectd-5.8.0-r1.ebuild |
25 |
@@ -159,6 +159,8 @@ REQUIRED_USE=" |
26 |
collectd_plugins_python? ( ${PYTHON_REQUIRED_USE} ) |
27 |
collectd_plugins_smart? ( udev )" |
28 |
|
29 |
+PATCHES=( "${FILESDIR}"/${P}-disk-plugin-udev-fix.patch ) |
30 |
+ |
31 |
# @FUNCTION: collectd_plugin_kernel_linux |
32 |
# @DESCRIPTION: |
33 |
# USAGE: <plugin name> <kernel_options> <severity> |
34 |
|
35 |
diff --git a/app-metrics/collectd/files/collectd-5.8.0-disk-plugin-udev-fix.patch b/app-metrics/collectd/files/collectd-5.8.0-disk-plugin-udev-fix.patch |
36 |
new file mode 100644 |
37 |
index 00000000000..1a96f06df0a |
38 |
--- /dev/null |
39 |
+++ b/app-metrics/collectd/files/collectd-5.8.0-disk-plugin-udev-fix.patch |
40 |
@@ -0,0 +1,98 @@ |
41 |
+From ed696c1b3adcb42d55759efe6f8034337f0fd243 Mon Sep 17 00:00:00 2001 |
42 |
+From: Dylan Stephano-Shachter <dylan@×××××××××××.net> |
43 |
+Date: Thu, 15 Feb 2018 16:37:33 -0500 |
44 |
+Subject: [PATCH] change HAVE_UDEV_H to HAVE_LIBUDEV_H for bug 2651 |
45 |
+ |
46 |
+--- |
47 |
+ src/disk.c | 20 ++++++++++---------- |
48 |
+ 1 file changed, 10 insertions(+), 10 deletions(-) |
49 |
+ |
50 |
+diff --git a/src/disk.c b/src/disk.c |
51 |
+index 004ce9e2d7..04f337415f 100644 |
52 |
+--- a/src/disk.c |
53 |
++++ b/src/disk.c |
54 |
+@@ -139,7 +139,7 @@ static int pnumdisk; |
55 |
+ #error "No applicable input method." |
56 |
+ #endif |
57 |
+ |
58 |
+-#if HAVE_UDEV_H |
59 |
++#if HAVE_LIBUDEV_H |
60 |
+ #include <libudev.h> |
61 |
+ |
62 |
+ static char *conf_udev_name_attr = NULL; |
63 |
+@@ -173,7 +173,7 @@ static int disk_config(const char *key, const char *value) { |
64 |
+ "on Mach / Mac OS X and will be ignored."); |
65 |
+ #endif |
66 |
+ } else if (strcasecmp("UdevNameAttr", key) == 0) { |
67 |
+-#if HAVE_UDEV_H |
68 |
++#if HAVE_LIBUDEV_H |
69 |
+ if (conf_udev_name_attr != NULL) { |
70 |
+ free(conf_udev_name_attr); |
71 |
+ conf_udev_name_attr = NULL; |
72 |
+@@ -209,7 +209,7 @@ static int disk_init(void) { |
73 |
+ /* #endif HAVE_IOKIT_IOKITLIB_H */ |
74 |
+ |
75 |
+ #elif KERNEL_LINUX |
76 |
+-#if HAVE_UDEV_H |
77 |
++#if HAVE_LIBUDEV_H |
78 |
+ if (conf_udev_name_attr != NULL) { |
79 |
+ handle_udev = udev_new(); |
80 |
+ if (handle_udev == NULL) { |
81 |
+@@ -217,7 +217,7 @@ static int disk_init(void) { |
82 |
+ return -1; |
83 |
+ } |
84 |
+ } |
85 |
+-#endif /* HAVE_UDEV_H */ |
86 |
++#endif /* HAVE_LIBUDEV_H */ |
87 |
+ /* #endif KERNEL_LINUX */ |
88 |
+ |
89 |
+ #elif KERNEL_FREEBSD |
90 |
+@@ -260,10 +260,10 @@ static int disk_init(void) { |
91 |
+ |
92 |
+ static int disk_shutdown(void) { |
93 |
+ #if KERNEL_LINUX |
94 |
+-#if HAVE_UDEV_H |
95 |
++#if HAVE_LIBUDEV_H |
96 |
+ if (handle_udev != NULL) |
97 |
+ udev_unref(handle_udev); |
98 |
+-#endif /* HAVE_UDEV_H */ |
99 |
++#endif /* HAVE_LIBUDEV_H */ |
100 |
+ #endif /* KERNEL_LINUX */ |
101 |
+ return 0; |
102 |
+ } /* int disk_shutdown */ |
103 |
+@@ -325,7 +325,7 @@ static counter_t disk_calc_time_incr(counter_t delta_time, |
104 |
+ } |
105 |
+ #endif |
106 |
+ |
107 |
+-#if HAVE_UDEV_H |
108 |
++#if HAVE_LIBUDEV_H |
109 |
+ /** |
110 |
+ * Attempt to provide an rename disk instance from an assigned udev attribute. |
111 |
+ * |
112 |
+@@ -841,7 +841,7 @@ static int disk_read(void) { |
113 |
+ |
114 |
+ output_name = disk_name; |
115 |
+ |
116 |
+-#if HAVE_UDEV_H |
117 |
++#if HAVE_LIBUDEV_H |
118 |
+ char *alt_name = NULL; |
119 |
+ if (conf_udev_name_attr != NULL) { |
120 |
+ alt_name = |
121 |
+@@ -852,7 +852,7 @@ static int disk_read(void) { |
122 |
+ #endif |
123 |
+ |
124 |
+ if (ignorelist_match(ignorelist, output_name) != 0) { |
125 |
+-#if HAVE_UDEV_H |
126 |
++#if HAVE_LIBUDEV_H |
127 |
+ /* release udev-based alternate name, if allocated */ |
128 |
+ sfree(alt_name); |
129 |
+ #endif |
130 |
+@@ -878,7 +878,7 @@ static int disk_read(void) { |
131 |
+ submit_io_time(output_name, io_time, weighted_time); |
132 |
+ } /* if (is_disk) */ |
133 |
+ |
134 |
+-#if HAVE_UDEV_H |
135 |
++#if HAVE_LIBUDEV_H |
136 |
+ /* release udev-based alternate name, if allocated */ |
137 |
+ sfree(alt_name); |
138 |
+ #endif |