Debian Codegraph @

ChangeLog-2013

raw
1 Sat Nov 30 21:07:06 GMT 2013 Colin Watson <[email protected]>
2
3 * .bzrignore: Move to ...
4 * .gitignore: ... here, adjusting for differences between bzr and
5 git.
6 * Makefile.am (EXTRA_DIST): Replace .bzrignore with .gitignore.
7 * gnulib: Add --no-vc-files.
8
9 Wed Nov 27 10:50:43 GMT 2013 Colin Watson <[email protected]>
10
11 * configure.ac: Only call AC_PROG_AR if it is defined, to restore
12 compatibility with Automake 1.10 (thanks, Mathieu Malaterre;
13 Debian bug #730191).
14 * NEWS: Document this.
15
16 Wed Nov 27 10:48:16 GMT 2013 Colin Watson <[email protected]>
17
18 Upgrade to Automake 1.14, Gettext 0.18.3, and Gnulib 20130805.
19
20 Sun Jun 23 12:44:09 BST 2013 Colin Watson <[email protected]>
21
22 * lib/pipeline-private.h (struct pipeline): Make want_infile and
23 want_outfile non-const.
24 * lib/pipeline.c (pipeline_join): Take copies of p1->want_infile and
25 p2->want_outfile.
26 (pipeline_want_infile): Take a copy of file.
27 (pipeline_want_outfile): Likewise.
28 (pipeline_free): Free p->want_infile and p->want_outfile.
29 * NEWS: Document this.
30
31 Sun Jun 23 12:40:32 BST 2013 Colin Watson <[email protected]>
32
33 * lib/pipeline.c (argstr_get_word, pipeline_free): Remove
34 unnecessary tests before freeing pointers.
35
36 Sat Jun 22 17:12:03 BST 2013 Colin Watson <[email protected]>
37
38 * tests/common.c (temp_dir_setup): Fail the test if mkdtemp fails.
39
40 Thu Jun 6 12:43:06 BST 2013 Colin Watson <[email protected]>
41
42 * Version: 1.2.4.
43 * lib/Makefile.am (libpipeline_la_LDFLAGS): Bump -version-info to
44 3:4:2.
45
46 Thu Jun 6 12:38:07 BST 2013 Colin Watson <[email protected]>
47
48 * NEWS: Document changes since 1.2.3.
49
50 Wed Jun 5 20:28:59 BST 2013 Colin Watson <[email protected]>
51
52 Provide a replacement clearenv for non-glibc systems that lack it
53 (Savannah bug #36848).
54
55 * gnulib: Import environ module.
56 * configure.ac: Check for clearenv.
57 * lib/pipeline.c [!HAVE_CLEARENV] (clearenv): New replacement
58 function.
59 * lib/pipeline-private.h [!HAVE_CLEARENV] (clearenv): Add prototype.
60
61 Wed Jun 5 20:18:23 BST 2013 Colin Watson <[email protected]>
62
63 * aclocal.m4: Upgrade to Gettext 0.18.2.1.
64
65 Wed Jun 5 20:12:11 BST 2013 Colin Watson <[email protected]>
66
67 * tools/config.guess: Update to 2013-05-16.
68 * tools/config.sub: Update to 2013-04-24.
69
70 Wed Jun 5 18:01:47 BST 2013 Colin Watson <[email protected]>
71
72 * lib/pipeline.h (pipecmd_clearenv): Add a warning about use of this
73 function.
74 * man/libpipeline.3 (Functions to build individual commands):
75 Likewise.
76
77 Wed Jun 5 10:31:01 BST 2013 Colin Watson <[email protected]>
78
79 Quieten warnings from compiling Gnulib.
80
81 * m4/pipeline-gcc-warning.m4: Remove.
82 * gnulib: Import warnings module.
83 * configure.ac: Replace PIPELINE_GCC_WARNING with gl_WARN_ADD.
84 * lib/Makefile.am (AM_CFLAGS): Add $(WARN_CFLAGS).
85 * tests/Makefile.am (AM_CFLAGS): Likewise.
86
87 Wed Jun 5 10:16:59 BST 2013 Colin Watson <[email protected]>
88
89 * tests/argstr.c, tests/basic.c, tests/exec.c, tests/inspect.c,
90 tests/pump.c, tests/reading_long_line.c, tests/redirect.c: Define
91 program_name (thanks, Fernando Lemos; see Savannah bug #36848).
92
93 Wed Jun 5 10:12:29 BST 2013 Colin Watson <[email protected]>
94
95 * Makefile.in (DIST_COMMON): Regenerate, adding tools/depcomp.
96
97 Thu May 30 13:28:08 BST 2013 Colin Watson <[email protected]>
98
99 Upgrade to Automake 1.13.2 and Gnulib 20130529.
100
101 * .bzrignore: Add tests/*.log and tests/*.trs.
102 * autogen.sh: Drop gnulib/gets.patch backport.
103 * Makefile.am (EXTRA_DIST): Remove gnulib/gets.patch.
104 * gnulib/gets.patch: Remove.
105 * tests/argstr.c, tests/basic.c, tests/exec.c, tests/inspect.c,
106 tests/reading_long_line.c, tests/redirect.c: Include config.h.
107
108 Wed Apr 24 07:48:26 BST 2013 Colin Watson <[email protected]>
109
110 * Version: 1.2.3.
111 * lib/Makefile.am (libpipeline_la_LDFLAGS): Bump -version-info to
112 3:3:2.
113
114 Wed Apr 24 07:44:38 BST 2013 Colin Watson <[email protected]>
115
116 * lib/pipeline.c (pipeline_wait_all): Free active_pipelines if it is
117 entirely empty.
118
119 Wed Apr 24 07:27:44 BST 2013 Peter Schiffer <[email protected]>
120
121 * lib/pipeline.c (pipecmd_new_argstr): Fix memory leak when the
122 first word of argstr is "exec".
123 * tests/argstr.c (test_argstr_exec): Free cmd at end.
124 * tests/basic.c (test_basic_wait_all): Free statuses at end.
125 (test_basic_clearenv): Free p and p2 at end.
126 * tests/exec.c (test_exec_process, test_exec_function): Free cmd at
127 end of loop.
128 * tests/redirect.c (test_redirect_files): Free p and template at
129 end.
130
131 Tue Apr 23 07:52:40 BST 2013 Colin Watson <[email protected]>
132
133 * lib/pipeline.c (pipecmd_exec): Flush stdio before starting a
134 sequence.
135 * NEWS: Document this.
136
137 Tue Apr 23 07:50:45 BST 2013 Peter Schiffer <[email protected]>
138 Colin Watson <[email protected]>
139
140 Don't read uninitialised memory when testing for the end of long
141 lines (Fedora bug #876108).
142
143 * lib/pipeline.c (get_line): Fix incorrect memchr bounds.
144 * tests/Makefile.am (TESTS): Add reading_long_line.
145 (reading_long_line_SOURCES, reading_long_line_LDADD): Add.
146 * tests/reading_long_line.c: New file.
147 * .bzrignore: Add tests/reading_long_line.
148 * NEWS: Document this.
149
150 Mon Jan 21 11:42:09 GMT 2013 Colin Watson <[email protected]>
151
152 * configure.ac (AC_HEADER_SYS_WAIT): Remove; superseded by Gnulib.
153
154 Mon Jan 21 11:26:15 GMT 2013 Colin Watson <[email protected]>
155
156 Upgrade to Libtool 2.4.2-1.2 (from Debian).
157
158 Mon Dec 24 02:23:37 GMT 2012 Colin Watson <[email protected]>
159
160 * lib/pipeline.c (pipeline_start): Remove redundant condition.
161
162 Mon Sep 17 22:54:12 BST 2012 Colin Watson <[email protected]>
163
164 * Version: 1.2.2.
165 * lib/Makefile.am (libpipeline_la_LDFLAGS): Bump -version-info to
166 3:2:2.
167
168 Mon Sep 17 22:52:58 BST 2012 Colin Watson <[email protected]>
169
170 * Makefile.am (EXTRA_DIST): Add gnulib/gets.patch.
171
172 Mon Sep 17 22:31:18 BST 2012 Colin Watson <[email protected]>
173
174 * release.sh: Use 'set -e' rather than '#! /bin/sh -e', to avoid
175 accidents when debugging with 'sh -x'.
176
177 Mon Sep 17 22:27:47 BST 2012 Colin Watson <[email protected]>
178
179 * NEWS: Document changes since 1.2.1.
180
181 Mon Sep 17 22:23:59 BST 2012 Colin Watson <[email protected]>
182
183 * autogen.sh: Use 'set -e' rather than '#! /bin/sh -e', to avoid
184 accidents when debugging with 'sh -x'.
185
186 Mon Sep 17 22:21:44 BST 2012 Křištof Želechovski <[email protected]>
187
188 * configure.ac: Use AM_PROG_AR before LT_INIT, for compatibility
189 with Automake 1.12.
190
191 Mon Sep 17 22:05:04 BST 2012 Colin Watson <[email protected]>
192
193 Backport Gnulib commit 66712c23388e93e5c518ebc8515140fa0c807348 to
194 stop assuming gets.
195
196 * gnulib/gets.patch: New file.
197 * autogen.sh: Apply gnulib/gets.patch.
198
199 Mon Sep 17 22:03:09 BST 2012 Colin Watson <[email protected]>
200
201 Upgrade to Autoconf 2.69, Automake 1.11.6, and Gnulib
202 20120404-stable.
203
204 Sun Mar 4 17:43:21 GMT 2012 Colin Watson <[email protected]>
205
206 * lib/pipeline.c (pipeline_start): Flush stdio after emitting
207 debugging output.
208
209 Fri Mar 2 19:54:40 GMT 2012 Colin Watson <[email protected]>
210
211 * Version: 1.2.1.
212 * lib/Makefile.am (libpipeline_la_LDFLAGS): Bump -version-info to
213 3:1:2.
214
215 Thu Mar 1 22:51:30 GMT 2012 Colin Watson <[email protected]>
216
217 * NEWS: Correct date of 1.2.0 release.
218
219 Wed Feb 29 20:09:12 GMT 2012 Martin Pollard <[email protected]>
220
221 * lib/pipeline.h: Enclose in extern "C" { } when compiling as C++.
222
223 Wed Feb 29 18:26:22 GMT 2012 Colin Watson <[email protected]>
224
225 * tests/Makefile.am (TESTS): Add pump.
226 (pump_SOURCES, pump_LDADD): Add.
227 * tests/pump.c: New file.
228 * .bzrignore: Add tests/pump.
229
230 Wed Feb 29 18:19:08 GMT 2012 Colin Watson <[email protected]>
231
232 * lib/pipeline.c (pipeline_start): Create output files if they do
233 not already exist, and truncate them if they do.
234 * lib/pipeline.h (pipeline_want_outfile): Document this.
235 * man/libpipeline.3 (Functions to build pipelines): Likewise.
236 * tests/common.c: New file.
237 * tests/common.h (TEST_CASE_WITH_FIXTURE): New macro.
238 (temp_dir_setup, temp_dir_teardown): Add prototypes.
239 * tests/redirect.c (test_redirect_outfile): New test.
240 (redirect_suite): Call test_redirect_outfile.
241 * tests/Makefile.am (basic_SOURCES, argstr_SOURCES, exec_SOURCES,
242 inspect_SOURCES, redirect_SOURCES): Add common.c.
243 * NEWS: Document this.
244
245 Mon Feb 27 22:17:20 GMT 2012 Colin Watson <[email protected]>
246
247 * tests/exec.c (exit_helper, test_exit_function): Add test that
248 pipecmd_exec works with functions.
249 (exec_suite): Call test_exit_function.
250
251 Thu Feb 9 12:04:26 GMT 2012 Colin Watson <[email protected]>
252
253 Upgrade to Automake 1.11.3.
254
255 Sun Feb 5 02:33:14 GMT 2012 Colin Watson <[email protected]>
256
257 Upgrade to Automake 1.11.2 and Gnulib 20111211-stable.
258
259 * Makefile.am (EXTRA_DIST): Remove gnulib/m4/sockpfaf.m4, which was
260 removed from this package some time ago. Add gnulib/m4/math_h.m4.
261
262 Wed Dec 14 12:54:40 GMT 2011 Colin Watson <[email protected]>
263
264 * man/Makefile.am (FUNCTIONS): Add pipecmd_new_sequencev,
265 pipeline_new_command_argv, pipeline_command_argv,
266 pipeline_wait_all, and pipeline_run.
267
268 Wed Dec 14 12:48:56 GMT 2011 Colin Watson <[email protected]>
269
270 Upgrade to Libtool 2.4.2.
271
272 Mon Oct 10 09:22:41 BST 2011 Colin Watson <[email protected]>
273
274 * README: Document test suite dependencies. Suggested by Bruce
275 Dubbs.
276
277 Mon Sep 26 13:34:00 BST 2011 Colin Watson <[email protected]>
278
279 * man/libpipeline.3 (Reaping of child processes): Fix typo.
280
281 Mon Sep 26 12:10:35 BST 2011 Colin Watson <[email protected]>
282
283 Upgrade to Gnulib 20110908-stable.
284
285 Sat Apr 23 17:51:13 BST 2011 Colin Watson <[email protected]>
286
287 Upgrade to Autoconf 2.68, Libtool 2.4, and Gnulib 20110412-stable.
288
289 Wed Mar 30 13:40:42 BST 2011 Colin Watson <[email protected]>
290
291 * gnulib: Import full-write, safe-read, and safe-write modules.
292 * lib/pipeline.c (passthrough): Use safe_read instead of read. Use
293 full_write instead of fwrite (stdio is not necessarily
294 EINTR-safe).
295 (pipeline_pump): Use safe_write instead of write and a manual
296 EINTR check.
297 (get_block): Use safe_read instead of read.
298 * NEWS: Document this.
299
300 Fri Mar 18 22:27:39 GMT 2011 Colin Watson <[email protected]>
301
302 * Version: 1.2.0.
303 * lib/Makefile.am (libpipeline_la_LDFLAGS): Bump -version-info to
304 3:0:2.
305
306 Fri Mar 18 18:24:42 GMT 2011 Colin Watson <[email protected]>
307
308 * man/Makefile.am (FUNCTIONS): Add pipeline_get_pid.
309
310 Fri Mar 18 18:22:42 GMT 2011 Colin Watson <[email protected]>
311
312 * tests/inspect.c (pid_helper): Flush stdout before pausing.
313
314 Fri Mar 18 12:08:51 GMT 2011 Colin Watson <[email protected]>
315
316 * gnulib: Import waitpid module.
317
318 Fri Mar 18 12:02:42 GMT 2011 Colin Watson <[email protected]>
319
320 Upgrade to Gnulib 20110216-stable.
321
322 Fri Mar 18 11:45:10 GMT 2011 Colin Watson <[email protected]>
323
324 * tests/basic.c (test_basic_clearenv): Test that pipecmd_clearenv
325 and pipecmd_setenv survive pipecmd_dup.
326
327 Tue Mar 8 14:10:52 GMT 2011 Colin Watson <[email protected]>
328
329 Add a function to get process IDs of commands in started pipelines
330 (Savannah bug #32710).
331
332 * lib/pipeline.c (pipeline_get_pid): New function.
333 * lib/pipeline.h (pipeline_get_pid): Add prototype.
334 * man/libpipeline.3 (Functions to build pipelines): Document
335 pipeline_get_pid.
336 * tests/inspect.c (pid_helper, test_inspect_pid): Test
337 pipeline_get_pid.
338 * NEWS: Document this.
339
340 Mon Mar 7 10:41:50 GMT 2011 Colin Watson <[email protected]>
341
342 * configure.ac: Check for working fork(2).
343
344 Sat Dec 11 15:01:14 GMT 2010 Colin Watson <[email protected]>
345
346 * Version: 1.1.0.
347 * lib/Makefile.am (libpipeline_la_LDFLAGS): Bump -version-info to
348 2:0:1.
349
350 Sat Dec 11 15:00:02 GMT 2010 Colin Watson <[email protected]>
351
352 * man/Makefile.am (FUNCTIONS): Add pipecmd_get_nargs,
353 pipecmd_clearenv, and pipecmd_exec.
354
355 Sat Dec 11 13:25:29 GMT 2010 Colin Watson <[email protected]>
356
357 * lib/pipeline.h (pipecmd_get_nargs): Clarify that the command name
358 is counted as the first argument.
359 * man/libpipeline.3 (pipecmd_get_nargs): Likewise.
360 * tests/basic.c (test_basic_args): Correct off-by-one error.
361
362 Mon Dec 6 20:54:29 GMT 2010 Colin Watson <[email protected]>
363
364 * lib/pipeline.c (pipecmd_get_nargs): New function.
365 * lib/pipeline.h (pipecmd_get_nargs): Add prototype.
366 * man/libpipeline.3 (Functions to build individual commands):
367 Document pipecmd_get_nargs.
368 * tests/basic.c (test_basic_args): Test pipecmd_get_nargs.
369 * NEWS: Document this.
370
371 Mon Dec 6 20:07:43 GMT 2010 Colin Watson <[email protected]>
372
373 * lib/pipeline.c (pipecmd_clearenv): New function.
374 (pipecmd_dup, pipecmd_dump, pipecmd_tostring, pipecmd_exec):
375 Handle cmd->env[i].name being NULL.
376 * lib/pipeline.h (pipecmd_clearenv): Add prototype.
377 * man/libpipeline.3 (Functions to build individual commands):
378 Document pipecmd_clearenv.
379 * tests/basic.c (test_basic_clearenv): Add test.
380 (basic_suite): Call test_basic_clearenv.
381 * NEWS: Document this.
382
383 Sun Nov 28 14:49:42 GMT 2010 Colin Watson <[email protected]>
384
385 * NEWS: Note date of 1.0.0 release.
386
387 Sun Nov 28 14:47:03 GMT 2010 Colin Watson <[email protected]>
388
389 * lib/pipeline.c (pipecmd_start_child): Rename to ...
390 (pipecmd_exec): ... this, and make external. Update all callers.
391 * lib/pipeline.h (pipecmd_exec): Add prototype.
392 * man/libpipeline.3 (Functions to build individual commands):
393 Document pipecmd_exec.
394 * tests/Makefile.am (TESTS): Add exec.
395 (exec_SOURCES, exec_LDADD): Add.
396 * tests/exec.c: New file.
397 * .bzrignore: Add tests/exec.
398 * NEWS: Document this.
399
400 Sun Nov 28 13:43:45 GMT 2010 Colin Watson <[email protected]>
401
402 * gnulib: Remove mkstemp module. Add sys_stat module.
403
404 Tue Nov 16 17:25:08 GMT 2010 Colin Watson <[email protected]>
405
406 * man/libpipeline.3 (EXAMPLES): Clarify pipeline_readline example:
407 show calls to pipeline_want_out and pipeline_start.
408
409 Tue Nov 2 16:56:22 GMT 2010 Colin Watson <[email protected]>
410
411 * README (Building programs with libpipeline): Recommend -Wformat.
412
413 Fri Oct 29 07:34:05 BST 2010 Colin Watson <[email protected]>
414
415 * Version: 1.0.0.
416
417 Fri Oct 29 07:25:14 BST 2010 Colin Watson <[email protected]>
418
419 * lib/pipeline.h (pipeline_install_post_fork): Clarify that this is
420 run in the child process.
421 (pipeline_wait_all): Clarify that SIGPIPE is considered equivalent
422 to exiting zero.
423 * man/libpipeline.3 (DESCRIPTION): Update descriptions of
424 pipeline_install_post_fork and pipeline_wait_all to match this.
425 (Functions to read output from pipelines): Note that output is
426 returned as a pointer into a pipeline-owned buffer.
427
428 Fri Oct 29 06:21:02 BST 2010 Colin Watson <[email protected]>
429
430 * TODO: New file.
431
432 Fri Oct 29 06:20:18 BST 2010 Colin Watson <[email protected]>
433
434 * README (Credits): New section.
435
436 Fri Oct 29 06:11:37 BST 2010 Colin Watson <[email protected]>
437
438 * lib/pipeline.c (pipecmd_new_sequencev): New function.
439 (pipecmd_new_sequence): Rewrite in terms of pipecmd_new_sequence.
440 (pipeline_new_command_argv): New function.
441 (pipeline_new_command_args): Rewrite in terms of
442 pipeline_new_command_argv.
443 (pipeline_command_argv): New function.
444 (pipeline_command_args): Rewrite in terms of
445 pipeline_command_argv.
446 * lib/pipeline.h (pipecmd_new_sequencev, pipeline_new_command_argv,
447 pipeline_command_argv): Add prototypes.
448 * man/libpipeline.3 (DESCRIPTION): Document pipecmd_new_sequencev,
449 pipeline_new_command_argv, and pipeline_command_argv.
450 * tests/basic.c (test_basic_sequence): Add test.
451 (basic_suite): Call test_basic_sequence.
452
453 Fri Oct 29 05:25:19 BST 2010 Colin Watson <[email protected]>
454
455 * lib/pipeline.c (pipeline_wait): Rename to ...
456 (pipeline_wait_all): ... this. Return 127 rather than 1 if
457 closing the pipeline output fails. Return 127 if a command other
458 than the last one fails. Return the statuses and the number of
459 statuses in new output parameters if they are non-NULL.
460 (pipeline_wait): Add new wrapper function.
461 * lib/pipeline.h (pipeline_wait_all): Add prototype.
462 * man/libpipeline.3 (Functions to run pipelines and handle signals):
463 Document pipeline_wait_all.
464 * tests/basic.c (test_basic_wait_all): Add test.
465 (basic_suite): Call test_basic_wait_all.
466
467 Fri Oct 29 03:46:39 BST 2010 Colin Watson <[email protected]>
468
469 * lib/pipeline.c (pipeline_new): Default ignore_signals to 0.
470 * man/libpipeline.3 (Functions to build pipelines): Update
471 pipeline_ignore_signals documentation.
472
473 Fri Oct 29 03:43:29 BST 2010 Colin Watson <[email protected]>
474
475 * man/libpipeline.3 (Functions to build pipelines): Rephrase
476 description of want_out and want_in handling in terms of public
477 function calls.
478
479 Fri Oct 29 03:30:45 BST 2010 Colin Watson <[email protected]>
480
481 * man/libpipeline.3 (Functions to build individual commands):
482 Document variable arguments to pipecmd_new_sequence.
483 (Functions to build pipelines): Explain analogy of
484 pipeline_connect to tee(1).
485
486 Fri Oct 29 03:13:21 BST 2010 Colin Watson <[email protected]>
487
488 * lib/pipeline.c, lib/pipeline.h, lib/pipeline-private.h: Rename
489 command to pipecmd, command_* to pipecmd_*, and COMMAND_* to
490 PIPECMD_*. Update all callers and documentation references.
491 * lib/Makefile.am (libpipeline_la_LDFLAGS): Adjust
492 -export-symbols-regex to export pipecmd_* rather than command_*.
493
494 Fri Oct 29 03:00:51 BST 2010 Colin Watson <[email protected]>
495
496 * man/libpipeline.3 (DESCRIPTION): Various minor corrections and
497 clarifications from Ian Jackson.
498 (BUGS): New section.
499
500 Tue Oct 26 21:09:53 BST 2010 Colin Watson <[email protected]>
501
502 * tests/Makefile.am (TESTS): Add argstr.
503 (argstr_SOURCES, argstr_LDADD): Add.
504 * tests/argstr.c: New file.
505 * .bzrignore: Add tests/argstr.
506
507 Mon Oct 25 21:56:08 BST 2010 Colin Watson <[email protected]>
508
509 * tests/inspect.c (test_inspect_command): Free the result of
510 command_tostring.
511 (test_inspect_pipeline): Free the result of pipeline_tostring.
512
513 Mon Oct 25 20:25:11 BST 2010 Colin Watson <[email protected]>
514
515 Revert our patched version of xstrdup, since none of libpipeline's
516 calls to xstrdup rely on being able to pass NULL to it.
517
518 * Makefile.am (EXTRA_DIST): Remove gnulib/lib/xmalloc.c.orig and
519 gnulib/lib/xmalloc.patch.
520 * autogen.sh: Stop applying gnulib/lib/xmalloc.patch.
521 * gnulib/lib/xmalloc.c.orig, gnulib/lib/xmalloc.patch: Remove.
522
523 Mon Oct 25 20:10:25 BST 2010 Colin Watson <[email protected]>
524
525 * README (Building programs with libpipeline): New section.
526
527 Mon Oct 25 19:39:06 BST 2010 Colin Watson <[email protected]>
528
529 * man/Makefile.am (FUNCTIONS): Add command_nice,
530 command_discard_err, command_unsetenv, pipeline_new_command_args,
531 pipeline_get_ncommands, pipeline_get_command,
532 pipeline_set_command, pipeline_want_in, pipeline_want_out,
533 pipeline_want_infile, pipeline_want_outfile, and
534 pipeline_ignore_signals.
535
536 Mon Oct 25 19:31:27 BST 2010 Colin Watson <[email protected]>
537
538 * tests/basic.c: Include <string.h>.
539
540 Mon Oct 25 19:31:09 BST 2010 Colin Watson <[email protected]>
541
542 * tests/Makefile.am (TESTS): Add inspect.
543 (inspect_SOURCES, inspect_LDADD): Add.
544 * tests/inspect.c: New file.
545 * .bzrignore: Add tests/inspect.
546
547 Mon Oct 25 19:18:35 BST 2010 Colin Watson <[email protected]>
548
549 * tests/common.h: New file.
550 * tests/basic.c (basic_suite, main), tests/redirect.c
551 (redirect_suite, main): Use new TEST_CASE and MAIN macros.
552 * tests/Makefile.am (basic_SOURCES, redirect_SOURCES): Add common.h.
553
554 Mon Oct 25 16:17:24 BST 2010 Colin Watson <[email protected]>
555
556 * gnulib: Import unsetenv module.
557 * lib/pipeline.c (command_unsetenv): New function.
558 (command_dup, command_dump, command_tostring): Check for NULL
559 cmd->env[i].value.
560 (command_start_child): If cmd->env[i].value is NULL, call unsetenv
561 rather than setenv.
562 * lib/pipeline.h (command_unsetenv): Add prototype.
563 * man/libpipeline.3 (Functions to build individual commands):
564 Document command_unsetenv.
565 * tests/basic.c (test_basic_setenv, test_basic_unsetenv): New tests.
566 (basic_suite): Call test_basic_setenv and test_basic_unsetenv.
567
568 Mon Oct 25 14:31:41 BST 2010 Colin Watson <[email protected]>
569
570 * gnulib: Import mkstemp module.
571 * tests/Makefile.am (TESTS): Add redirect.
572 (LIBPIPELINE): Rename to ...
573 (LIBS): ... this, and add libgnu and $(LTLIBOBJS).
574 (AM_CPPFLAGS): Add -I$(top_srcdir)/gnulib/lib and
575 -I$(top_builddir)/gnulib/lib.
576 (clean-local): Remove temporary test files.
577 (basic_LDADD): Use $(LIBS) rather than $(LIBPIPELINE).
578 (redirect_SOURCES, redirect_LDADD): Add.
579 * tests/redirect.c: New file.
580 * .bzrignore: Add gnulib/lib/time.h and tests/redirect.
581
582 * lib/Makefile.am (libpipeline_la_CPPFLAGS): Remove spurious
583 -I$(top_builddir)/include.
584
585 Mon Oct 25 14:30:14 BST 2010 Colin Watson <[email protected]>
586
587 * lib/pipeline.c (pipeline_start): Fix typo that broke
588 pipeline_want_infile.
589
590 Mon Oct 25 13:38:40 BST 2010 Colin Watson <[email protected]>
591
592 Start test suite.
593
594 * lib/Makefile.am (libpipeline_la_LDFLAGS): Remove -module; this
595 introduces too many complications for now.
596
597 * configure.ac: Test for check >= 0.9.4.
598 (AC_CONFIG_FILES): Add tests/Makefile.
599 * Makefile.am (SUBDIRS): Add tests if check was found.
600 * tests/Makefile.am: New file.
601 * tests/basic.c: New file.
602 * .bzrignore: Add tests/basic.
603
604 Sun Oct 24 22:22:21 BST 2010 Colin Watson <[email protected]>
605
606 * lib/pipeline.c (command_start_child): Add trailing newline to
607 "nice failed" debug message.
608
609 Sun Oct 24 22:21:20 BST 2010 Colin Watson <[email protected]>
610
611 Make command and pipeline opaque types.
612
613 * lib/pipeline.c (command_nice, command_discard_err,
614 pipeline_get_ncommands, pipeline_get_command,
615 pipeline_set_command, pipeline_want_in, pipeline_want_out,
616 pipeline_want_infile, pipeline_want_outfile,
617 pipeline_ignore_signals): New functions.
618 * lib/pipeline.h (command_nice, command_discard_err,
619 pipeline_get_ncommands, pipeline_get_command,
620 pipeline_set_command, pipeline_want_in, pipeline_want_out,
621 pipeline_want_infile, pipeline_want_outfile,
622 pipeline_ignore_signals): Add prototypes.
623 * man/libpipeline.3 (DESCRIPTION): Document new functions.
624
625 * lib/pipeline.h (enum command_tag, struct command_env, struct
626 command, struct pipeline): Move to ...
627 * lib/pipeline-private.h (enum command_tag, struct command_env,
628 struct command, struct pipeline): ... here.
629 * man/libpipeline.3 (Public command fields, Public pipeline fields):
630 Remove.
631
632 Redirections are now handled slightly differently internally,
633 allowing redirection from/to fd 0.
634
635 * lib/pipeline.c (pipeline_new, pipeline_join): Set redirect_in and
636 redirect_out.
637 (pipeline_connect): Use pipeline_want_in and pipeline_want_out.
638 Check source->redirect_out.
639 (pipeline_start): Handle new redirection semantics.
640 * man/libpipeline.3 (EXAMPLES): Use pipeline_want_infile.
641
642 * man/libpipeline.3 (DESCRIPTION): Document string copying.
643 (Reaping of child processes): New subsection.
644
645 Tue Oct 19 01:43:29 BST 2010 Colin Watson <[email protected]>
646
647 Make debugging work properly in a library context.
648
649 * lib/debug.c (init_debug): Check whether we've already been
650 initialised.
651 (debug): Call init_debug.
652 * lib/pipeline-private.h (init_debug): Add prototype.
653 * lib/pipeline.c (pipeline_start, pipeline_wait): Call init_debug.
654
655 Tue Oct 19 01:42:47 BST 2010 Colin Watson <[email protected]>
656
657 * man/libpipeline.3: Bump licence header to GPLv3, since that more
658 accurately describes the whole package.
659
660 Tue Oct 19 01:41:59 BST 2010 Colin Watson <[email protected]>
661
662 * man/Makefile.am (install-data-hook): Handle repeated
663 installations.
664 (uninstall-hook): Add.
665
666 Tue Oct 19 01:39:54 BST 2010 Colin Watson <[email protected]>
667
668 * lib/pipeline-private.h: Move attribute macros to ...
669 * lib/pipeline.h: ... here, and make them namespace-safe. Update
670 all users.
671
672 Mon Oct 18 11:32:52 BST 2010 Colin Watson <[email protected]>
673
674 * lib/pipeline.c (pipeline_run): This would be a more convenient
675 wrapper for the common case if it freed the pipeline as well, so
676 do that. (Callers that don't want this should call pipeline_start
677 and pipeline_wait separately.)
678 * lib/pipeline.h (pipeline_run): Update comment.
679 * man/libpipeline.3 (Functions to build pipelines): Update
680 pipeline_run documentation.
681 (EXAMPLES): Remove now-unnecessary calls to pipeline_free.
682
683 Mon Oct 18 11:29:11 BST 2010 Colin Watson <[email protected]>
684
685 * lib/pipeline.c (pipeline_new_command_args): New function.
686 * lib/pipeline.h (pipeline_new_command_args): Add prototype.
687 * man/libpipeline.3 (Functions to build pipelines): Add
688 pipeline_new_command_args.
689 (EXAMPLES): Use this to describe the simplest case.
690
691 Mon Oct 18 11:10:27 BST 2010 Colin Watson <[email protected]>
692
693 * lib/pipeline.c (pipeline_run): New function.
694 * lib/pipeline.h (pipeline_run): Add prototype.
695 * man/libpipeline.3 (Functions to run pipelines and handle signals):
696 Add pipeline_run.
697 (EXAMPLES): Use it.
698
699 Mon Oct 18 11:07:16 BST 2010 Colin Watson <[email protected]>
700
701 * man/libpipeline.3 (DESCRIPTION): Add some more paragraph breaks.
702
703 Fri Oct 15 10:26:02 BST 2010 Colin Watson <[email protected]>
704
705 * lib/libpipeline.pc.in: Add copyright/licensing comment.
706 * man/libpipeline.3: Add brief licensing comment.
707
708 Thu Oct 14 00:49:34 BST 2010 Colin Watson <[email protected]>
709
710 * README (Copyright and licensing): Bump to GPLv3 or later, for
711 clarity. (lib/* remains licensed under GPLv2 or later, but the
712 work as a whole is GPLv3 or later.) Move further advice to ...
713 (Note on GPL versions): ... here, and expand.
714
715 Tue Oct 12 01:12:13 BST 2010 Colin Watson <[email protected]>
716
717 * README: New file.
718 * INSTALL: New file.
719
720 Tue Oct 12 01:01:04 BST 2010 Colin Watson <[email protected]>
721
722 * COPYING: New file.
723
724 * autogen.sh: Add a copyright/licence notice.
725 * configure.ac: Likewise.
726
727 * lib/pipeline-private.h: Update copyright years.
728
729 Tue Oct 12 00:52:00 BST 2010 Colin Watson <[email protected]>
730
731 * man/libpipeline.3: Add a licence notice.
732
733 Tue Oct 12 00:27:01 BST 2010 Colin Watson <[email protected]>
734
735 * autogen.sh: Stop setting AUTOPOINT=true.
736 * configure.ac: Stop echoing DBLIBS (specific to man-db).
737
738 Tue Oct 12 00:22:00 BST 2010 Colin Watson <[email protected]>
739
740 * configure.ac: Remove check for gnulib/po/Makefile.in.in.
741
742 Tue Oct 12 00:17:53 BST 2010 Colin Watson <[email protected]>
743
744 Remove gettext support. It's overkill for a library considering
745 that we only emit error messages, and it vastly inflates the size of
746 our configuration requirements.
747
748 * Makefile.am (SUBDIRS): Remove gnulib/po and po.
749 (EXTRA_DIST): Remove everything except gnulib/m4/sockpfaf.m4.
750 * autogen.sh: Remove call to autopoint and removal of po/ChangeLog.
751 * configure.ac: Remove calls to AM_GNU_GETTEXT and
752 AM_GNU_GETTEXT_VERSION. Stop substituting LINGUAS.
753 (AC_CONFIG_FILES): Remove gnulib/po/Makefile.in and
754 po/Makefile.in.
755 * gnulib/m4/gnulib-cache.m4: Remove --po-base and --po-domain
756 options. Remove gettext module.
757 * lib/Makefile.am (libpipeline_la_LIBADD): Remove @LTLIBINTL@.
758 * lib/pipeline.c (command_new_argstr, command_start_child),
759 pipeline_get_infile, pipeline_get_outfile,
760 pipeline_install_sigchld, pipeline_start, pipeline_wait,
761 pipeline_pump): Remove gettext support.
762 * po/*: Remove.
763 * .bzrignore: Remove gnulib/po and po/*.
764
765 Mon Oct 11 21:25:37 BST 2010 Colin Watson <[email protected]>
766
767 * autogen.sh: Remove po/ChangeLog after running autoreconf.
768 * .bzrignore: Remove po/ChangeLog.
769
770 * Makefile.am (EXTRA_DIST): Add gnulib/m4/codeset.m4,
771 gnulib/m4/fcntl-o.m4, and gnulib/m4/glibc21.m4.
772
773 * po/LINGUAS: New file.
774
775 Mon Oct 11 18:19:37 BST 2010 Colin Watson <[email protected]>
776
777 * man/Makefile.am (man3_MANS): Move to ...
778 (dist_man3_MANS): ... here.
779
780 Mon Oct 11 17:51:16 BST 2010 Colin Watson <[email protected]>
781
782 * Makefile.am (SUBDIRS): Add man.
783 * configure.ac (AC_PROG_LN_S): Add.
784 (AC_CONFIG_FILES): Add man/Makefile.
785 * man/Makefile.am: New file.
786 * man/libpipeline.3: New file.
787
788 Mon Oct 11 16:38:29 BST 2010 Colin Watson <[email protected]>
789
790 * lib/pipeline.h (pipeline_pump): Mention in comment that arguments
791 must be NULL-terminated.
792
793 Mon Oct 11 14:10:54 BST 2010 Colin Watson <[email protected]>
794
795 * lib/pipeline.h (pipeline_new_commandv): Fix comment.
796
797 Thu Oct 7 08:05:41 BST 2010 Colin Watson <[email protected]>
798
799 * lib/libpipeline.pc.in: New file.
800 * configure.ac (AC_CONFIG_FILES): Add lib/libpipeline.pc.
801 * lib/Makefile.am (pkgconfigdir, pkgconfig_DATA): Install
802 libpipeline.pc to $(libdir)/pkgconfig.
803 * .bzrignore: Add lib/libpipeline.pc.
804
805 Thu Oct 7 07:56:27 BST 2010 Colin Watson <[email protected]>
806
807 * po/libpipeline.pot: Update.
808 * po/*.po: Import translations from man-db.
809
810 Thu Oct 7 07:54:12 BST 2010 Colin Watson <[email protected]>
811
812 * lib/Makefile.am (libpipeline_la_SOURCES): Add pipeline-private.h.
813
814 Thu Oct 7 07:49:46 BST 2010 Colin Watson <[email protected]>
815
816 * release.sh: New file, from man-db.
817
818 Thu Oct 7 07:48:12 BST 2010 Colin Watson <[email protected]>
819
820 Build independently from man-db. Many new files from gettextize,
821 gnulib-tool, and autoreconf.
822
823 * lib/appendstr.c: New file, from man-db.
824 * lib/debug.c: Likewise.
825 * m4/pipeline-gcc-warning.m4: Likewise.
826 * m4/pipeline-socketpair.m4: Likewise.
827
828 * lib/pipeline-private.h: New file.
829
830 * lib/pipeline.c (command_new_argstr): Use strcmp rather than STREQ.
831 (pipeline_install_post_fork): New function.
832 (pipeline_start): Call post-fork handler rather than hardcoding
833 pop_all_cleanups.
834 * lib/pipeline.h (pipeline_install_post_fork): Add prototype.
835
836 * lib/pipeline.c: Update copyright notice for libpipeline.
837 * lib/pipeline.h: Likewise.
838
839 * gnulib: Import dirname, error, gettext, lib-ignore, setenv,
840 sigaction, signal, sigprocmask, strerror, strsignal, sys_select,
841 xalloc, xstrndup, and xvasprintf modules.
842
843 * Makefile.am: New file.
844 * NEWS: New file.
845 * autogen.sh: New file.
846 * configure.ac: New file.
847 * lib/Makefile.am: New file.
848 * .bzrignore: New file.
849
850 Entries below this point are edited versions of entries in man-db.
851
852 Sun Oct 3 23:57:45 BST 2010 Colin Watson <[email protected]>
853
854 * lib/pipeline.c (command_argf): New function.
855 * lib/pipeline.h (command_argf): Add prototype.
856
857 Sun Oct 3 22:34:13 BST 2010 Colin Watson <[email protected]>
858
859 * lib/pipeline.c (reap_children, pipeline_sigchld,
860 pipeline_install_sigchld): Move above pipeline_start.
861 (pipeline_install_sigchld): Make static. Return immediately if
862 already installed.
863 (pipeline_start): Call pipeline_install_sigchld.
864 * lib/pipeline.h (pipeline_start): Document that this installs a
865 SIGCHLD handler.
866 (pipeline_install_sigchld): Remove prototype.
867
868 Tue Mar 2 10:04:54 GMT 2010 Colin Watson <[email protected]>
869
870 Fix assertion failure on 'man -l' with an uncompressed page and
871 prefixed input (no-hyphenation, no-justification, or a non-English
872 page).
873
874 * lib/pipeline.c (command_new_passthrough): New function.
875 * lib/pipeline.h (command_new_passthrough): Add prototype.
876
877 Mon Feb 1 12:18:36 PST 2010 Colin Watson <[email protected]>
878
879 * lib/pipeline.c (pipeline_wait): Don't bother printing error
880 messages for SIGINT and SIGQUIT, since these correspond to
881 explicit user actions (Debian bug #568000).
882
883 Wed Jan 13 23:42:00 GMT 2010 Werner Fink <[email protected]>
884
885 Add support for using socketpair(2) as a replacement for pipe(2),
886 which is faster on some systems (Savannah patch #6741).
887
888 * lib/pipeline.c [USE_SOCKETPAIR_PIPE]: Redefine pipe() to a
889 construction based on socketpair().
890
891 Tue Jan 12 13:33:51 GMT 2010 Samuel Thibault <[email protected]>
892
893 * lib/pipeline.c (pipeline_pump): Fix off-by-one error when write
894 returns EAGAIN (Debian bug #564818).
895
896 Sat Nov 14 18:52:15 GMT 2009 Colin Watson <[email protected]>
897
898 * lib/pipeline.c (argstr_get_word): Fix a small memory leak.
899
900 Sat Nov 14 10:23:28 GMT 2009 Colin Watson <[email protected]>
901
902 * lib/pipeline.c (command_new_sequence, command_sequence_command):
903 New functions.
904 (command_dup, command_dump, command_tostring, command_free):
905 Handle commands of type COMMAND_SEQUENCE.
906 (pipeline_start): Move command execution to ...
907 (command_start_child): ... here (new function). Handle commands of
908 type COMMAND_SEQUENCE.
909 * lib/pipeline.h (enum command_tag): Add COMMAND_SEQUENCE.
910 (struct command): Add support for commands that consist of a
911 sequence of commands.
912 (command_new_sequence, command_sequence_command): Add prototypes.
913
914 Thu Sep 24 12:32:48 BST 2009 Colin Watson <[email protected]>
915
916 * lib/pipeline.c (pipeline_pump): When a source pipeline dies, make
917 sure to drain its output before discarding its output file
918 descriptor (Debian bug #548153). We still record the death to
919 avoid duplicate debugging messages.
920
921 Sun Aug 23 15:49:45 BST 2009 Colin Watson <[email protected]>
922
923 * lib/pipeline.c (command_dup): Fix newcmd->nenv assertion.
924
925 Sun Aug 23 15:41:32 BST 2009 Colin Watson <[email protected]>
926
927 * lib/pipeline.c (command_dup, command_setenv): cmd->env does not
928 need to be { NULL, NULL }-terminated.
929
930 Sun Aug 23 00:04:56 BST 2009 Colin Watson <[email protected]>
931
932 * lib/pipeline.c (command_setenv): New function, allowing
933 application code to ask for environment variables to be set when a
934 command is executed.
935 (command_new, command_new_function, command_dup, command_dump,
936 command_tostring, command_free): Handle new nenv, env_max, and env
937 members of 'struct command'.
938 (argstr_get_word): Add TODO comment for environment variable
939 support.
940 (pipeline_start): Set environment variables as requested.
941 * lib/pipeline.h (struct command_env): New structure.
942 (struct command): Add nenv, env_max, and env members.
943 (command_setenv): Add prototype.
944
945 Sun Jun 28 01:47:51 BST 2009 Colin Watson <[email protected]>
946
947 * lib/pipeline.c (pipeline_free): Free buffer and line_cache.
948
949 Sun Jun 28 01:40:24 BST 2009 Colin Watson <[email protected]>
950
951 * lib/pipeline.c (get_line): Limit newline search to the data length
952 returned by get_block, fixing an assertion failure.
953
954 Sat May 30 12:50:44 BST 2009 Colin Watson <[email protected]>
955
956 * lib/pipeline.c (pipeline_start): Check the return value of nice.
957
958 Mon Nov 17 11:07:50 GMT 2008 Colin Watson <[email protected]>
959
960 * lib/pipeline.c (command_new_function): Initialise discard_err.
961 (pipeline_start): Zero-initialise pids and statuses arrays on
962 allocation, and don'\''t unblock SIGCHLD until after doing so.
963
964 Mon Nov 17 00:39:14 GMT 2008 Colin Watson <[email protected]>
965
966 * lib/pipeline.c (pipeline_wait): Mangle return value into a value
967 suitable for passing to exit (Debian bug #477305).
968
969 Mon Sep 8 09:09:06 BST 2008 Colin Watson <[email protected]>
970
971 Add support for freeing command_function data.
972
973 * lib/pipeline.c (command_new_function): Add free_func argument.
974 (command_dup): Copy it.
975 (pipeline_connect): Adjust command_new_function call.
976 (pipeline_start): Free command_function data before exiting.
977 (pipeline_wait): Free command_function data while cleaning up
978 pipeline.
979 * lib/pipeline.h: Add command_function_free_type typedef.
980 (struct command [struct command_function]): Add free_func member.
981 (command_new_function): Update prototype.
982
983 Thu Jul 31 00:51:58 BST 2008 Colin Watson <[email protected]>
984
985 * lib/pipeline.c (pipeline_pump): Free known_source before returning
986 (Coverity CID #15).
987
988 Sun May 4 23:16:59 BST 2008 Colin Watson <[email protected]>
989
990 * lib/pipeline.c (pipeline_start, pipeline_pump): Zero sigaction
991 structures before using them. (I believe we set all required
992 fields anyway; this is just an extra safety catch.)
993
994 Sun Apr 27 11:24:24 BST 2008 Colin Watson <[email protected]>
995
996 * lib/pipeline.c (pipeline_sigchld): assert is not
997 async-signal-safe, so avoid calling it in a signal handler and use
998 an if guard instead (Ubuntu bug #221635, although exactly why the
999 assertion is failing there is unclear).
1000
1001 Sun Feb 17 17:13:55 GMT 2008 Colin Watson <[email protected]>
1002
1003 * lib/pipeline.c (pipeline_wait): Call strsignal rather than
1004 xstrsignal.
1005
1006 Sun Jan 27 13:42:31 GMT 2008 Colin Watson <[email protected]>
1007
1008 * lib/pipeline.c (pipeline_join): Initialise source, buffer, buflen,
1009 bufmax, line_cache, and peek_offset.
1010
1011 Sun Jan 27 13:37:17 GMT 2008 Colin Watson <[email protected]>
1012
1013 * lib/pipeline.h (struct pipeline): Add ignore_signals member.
1014 * lib/pipeline.c (pipeline_new): Initialise ignore_signals to 1.
1015 (pipeline_join): Set ignore_signals if either input pipeline has
1016 it set.
1017 (pipeline_start): Only ignore SIGINT and SIGQUIT if ignore_signals
1018 is set.
1019 (pipeline_wait): Only restore SIGINT and SIGQUIT if ignore_signals
1020 is set.
1021
1022 Sun Jan 6 15:01:08 GMT 2008 Colin Watson <[email protected]>
1023
1024 * lib/pipeline.c (pipeline_start, pipeline_wait,
1025 pipeline_install_sigchld, pipeline_pump): Call sigaction rather
1026 than xsigaction.
1027
1028 Wed Jan 2 23:30:33 GMT 2008 Colin Watson <[email protected]>
1029
1030 * lib/pipeline.c (passthrough): Use STDIN_FILENO, STDOUT_FILENO, and
1031 STDERR_FILENO macros rather than calling fileno.
1032
1033 Mon Dec 31 10:02:28 GMT 2007 Colin Watson <[email protected]>
1034
1035 * lib/pipeline.c (passthrough): New helper function.
1036 (pipeline_connect): Add special (kludge) handling for zero-command
1037 sinks.
1038 (pipeline_pump): Add minor commentary.
1039
1040 Wed Oct 17 21:05:50 BST 2007 Colin Watson <[email protected]>
1041
1042 * lib/pipeline.c: Assume <sys/select.h> and <unistd.h>. Remove
1043 duplicate <fcntl.h> inclusion.
1044 (command_new): Use base_name.
1045
1046 Mon Oct 8 02:24:19 BST 2007 Colin Watson <[email protected]>
1047
1048 * lib/pipeline.c (get_block): Use xrealloc instead of realloc.
1049
1050 Mon Oct 8 02:09:55 BST 2007 Colin Watson <[email protected]>
1051
1052 The strappend function is in the namespace reserved by C99
1053 7.26.10/7.26.11; rename it to appendstr.
1054
1055 * lib/pipeline.c: Update all callers.
1056
1057 Mon Sep 17 00:11:38 UTC 2007 Colin Watson <[email protected]>
1058
1059 * lib/pipeline.c (pipeline_start): Break after execvp, otherwise we
1060 segfault if execvp fails.
1061
1062 Fri Aug 31 04:54:45 BST 2007 Colin Watson <[email protected]>
1063
1064 * lib/pipeline.c (pipeline_free): Call pipeline_wait if the pipeline
1065 is still running.
1066 * lib/pipeline.h (pipeline_free): Document that this may happen.
1067
1068 Tue Aug 28 17:19:16 BST 2007 Colin Watson <[email protected]>
1069
1070 Implement and use a decompression library. This allows cat pages to
1071 be saved in the background (Debian bug #18452) and operation with a
1072 read-only /tmp (Debian bug #165499).
1073
1074 * lib/pipeline.h (struct command): Add support for commands that
1075 consist of calling a function rather than executing a process.
1076 (struct pipeline): Add want_infile and want_outfile members. Note
1077 that infile and outfile default to NULL. Add source, buffer,
1078 buflen, bufmax, line_cache, and peek_offset members.
1079 (command_new_function, command_dump, command_tostring,
1080 pipeline_connect, pipeline_pump, pipeline_read, pipeline_peek,
1081 pipeline_peek_size, pipeline_peek_skip, pipeline_readline,
1082 pipeline_peekline): New prototypes.
1083 (pipeline_join): Update description for want_infile and
1084 want_outfile.
1085 * lib/pipeline.c (command_new, command_dup, command_arg,
1086 command_argv, command_args, command_argstr, command_free): Update
1087 for 'struct command' changes.
1088 (command_new_function, command_dump, command_tostring): New
1089 functions.
1090 (pipeline_new, pipeline_join, pipeline_dump, pipeline_tostring):
1091 Update for 'struct pipeline' changes.
1092 (pipeline_dump): Use command_dump.
1093 (pipeline_tostring): Use command_tostring.
1094 (pipeline_start): Implement want_infile, want_outfile, and
1095 function commands. Make zero-command case work properly (read
1096 directly from input file). Flush all pending stdio output so that
1097 subprocesses don't inherit it.
1098 (pipeline_connect, pipeline_pump, get_block, pipeline_read,
1099 pipeline_peek, pipeline_peek_size, pipeline_peek_skip, get_line,
1100 pipeline_readline, pipeline_peekline): New functions.
1101
1102 Mon Aug 27 20:02:17 BST 2007 Colin Watson <[email protected]>
1103
1104 * lib/pipeline.c (pipeline_wait): Re-raise SIGINT or SIGQUIT if they
1105 terminate a subprocess.
1106
1107 Mon Aug 27 19:58:19 BST 2007 Colin Watson <[email protected]>
1108
1109 * lib/pipeline.c (pipeline_wait): Return 1 if we fail to close the
1110 pipeline's output.
1111
1112 Mon Aug 20 00:10:49 BST 2007 Colin Watson <[email protected]>
1113
1114 Discard stderr from formatting processes when outputting to a pager,
1115 to avoid visual corruption from any error messages (thanks, Vincent
1116 Lefevre; Debian bug #372939).
1117
1118 * lib/pipeline.h (struct command): Add discard_err member.
1119 * lib/pipeline.c (command_new, command_dup): Initialise discard_err.
1120 (pipeline_start): Redirect the child's stderr to /dev/null if
1121 discard_err is set.
1122
1123 Sun Mar 4 00:51:30 GMT 2007 Colin Watson <[email protected]>
1124
1125 Eliminate variable and function shadowing.
1126
1127 * lib/pipeline.c (pipeline_start): Remove duplicate declarations of
1128 set and oset.
1129
1130 Wed Feb 28 22:04:04 GMT 2007 Colin Watson <[email protected]>
1131
1132 * lib/pipeline.c (pipeline_start): Close inputs and outputs from
1133 other active pipelines in all subprocesses.
1134
1135 Wed Feb 28 21:57:24 GMT 2007 Colin Watson <[email protected]>
1136
1137 * lib/pipeline.c (pipeline_start): Don't ignore SIGPIPE in
1138 subprocesses; this has undesirable consequences in some
1139 situations.
1140 (pipeline_wait): Flatten SIGPIPE exit statuses to zero instead.
1141
1142 Tue Feb 27 20:58:31 GMT 2007 Colin Watson <[email protected]>
1143
1144 * lib/pipeline.c (pipeline_start): Save previous value of SIGQUIT
1145 such that it gets restored as SIGQUIT, not as SIGINT.
1146
1147 Mon Jan 8 10:39:24 GMT 2007 Colin Watson <[email protected]>
1148
1149 * lib/pipeline.c (pipeline_start, pipeline_wait,
1150 pipeline_install_sigchld): Use xsigaction instead of
1151 sigaction-plus-EINTR-check.
1152
1153 Tue Dec 26 14:27:59 GMT 2006 Colin Watson <[email protected]>
1154
1155 * lib/pipeline.c: Include "gettext.h" rather than <libintl.h>. Make
1156 sure not to include <locale.h> before "gettext.h", for portability
1157 to Solaris.
1158
1159 Sun Sep 17 09:20:33 BST 2006 Colin Watson <[email protected]>
1160
1161 * lib/pipeline.c (pipeline_start): Ignore SIGPIPE in child processes
1162 (Debian bug #387864).
1163
1164 Wed Feb 22 09:44:02 GMT 2006 Colin Watson <[email protected]>
1165
1166 * lib/pipeline.c (command_new_argstr): Skip "exec" at the start of a
1167 command, to make old configuration files work (Debian bug
1168 #353959).
1169
1170 Wed Sep 21 10:56:22 BST 2005 Colin Watson <[email protected]>
1171
1172 * lib/pipeline.c (pipeline_wait): Queue SIGCHLD for the whole time
1173 we're collecting child process statuses; we need to keep a careful
1174 count of processes. Forget any previous errno before calling
1175 reap_children. Should fix Debian bug #326488.
1176
1177 Wed Sep 21 10:10:12 BST 2005 Colin Watson <[email protected]>
1178
1179 * lib/pipeline.c (pipeline_start, pipeline_wait): Ignore SIGINT and
1180 SIGQUIT in the parent while running subprocesses (Debian bug
1181 #328982).
1182
1183 Thu Sep 1 14:10:07 BST 2005 Colin Watson <[email protected]>
1184
1185 * lib/pipeline.c (argstr_get_word): Use an enum for quotemode rather
1186 than magic numbers.
1187
1188 Mon Jul 11 18:12:58 BST 2005 Colin Watson <[email protected]>
1189
1190 * lib/pipeline.c (pipeline_wait): Emit a debugging message.
1191
1192 Mon Jul 11 14:41:52 BST 2005 Colin Watson <[email protected]>
1193
1194 * include/manconfig.h.in: Define ATTRIBUTE_SENTINEL to a function
1195 attribute enabling sentinel checking if using GCC 4.0 or newer.
1196 (strappend): Use it.
1197 * lib/pipeline.h (command_new_args, command_args,
1198 pipeline_new_commands, pipeline_command_args, pipeline_commands):
1199 Likewise.
1200
1201 Sun Dec 12 21:48:04 CET 2004 Colin Watson <[email protected]>
1202
1203 * lib/pipeline.c (pipeline_sigchld): Don't bother saving and
1204 restoring errno if SIGCHLD is being queued.
1205
1206 Sun Nov 7 16:07:26 GMT 2004 Colin Watson <[email protected]>
1207
1208 * lib/pipeline.c (pipeline_wait): Close pipeline output before
1209 reaping processes, so that writing processes get SIGPIPE.
1210
1211 Sun Nov 7 16:05:08 GMT 2004 Colin Watson <[email protected]>
1212
1213 * lib/pipeline.c (pipeline_wait): Fix active process debugging
1214 output to include processes without statuses.
1215
1216 Mon Mar 8 11:21:05 GMT 2004 Colin Watson <[email protected]>
1217
1218 * lib/pipeline.c (pipeline_dump): Show caller-supplied input and
1219 output file descriptors.
1220
1221 * lib/pipeline.c (command_free, pipeline_free): Return safely if
1222 argument is NULL.
1223 * lib/pipeline.h (command_free, pipeline_free): Document NULL
1224 arguments as a safe no-op, like free().
1225
1226 Sun Sep 21 02:17:43 BST 2003 Colin Watson <[email protected]>
1227
1228 * lib/pipeline.c (pipeline_start): Dump pipeline in debugging mode.
1229
1230 Thu Aug 28 00:40:09 BST 2003 Colin Watson <[email protected]>
1231
1232 * lib/pipeline.c (pipeline_start): Change "couldn't exec %s" to
1233 "can't execute %s" in line with src/man.c, to make translators'
1234 lives easier.
1235 (pipeline_wait): Separate "%s: %s%s" into two translatable
1236 strings: the "(core dumped)" portion should definitely be
1237 translated.
1238
1239 Fri Aug 15 18:05:37 BST 2003 Colin Watson <[email protected]>
1240
1241 * lib/pipeline.c: Include <libgen.h> instead of relying on
1242 basename() prototype in manconfig.h.
1243
1244 Sat Aug 9 18:28:01 BST 2003 Colin Watson <[email protected]>
1245
1246 Replace the old "wait() for one child at a time" approach with a
1247 SIGCHLD-handling edifice that collects children's exit statuses as
1248 they die.
1249
1250 * lib/pipeline.c (pipeline_new): Initialize statuses.
1251 (pipeline_join): Set statuses to NULL in joined pipeline.
1252 (pipeline_join, pipeline_get_infile, pipeline_get_outfile,
1253 pipeline_start, pipeline_wait): Assert that statuses field is NULL
1254 or non-NULL as appropriate.
1255 (pipeline_free): Free statuses if necessary.
1256
1257 (pipeline_start): Add p to a new active_pipelines array, to be
1258 used while reaping children. Initialize statuses elements to -1.
1259 Block SIGCHLD while forking children.
1260 (reap_children): New function. Delivers collected exit statuses
1261 into statuses fields of entries in active_pipelines.
1262 (pipeline_wait): Rather than wait()ing manually here, check
1263 whether any statuses have been picked up by the SIGCHLD handler,
1264 and if not call reap_children(). Remove now-obsolete TODO comment.
1265 (pipeline_sigchld): New function, the SIGCHLD handler.
1266 (pipeline_install_sigchld): New function, to be called once per
1267 program.
1268
1269 (pipeline_start, pipeline_wait): Add minimal debugging
1270 information.
1271
1272 * lib/pipeline.h: Prototype new functions.
1273 (struct pipeline): New statuses member.
1274
1275 Sat Aug 9 17:00:12 BST 2003 Colin Watson <[email protected]>
1276
1277 * lib/pipeline.c (command_dup): Copy cmd->nice.
1278 (pipeline_command): Correct condition for growing commands array.
1279
1280 Mon Aug 4 19:35:26 BST 2003 Colin Watson <[email protected]>
1281
1282 * lib/pipeline.c (command_dup): Terminate argv with a NULL.
1283 (command_dup, command_arg): Assert that argc < argv_max after
1284 changing either.
1285
1286 Mon Aug 4 19:30:22 BST 2003 Colin Watson <[email protected]>
1287
1288 * lib/pipeline.c (pipeline_dump): New function to dump a printable
1289 representation of a pipeline to a stream.
1290 (pipeline_tostring): Likewise, but to a newly allocated string.
1291 * lib/pipeline.h: Prototype these.
1292
1293 Mon Aug 4 12:03:38 BST 2003 Colin Watson <[email protected]>
1294
1295 * lib/pipeline.c (argstr_get_word): Plug some memory leaks.
1296
1297 Mon Aug 4 01:05:12 BST 2003 Colin Watson <[email protected]>
1298
1299 * lib/pipeline.c (pipeline_wait): The return value was a bit
1300 groff-specific. Now just return the status of the last command in
1301 the pipeline, as reported by wait().
1302
1303 Mon Aug 4 00:31:44 BST 2003 Colin Watson <[email protected]>
1304
1305 Add support for getting stdio streams for input and output. Needs
1306 library support because pipeline_wait() needs to know to close the
1307 stream rather than the underlying file descriptor.
1308
1309 * lib/pipeline.h (struct pipeline): New infile and outfile members.
1310 (pipeline_get_infile, pipeline_get_outfile): Add prototypes.
1311 * lib/pipeline.c (pipeline_new): Initialize infile and outfile.
1312 (pipeline_join): Likewise.
1313 (pipeline_get_infile, pipeline_get_outfile): New functions.
1314 (pipeline_wait): Check for infile and outfile and fclose() them in
1315 preference to close()ing infd and outfd. Check for errors on
1316 close().
1317
1318 Sun Aug 3 23:59:18 BST 2003 Colin Watson <[email protected]>
1319
1320 * lib/pipeline.c (pipeline_start): Use dup2() instead of close()
1321 then dup().
1322
1323 Sun Aug 3 23:52:14 BST 2003 Colin Watson <[email protected]>
1324
1325 infd and outfd should now only be set by pipeline_start(). Positive
1326 values in want_in and want_out now indicate caller-supplied file
1327 descriptors, while negative values indicate a request for
1328 pipeline_start() to create a pipe.
1329
1330 * lib/pipeline.h (struct pipeline): Document this.
1331 * lib/pipeline.c (pipeline_start): Implement it. Caller-supplied
1332 input and output file descriptors previously didn't work properly.
1333 (pipeline_wait): Update TODO comment.
1334
1335 Sun Aug 3 21:07:46 BST 2003 Colin Watson <[email protected]>
1336
1337 * lib/pipeline.h (struct command): New 'nice' member.
1338 * lib/pipeline.c (command_new): Initialize nice.
1339 (pipeline_start): Change child process priority if nice is set.
1340
1341 Sun Aug 3 20:50:35 BST 2003 Colin Watson <[email protected]>
1342
1343 * lib/pipeline.c (pipeline_start): Pop all cleanups in child.
1344
1345 Sun Aug 3 20:47:24 BST 2003 Colin Watson <[email protected]>
1346
1347 * lib/pipeline.c (argstr_get_word, command_new_argstr,
1348 command_argstr, pipeline_command_argstr): New functions to handle
1349 constructing commands from shell-quoted strings, such as those
1350 found in man-db configuration files. They deliberately handle only
1351 a safe subset of shell syntax.
1352 * lib/pipeline.h: Prototype command_new_argstr(), command_argstr(),
1353 and pipeline_command_argstr().
1354
1355 Sun Aug 3 19:09:59 BST 2003 Colin Watson <[email protected]>
1356
1357 * lib/pipeline.c (command_dup): New function to duplicate a command.
1358 (pipeline_join): New function to join two pipelines together.
1359 * lib/pipeline.h: Prototype these.
1360
1361 Sun Aug 3 18:00:59 BST 2003 Colin Watson <[email protected]>
1362
1363 * lib/pipeline.h (struct pipeline): The writeto, readfrom, writefd,
1364 and readfd names turn out to be confusing in calling code. Rename
1365 to want_in, want_out, infd, and outfd respectively.
1366 * lib/pipeline.c (pipeline_new, pipeline_start, pipeline_wait): Use
1367 new names.
1368
1369 Sun Aug 3 16:35:24 BST 2003 Colin Watson <[email protected]>
1370
1371 Add support in pipeline library for writing input to or reading
1372 output from the whole pipeline.
1373
1374 * lib/pipeline.c (pipeline_new): Initialize writeto, readfrom,
1375 writefd, and readfd.
1376 (pipeline_start): Create extra pipes as necessary.
1377 (pipeline_wait): Expand TODO comment. Close file descriptors from
1378 extra pipes if necessary.
1379 * lib/pipeline.h (struct pipeline): Add writeto, readfrom, writefd,
1380 and readfd.
1381
1382 Sun Aug 3 11:15:17 BST 2003 Colin Watson <[email protected]>
1383
1384 * lib/pipeline.c: New pipeline library, adapted from that in groff.
1385 The interface isn't complete yet; in particular, it can't be a
1386 replacement for popen() at the moment.
1387 * lib/pipeline.h: New file with pipeline library interface.