Gentoo Archives: gentoo-commits

From: Lars Wendler <polynomial-c@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-print/cups/files/
Date: Sat, 08 Dec 2018 13:21:40
Message-Id: 1544275290.d553454c747dbfda55ba38f64003036f29a9ebc1.polynomial-c@gentoo
1 commit: d553454c747dbfda55ba38f64003036f29a9ebc1
2 Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
3 AuthorDate: Sat Dec 8 13:21:07 2018 +0000
4 Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
5 CommitDate: Sat Dec 8 13:21:30 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d553454c
7
8 net-print/cups: Replaced usage_argument fix with upstream version
9
10 Package-Manager: Portage-2.3.52, Repoman-2.3.12
11 Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>
12
13 .../files/cups-2.3_beta6-usage_argument_fix.patch | 253 +++++++++++++++++++--
14 1 file changed, 229 insertions(+), 24 deletions(-)
15
16 diff --git a/net-print/cups/files/cups-2.3_beta6-usage_argument_fix.patch b/net-print/cups/files/cups-2.3_beta6-usage_argument_fix.patch
17 index f0ba569a0f4..d77a5bba28e 100644
18 --- a/net-print/cups/files/cups-2.3_beta6-usage_argument_fix.patch
19 +++ b/net-print/cups/files/cups-2.3_beta6-usage_argument_fix.patch
20 @@ -1,27 +1,235 @@
21 -From 7b655b36b349f6db9a7b658d0075c468cff83c2e Mon Sep 17 00:00:00 2001
22 -From: Lars Wendler <polynomial-c@g.o>
23 -Date: Sat, 8 Dec 2018 13:14:06 +0100
24 -Subject: [PATCH] Fix call to usage which requires an int argument
25 -MIME-Version: 1.0
26 -Content-Type: text/plain; charset=UTF-8
27 -Content-Transfer-Encoding: 8bit
28 +From 065632e2095bcb32f15a370633e60d6a6a3dd78e Mon Sep 17 00:00:00 2001
29 +From: Michael R Sweet <michael.r.sweet@×××××.com>
30 +Date: Sat, 8 Dec 2018 08:12:52 -0500
31 +Subject: [PATCH] Fix compile errors - not sure why these didn't show up
32 + before...
33
34 -Otherwise compilation fails:
35 -
36 -main.c: In function ‘main’:
37 -main.c:158:7: error: too few arguments to function ‘usage’
38 - usage();
39 - ^~~~~
40 -main.c:73:14: note: declared here
41 - static void usage(int status) _CUPS_NORETURN;
42 - ^~~~~
43 -make[1]: *** [../Makedefs:270: main.o] Error 1
44 ---
45 - scheduler/main.c | 2 +-
46 - 1 file changed, 1 insertion(+), 1 deletion(-)
47 + cups/adminutil.c | 197 -----------------------------------------------
48 + scheduler/main.c | 2 +-
49 + 2 files changed, 1 insertion(+), 198 deletions(-)
50
51 +diff --git a/cups/adminutil.c b/cups/adminutil.c
52 +index 5ecada44c..1a5067f1b 100644
53 +--- a/cups/adminutil.c
54 ++++ b/cups/adminutil.c
55 +@@ -32,12 +32,6 @@ static http_status_t get_cupsd_conf(http_t *http, _cups_globals_t *cg,
56 + time_t last_update, char *name,
57 + size_t namelen, int *remote);
58 + static void invalidate_cupsd_cache(_cups_globals_t *cg);
59 +-static void write_option(cups_file_t *dstfp, int order,
60 +- const char *name, const char *text,
61 +- const char *attrname,
62 +- ipp_attribute_t *suppattr,
63 +- ipp_attribute_t *defattr, int defval,
64 +- int valcount);
65 +
66 +
67 + /*
68 +@@ -1330,88 +1324,6 @@ cupsAdminSetServerSettings(
69 + }
70 +
71 +
72 +-/*
73 +- * 'do_samba_command()' - Do a SAMBA command.
74 +- */
75 +-
76 +-static int /* O - Status of command */
77 +-do_samba_command(const char *command, /* I - Command to run */
78 +- const char *address, /* I - Address for command */
79 +- const char *subcmd, /* I - Sub-command */
80 +- const char *authfile, /* I - Samba authentication file */
81 +- FILE *logfile) /* I - Optional log file */
82 +-{
83 +-#ifdef _WIN32
84 +- return (1); /* Always fail on Windows... */
85 +-
86 +-#else
87 +- int status; /* Status of command */
88 +- int pid; /* Process ID of child */
89 +-
90 +-
91 +- if (logfile)
92 +- _cupsLangPrintf(logfile,
93 +- _("Running command: %s %s -N -A %s -c \'%s\'"),
94 +- command, address, authfile, subcmd);
95 +-
96 +- if ((pid = fork()) == 0)
97 +- {
98 +- /*
99 +- * Child goes here, redirect stdin/out/err and execute the command...
100 +- */
101 +-
102 +- int fd = open("/dev/null", O_RDONLY);
103 +-
104 +- if (fd > 0)
105 +- {
106 +- dup2(fd, 0);
107 +- close(fd);
108 +- }
109 +-
110 +- if (logfile)
111 +- dup2(fileno(logfile), 1);
112 +- else if ((fd = open("/dev/null", O_WRONLY)) > 1)
113 +- {
114 +- dup2(fd, 1);
115 +- close(fd);
116 +- }
117 +-
118 +- dup2(1, 2);
119 +-
120 +- execlp(command, command, address, "-N", "-A", authfile, "-c", subcmd,
121 +- (char *)0);
122 +- exit(errno);
123 +- }
124 +- else if (pid < 0)
125 +- {
126 +- status = -1;
127 +-
128 +- if (logfile)
129 +- _cupsLangPrintf(logfile, _("Unable to run \"%s\": %s"),
130 +- command, strerror(errno));
131 +- }
132 +- else
133 +- {
134 +- /*
135 +- * Wait for the process to complete...
136 +- */
137 +-
138 +- while (wait(&status) != pid);
139 +- }
140 +-
141 +- if (logfile)
142 +- _cupsLangPuts(logfile, "");
143 +-
144 +- DEBUG_printf(("9do_samba_command: status=%d", status));
145 +-
146 +- if (WIFEXITED(status))
147 +- return (WEXITSTATUS(status));
148 +- else
149 +- return (-WTERMSIG(status));
150 +-#endif /* _WIN32 */
151 +-}
152 +-
153 +-
154 + /*
155 + * 'get_cupsd_conf()' - Get the current cupsd.conf file.
156 + */
157 +@@ -1527,112 +1439,3 @@ invalidate_cupsd_cache(
158 + cg->cupsd_num_settings = 0;
159 + cg->cupsd_settings = NULL;
160 + }
161 +-
162 +-
163 +-/*
164 +- * 'write_option()' - Write a CUPS option to a PPD file.
165 +- */
166 +-
167 +-static void
168 +-write_option(cups_file_t *dstfp, /* I - PPD file */
169 +- int order, /* I - Order dependency */
170 +- const char *name, /* I - Option name */
171 +- const char *text, /* I - Option text */
172 +- const char *attrname, /* I - Attribute name */
173 +- ipp_attribute_t *suppattr, /* I - IPP -supported attribute */
174 +- ipp_attribute_t *defattr, /* I - IPP -default attribute */
175 +- int defval, /* I - Default value number */
176 +- int valcount) /* I - Number of values */
177 +-{
178 +- int i; /* Looping var */
179 +-
180 +-
181 +- cupsFilePrintf(dstfp, "*JCLOpenUI *%s/%s: PickOne\n"
182 +- "*OrderDependency: %d JCLSetup *%s\n",
183 +- name, text, order, name);
184 +-
185 +- if (defattr->value_tag == IPP_TAG_INTEGER)
186 +- {
187 +- /*
188 +- * Do numeric options with a range or list...
189 +- */
190 +-
191 +- cupsFilePrintf(dstfp, "*Default%s: %d\n", name,
192 +- defattr->values[defval].integer);
193 +-
194 +- if (suppattr->value_tag == IPP_TAG_RANGE)
195 +- {
196 +- /*
197 +- * List each number in the range...
198 +- */
199 +-
200 +- for (i = suppattr->values[0].range.lower;
201 +- i <= suppattr->values[0].range.upper;
202 +- i ++)
203 +- {
204 +- cupsFilePrintf(dstfp, "*%s %d: \"", name, i);
205 +-
206 +- if (valcount == 1)
207 +- cupsFilePrintf(dstfp, "%%cupsJobTicket: %s=%d\n\"\n*End\n",
208 +- attrname, i);
209 +- else if (defval == 0)
210 +- cupsFilePrintf(dstfp, "%%cupsJobTicket: %s=%d\"\n", attrname, i);
211 +- else if (defval < (valcount - 1))
212 +- cupsFilePrintf(dstfp, ",%d\"\n", i);
213 +- else
214 +- cupsFilePrintf(dstfp, ",%d\n\"\n*End\n", i);
215 +- }
216 +- }
217 +- else
218 +- {
219 +- /*
220 +- * List explicit numbers...
221 +- */
222 +-
223 +- for (i = 0; i < suppattr->num_values; i ++)
224 +- {
225 +- cupsFilePrintf(dstfp, "*%s %d: \"", name, suppattr->values[i].integer);
226 +-
227 +- if (valcount == 1)
228 +- cupsFilePrintf(dstfp, "%%cupsJobTicket: %s=%d\n\"\n*End\n", attrname,
229 +- suppattr->values[i].integer);
230 +- else if (defval == 0)
231 +- cupsFilePrintf(dstfp, "%%cupsJobTicket: %s=%d\"\n", attrname,
232 +- suppattr->values[i].integer);
233 +- else if (defval < (valcount - 1))
234 +- cupsFilePrintf(dstfp, ",%d\"\n", suppattr->values[i].integer);
235 +- else
236 +- cupsFilePrintf(dstfp, ",%d\n\"\n*End\n", suppattr->values[i].integer);
237 +- }
238 +- }
239 +- }
240 +- else
241 +- {
242 +- /*
243 +- * Do text options with a list...
244 +- */
245 +-
246 +- cupsFilePrintf(dstfp, "*Default%s: %s\n", name,
247 +- defattr->values[defval].string.text);
248 +-
249 +- for (i = 0; i < suppattr->num_values; i ++)
250 +- {
251 +- cupsFilePrintf(dstfp, "*%s %s: \"", name,
252 +- suppattr->values[i].string.text);
253 +-
254 +- if (valcount == 1)
255 +- cupsFilePrintf(dstfp, "%%cupsJobTicket: %s=%s\n\"\n*End\n", attrname,
256 +- suppattr->values[i].string.text);
257 +- else if (defval == 0)
258 +- cupsFilePrintf(dstfp, "%%cupsJobTicket: %s=%s\"\n", attrname,
259 +- suppattr->values[i].string.text);
260 +- else if (defval < (valcount - 1))
261 +- cupsFilePrintf(dstfp, ",%s\"\n", suppattr->values[i].string.text);
262 +- else
263 +- cupsFilePrintf(dstfp, ",%s\n\"\n*End\n",
264 +- suppattr->values[i].string.text);
265 +- }
266 +- }
267 +-
268 +- cupsFilePrintf(dstfp, "*JCLCloseUI: *%s\n\n", name);
269 +-}
270 diff --git a/scheduler/main.c b/scheduler/main.c
271 -index ce7df89c0..a7df4525f 100644
272 +index ce7df89c0..5b00efae2 100644
273 --- a/scheduler/main.c
274 +++ b/scheduler/main.c
275 @@ -155,7 +155,7 @@ main(int argc, /* I - Number of command-line args */
276 @@ -29,10 +237,7 @@ index ce7df89c0..a7df4525f 100644
277 {
278 if (!strcmp(argv[i], "--help"))
279 - usage();
280 -+ usage(1);
281 ++ usage(0);
282 else if (argv[i][0] == '-')
283 {
284 for (opt = argv[i] + 1; *opt != '\0'; opt ++)
285 ---
286 -2.20.0.rc2
287 -