Gentoo Archives: gentoo-commits

From: David Seifert <soap@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-analyzer/nagios-plugins-snmp/files/, net-analyzer/nagios-plugins-snmp/
Date: Fri, 01 Jan 2021 18:04:39
Message-Id: 1609524263.ee2353247311d477ac24d91dead7b99f3b7ac6ec.soap@gentoo
1 commit: ee2353247311d477ac24d91dead7b99f3b7ac6ec
2 Author: Jakov Smolic <jakov.smolic <AT> sartura <DOT> hr>
3 AuthorDate: Fri Jan 1 18:04:23 2021 +0000
4 Commit: David Seifert <soap <AT> gentoo <DOT> org>
5 CommitDate: Fri Jan 1 18:04:23 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ee235324
7
8 net-analyzer/nagios-plugins-snmp: Fix build with gcc-10
9
10 Closes: https://bugs.gentoo.org/707454
11 Signed-off-by: Jakov Smolic <jakov.smolic <AT> sartura.hr>
12 Signed-off-by: David Seifert <soap <AT> gentoo.org>
13
14 .../nagios-plugins-snmp-0.6.0-fno-common.patch | 83 ++++++++++++++++++++++
15 .../nagios-plugins-snmp-0.6.0-r2.ebuild | 4 +-
16 2 files changed, 86 insertions(+), 1 deletion(-)
17
18 diff --git a/net-analyzer/nagios-plugins-snmp/files/nagios-plugins-snmp-0.6.0-fno-common.patch b/net-analyzer/nagios-plugins-snmp/files/nagios-plugins-snmp-0.6.0-fno-common.patch
19 new file mode 100644
20 index 00000000000..5fd2ff1c235
21 --- /dev/null
22 +++ b/net-analyzer/nagios-plugins-snmp/files/nagios-plugins-snmp-0.6.0-fno-common.patch
23 @@ -0,0 +1,83 @@
24 +--- a/src/nagios_common_snmp.c
25 ++++ b/src/nagios_common_snmp.c
26 +@@ -1,5 +1,22 @@
27 + #include "nagios_common_snmp.h"
28 +
29 ++char plugin_name[30]; /* plugin name */
30 ++char plugin_tmp_prefix[50];
31 ++char output[MAX_OUTPUT];
32 ++int output_overflow;
33 ++char *p_output;
34 ++char *o_host;
35 ++int o_verb;
36 ++char* error;
37 ++int o_port,o_timeout;
38 ++int o_help, o_verbose,o_version,o_v2c;
39 ++int retries;
40 ++int o_snmpver,snmp_bulk;
41 ++char *o_community,*o_login,*o_passwd,*o_privpasswd;
42 ++char *o_protocols[2],*o_authproto,*o_privproto;
43 ++struct snmp_session session, *ss;
44 ++
45 ++
46 + int init_plugins_gettext(){
47 + if (setlocale( LC_ALL, "" )==NULL) return 1;
48 + bindtextdomain( PACKAGE, LOCALEDIR );
49 +--- a/src/nagios_common_snmp.h
50 ++++ b/src/nagios_common_snmp.h
51 +@@ -56,8 +56,8 @@ int init_plugins_gettext();
52 + /*********************************** Utilities ****************************************/
53 + /* cache utilities */
54 +
55 +-char plugin_name[30]; /* plugin name */
56 +-char plugin_tmp_prefix[50];
57 ++extern char plugin_name[30]; /* plugin name */
58 ++extern char plugin_tmp_prefix[50];
59 +
60 + /* defined in configure script */
61 + /*#define BASE_CACHE "/tmp/cache"*/
62 +@@ -71,12 +71,12 @@ int write_cache(snmp_table **descT,int num);
63 +
64 + /* maximum caracters in ouput */
65 + #define MAX_OUTPUT 500
66 +-char output[MAX_OUTPUT];
67 +-int output_overflow;
68 ++extern char output[MAX_OUTPUT];
69 ++extern int output_overflow;
70 +
71 + /* maximum caracters for performance output label*/
72 + #define MAX_LABEL_SIZE 50
73 +-char *p_output;
74 ++extern char *p_output;
75 +
76 + /* Put data in output */
77 + void strcat_output(const char *string);
78 +@@ -143,18 +143,18 @@ int get_options (int narg, char* const valarg[],options_nagsnmp *liste, int n_li
79 + #define TIMEOUT_DEFAULT 3
80 +
81 + /* standard options */
82 +-char *o_host;
83 +-int o_verb;
84 +-char* error;
85 ++extern char *o_host;
86 ++extern int o_verb;
87 ++extern char* error;
88 + /* snmp options */
89 +-int o_port,o_timeout;
90 +-int o_help, o_verbose,o_version,o_v2c;
91 +-int retries;
92 +-int o_snmpver,snmp_bulk;
93 +-char *o_community,*o_login,*o_passwd,*o_privpasswd;
94 +-char *o_protocols[2],*o_authproto,*o_privproto;
95 ++extern int o_port,o_timeout;
96 ++extern int o_help, o_verbose,o_version,o_v2c;
97 ++extern int retries;
98 ++extern int o_snmpver,snmp_bulk;
99 ++extern char *o_community,*o_login,*o_passwd,*o_privpasswd;
100 ++extern char *o_protocols[2],*o_authproto,*o_privproto;
101 + /* snmp sessions */
102 +-struct snmp_session session, *ss;
103 ++extern struct snmp_session session, *ss;
104 +
105 + /* Common options definition and check */
106 + #define common_usage "[-v -V] -H <host> -C <snmp_community> [-2] | (-l login -x passwd [-X pass -L <authp>,<privp>) [-p <port>] [-t <timeout>]"
107
108 diff --git a/net-analyzer/nagios-plugins-snmp/nagios-plugins-snmp-0.6.0-r2.ebuild b/net-analyzer/nagios-plugins-snmp/nagios-plugins-snmp-0.6.0-r2.ebuild
109 index 6eb4daae21e..005fd81aef6 100644
110 --- a/net-analyzer/nagios-plugins-snmp/nagios-plugins-snmp-0.6.0-r2.ebuild
111 +++ b/net-analyzer/nagios-plugins-snmp/nagios-plugins-snmp-0.6.0-r2.ebuild
112 @@ -19,7 +19,9 @@ DEPEND="
113 net-analyzer/net-snmp"
114 RDEPEND="${DEPEND}"
115
116 -S="${WORKDIR}/nagios-plugins-snmp"
117 +S="${WORKDIR}"/nagios-plugins-snmp
118 +
119 +PATCHES=( "${FILESDIR}"/${P}-fno-common.patch )
120
121 src_prepare() {
122 default