12019-07-13 Sergey Poznyakoff <gray@gnu.org> 2 3 Version 5.2 4 52019-07-10 Sergey Poznyakoff <gray@gnu.org> 6 7 Switch to grecs b06fb7d3 8 92016-08-25 Sergey Poznyakoff <gray@gnu.org> 10 11 Update the documentation 12 132016-08-25 Sergey Poznyakoff <gray@gnu.org.ua> 14 15 Get rid of hashtab.c, use symtab from grecs instead. 16 17 * grecs: Pull new version. 18 * src/hashtab.c: Remove. 19 * po/POTFILES.in: Remove src/hashtab.c 20 * src/Makefile.am (direvent_SOURCES): Remove hashtab.c 21 * src/config.c (grecs_parser_options): Set GRECS_OPTION_QUOTED_STRING_CONCAT. 22 * src/direvent.h: Remove hashtab prototypes. 23 * src/event.c: Use grecs_symtab. 24 * src/watcher.c: Likewise. 25 26 Rename a test case 27 28 * tests/Makefile.am: Update. 29 * tests/testsuite.at: Update. 30 * tests/conv.at: Rename to tests/file.at 31 32 Fix new functionality on BSD hosts. Some minor fixes. 33 34 * src/direvent.c (main): Call watchpoint_gc in the main loop. 35 * src/direvent.h (watchpoint) <isdir>: New member. 36 (deliver_ev_create,subwatcher_create): Change signature. 37 * src/ev_kqueue.c (sysev_add_watch): Always monitor NOTE_DELETE. 38 (process_event): Special handling for file deletion. 39 * src/handler.c (handler_list_remove): Return the number of elements 40 remaining in the list. 41 * src/hashtab.c (hashtab_remove): Ignore unexisting entries 42 * src/progman.c (close_fds): Determine the highest used fd by 43 dup'ing standard input. 44 * src/watcher.c (watchpoint_install): Always increase refcnt. 45 (watchpoint_gc_list): New variable. 46 (watchpoint_gc): Iterate over watchpoint_gc_list deleting 47 elements from it. 48 (watchpoint_suspend): Install sentinels only for top-level 49 watchpoints that were removed. 50 (sentinel_handler_run): Deliver the create event. 51 (watchpoint_install_sentinel): Monitor generic create event. 52 (convert_watcher): Remove. 53 (subwatcher_create): Remove the isdir parameter. 54 (watch_subdirs): Exit early if the watchpoint is not a 55 directory. 56 (deliver_ev_create): Change signature. Take both directory 57 and file name as arguments. All uses changes. 58 * tests/conv.at: Clear expected stderr. 59 * tests/sent.at: Fix race condition. 60 61 Add new tests + minor fixes. 62 63 * src/direvent.h (filpatlist_is_empty): New proto. 64 * src/fnpat.c (filpatlist_is_empty): New function. 65 * src/watcher.c (convert_watcher): Fix error handling. 66 (watchpoint_init): Remove spurious notice. 67 68 * tests/conv.at: New test. 69 * tests/sent.at: New test. 70 * tests/Makefile.am: Add new tests. 71 * tests/testsuite.at: Likewise. 72 73 Further modify struct handler. 74 75 Instead of accomodating two types of functionality, the new struct handler 76 has a pointer to the function that is responsible for handling the event, 77 and a pointer to data for that function (closure). Additionally, a 78 pointer to deallocator function is also provided. 79 80 Existing functionality is reimplemented using this new struct. New 81 types of handlers can easily be added. 82 83 * src/config.c (eventconf)<ev_mask,fpat,prog_handler>: New members 84 <handler>: Remove. 85 All uses changed. 86 * src/direvent.h (filpatlist_t) 87 (event_handler_fn, handler_free_fn): New data types. 88 (handler): Remove union and type. Add two pointer to functions 89 that are to implement the functionality (run and free) and a pointer 90 to data for them. 91 (prog_handler): New struct. 92 (prog_handler_alloc,prog_handler_free) 93 (prog_handler_envrealloc) 94 (watchpoint_run_handlers): New protos. 95 (run_handler,filename_pattern_free) 96 (filename_pattern_match): Remove 97 (filpatlist_add, filpatlist_add_exact) 98 (filpatlist_destroy, filpatlist_match): New protos. 99 * src/ev_inotify.c (process_event): Use watchpoint_run_handlers 100 * src/ev_kqueue.c: Likewise. 101 * src/fnpat.c: Major rewrite. 102 * src/handler.c (handler_copy) 103 (handler_envrealloc,handler_add_pattern) 104 (handler_add_exact_filename): Remove 105 (handler_alloc): Change arguments. 106 (watchpoint_run_handlers): New function. 107 * src/progman.c (prog_handler_alloc) 108 (prog_handler_envrealloc): New functions. 109 * src/watcher.c: Reimplement sentinel watchers. 110 111 Rename: struct dirwatcher -> struct watchpoint 112 113 Implement sentinel handlers. 114 115 Sentinel handlers wait for a creation of a directory. When 116 the target directory is created, the sentinel handler installs 117 the actual handler for that directory and destroys itself. Thus, 118 basically sentinel handlers provide a way to defer setting a 119 watchpoint on a directory until it is created. 120 121 * src/handler.c: New source. 122 * src/Makefile.am (direvent_SOURCES): Add handler.c 123 * src/config.c: Move handler-specific stuff to handler.c 124 * src/direvent.h: Rename direvent_handler_ to handler_ 125 (handler_free, handler_copy) 126 (handler_envrealloc) 127 (dirwatcher_init,dirwatcher_gc): New protos. 128 (dirwatcher_install_ptr) 129 (dirwatcher_install_sentinel): New protos. 130 * src/ev_inotify.c (process_event): Special handling for 131 IN_IGNORED. 132 (sysev_select): Ignore signo==0. 133 * src/hashtab.c (hashtab_remove): Add missing return statement. 134 (hashtab_foreach): Break out of look instead of returning from 135 it. 136 * src/progman.c (run_sentinel): Implement. 137 * src/watcher.c (+dirwatcher_install_ptr): New function. 138 (dirwatcher_gc): New function. 139 140 Bugfix 141 142 * src/hashtab.c (hashent_list_append): Fix allocated memory size. 143 144 Initial preparation for having distinct handler types. 145 146 * src/direvent.h (pattern_type): New enum, instead of 147 PAT_* defines. 148 (filename_pattern): use enum pattern_type. 149 (handler_type): New enum. 150 (handler): Can be of two types: HANDLER_EXTERN, which handles 151 external programs and is equivalent to the prior content of 152 the structure, and HANDLER_SENTINEL, which is planned to be 153 a built-in handler for configuring watchpoints for newly created 154 directories. All uses changed. 155 (dirwatcher) <refcnt>: Change type to size_t. 156 (handler_alloc,handler_add_pattern) 157 (handler_add_exact_filename): New protos. 158 * src/hashtab.c: Provisions for safe adding and removing 159 from the hashtable when iterating over it. 160 (hashtab) <flags>: Removed. 161 <itr_level, list_new, list_del>: New members. 162 (hashtab_remove): When iterating, place pointer to the removed 163 entry in list_del instead of actually removing it. 164 (hashtab_lookup_or_install): When iterating, add a pointer to 165 the newly created entry to the list_new list, instead of adding 166 it immediately. 167 (hashtab_foreach): Flush list_del and list_new at the end of 168 the topmost iteration. 169 170 * src/config.c (handler_alloc): Rename to handler_copy 171 (handler_alloc): New function. 172 (handler_free): Two types of handlers. 173 (handler_add_pattern) 174 (handler_add_exact_filename): New functions. 175 (file_name_pattern): Takes struct handler * as its 176 first argument. 177 (cb_file_pattern): Change accordingly. 178 * src/fnpat.c (filename_pattern_free): Handle PAT_EXACT. 179 (filename_pattern_match): Likewise. 180 * src/progman.c (run_handler): Two types of handlers. 181 * src/watcher.c (dirwatcher_install): Restore missing gettext 182 marker. 183 Allocate handler_list. 184 (dirwatcher_init): Convert non-directory watchpoints to directory 185 ones. 186 1872016-08-20 Sergey Poznyakoff <gray@gnu.org> 188 189 Fix environment modification code 190 191 Port fixes from rush 192 1932016-08-13 Sergey Poznyakoff <gray@gnu.org> 194 195 Clean-up handler initialization routines. 196 197 In particular, this change allows for placing several environ statements 198 in a single watcher statement. Such environ statements accumulate. 199 200 * src/config.c (eventconf): Simplify the structure. 201 (handler_alloc): Take a pointer to struct handler as 202 argument. 203 (handler_envrealloc): New function. 204 (handler_free): Rename to handler_listent_free. All uses updated. 205 (handler_free): New function. 206 (eventconf_flush,cb_option,cb_user): Reflect changes to struct 207 eventconf 208 (cb_environ): Likewise. Reallocate env as necessary. 209 210 * doc/direvent.texi: Document the change. 211 212 * NEWS: Document the changes. 213 214 Limit memory usage. 215 216 Don't create duplicates of handler structs for each pathname 217 watched. Instead keep a count of references to each handler 218 and handler list and deallocate them when the count falls to 219 zero. 220 221 * src/config.c (direvent_handler_list): New struct. 222 (direvent_handler_first,direvent_handler_next) 223 (direvent_handler_current) 224 (direvent_handler_list_create) 225 (direvent_handler_list_copy) 226 (direvent_handler_list_unref) 227 (direvent_handler_list_append): New functions. 228 (eventconf_flush): Create a single copy of watcher. 229 * src/direvent.c (main): Call shutdown_watchers before terminating. 230 * src/direvent.h (handler) <next>: Remove. 231 <refcnt>: New member. 232 <prog>: Remove const qualifier. 233 (direvent_handler_list_t) 234 (direvent_handler_iterator_t): New data types. 235 (dirwatcher): Remove handler_tail. Change type of 236 handler_list to direvent_handler_list_t. 237 (shutdown_watchers) 238 (direvent_handler_first,direvent_handler_next) 239 (direvent_handler_current) 240 (direvent_handler_list_create) 241 (direvent_handler_list_copy) 242 (direvent_handler_list_unref) 243 (direvent_handler_list_append): New protos. 244 (for_each_handler): New define. 245 * src/watcher.c (dirwatcher_unref): Call direvent_handler_list_unref. 246 (all functions): Use handler iterators where necessary 247 (shutdown_watchers): New function. 248 * src/ev_inotify.c: Use handler iterators. 249 * src/ev_kqueue.c: Likewise. 250 251 Fix comments 252 2532016-08-12 Sergey Poznyakoff <gray@gnu.org.ua> 254 255 Version 5.1.90 256 257 * NEWS: Update. 258 * configure.ac: Update. 259 * src/watcher.c (setwatcher): Fix conditional. 260 * src/direvent.h (dirwatcher_pattern_match): Add missing prototype. 261 262 Don't keep watchpoint descriptor table 263 264 During the lifetime of a watcher, its descriptor can change, so 265 it cannot be reliably used to identify the watcher outside of 266 the ev_*.c module. E.g. for kqueue interface, descriptors change 267 after compacting the event table, which happens when a watcher is 268 closed and removed. 269 270 Finding the watcher for the given event is now the responsibility 271 of the event module. 272 273 * src/direvent.h (dirwatcher_ref) 274 (dirwatcher_unref): New protos. 275 (dirwatcher_lookup_wd): Remove. 276 * src/watcher.c (dirwatcher_ref): New function. 277 (dirwatcher_register, dirwatcher_lookup_wd) 278 (dirwatcher_remove_wd): Remove. All uses updated. 279 (setwatcher): Indicate successful initialization for 280 the caller. 281 (setup_watchers): Check success flag. 282 * src/ev_inotify.c (dwreg, dwunreg) 283 (dwget): New functions to keep track of the registered 284 watchers and their descriptors. 285 (sysev_add_watch): Register watcher. 286 (sysev_rm_watch): Deregister it. 287 * src/ev_kqueue.c (check_created): Skip directory entries 288 that don't match pattern. 289 2902016-08-11 Sergey Poznyakoff <gray@gnu.org.ua> 291 292 Bugfixes 293 294 * src/Makefile.am (AM_CPPFLAGS): Define SYSCONFDIR. 295 * src/direvent.c (mkfilename): Don't append trailing / 296 if filename is empty. 297 * src/direvent.h (hashtab_count_entries): Remove. 298 * src/ev_inotify.c (process_event): Translate IN_IGNORED to IN_DELETE. 299 Remove the watcher only after all handlers have been invoked. 300 * src/hashtab.c (hashtab) <elcount>: New member. Keep the number 301 of actually used elements. 302 (hashtab_remove, hashtab_lookup_or_install) 303 (hashtab_create,hashtab_clear): Keep track of the number of 304 actually used elements. 305 (hashtab_count_entries): Remove duplicate function. 306 (hashtab_count): Return elcount without recomputing. 307 * src/watcher.c (texttab): Rename to nametab for clarity. 308 (dirwatcher_pattern_match): New function. 309 (watch_subdirs): Ignore subdirs that don't match file name 310 pattern. 311 (dirwatcher_destroy): Exit immediately if no more watchers 312 are left. 313 3142016-07-06 Sergey Poznyakoff <gray@gnu.org.ua> 315 316 Version 5.1 317 3182016-07-04 Sergey Poznyakoff <gray@gnu.org.ua> 319 320 Remove unused variables 321 322 Use latest commit of grecs 323 324 Update copyright years 325 3262016-06-20 Sergey Poznyakoff <gray@gnu.org> 327 328 Update grecs 329 330 Make sure descriptor 0 is allocated before calling detach. 331 332 * grecs: Upgrade to 9161098. 333 334 Bugfix 335 336 * configure.ac (INCLUDE_PATH_ARGS): Quote definition for shell 337 338 Implement search path for #include and #include_once. 339 340 * src/Makefile.am (AM_CPPFLAGS): Define INCLUDE_PATH_ARGS 341 * src/cmdline.opt: New option --include-directory (-I). 342 (help_hook): Print the actual content of the include search path. 343 * src/config.c (config_finish): Remove. 344 (config_init): New function. Set up include search path. 345 (config_parse): New function. 346 * src/direvent.c (main): Call config_init and config_parse. 347 * src/direvent.h (config_finish): Remove. 348 (config_init,config_parse): New proto. 349 350 * grecs: Upgrade. 351 352 * NEWS: Document changes. 353 * README: Document the --with-include-path option. 354 * configure.ac: New option --with-include-path. 355 * doc/direvent.8: Document the -I option and include search paths. 356 * doc/direvent.conf.5: Document include search paths. 357 * doc/direvent.texi: Document the -I option and include search paths. 358 3592016-06-18 Sergey Poznyakoff <gray@gnu.org> 360 361 New option to invoke handlers via /bin/sh 362 363 * src/config.c (cb_option): New option 'shell'. 364 * src/direvent.h (HF_SHELL): New flag. 365 * src/progman.c (runcmd): Optionally run program via /bin/sh 366 * NEWS: Mention new option. 367 * doc/direvent.conf.5: Document the 'shell' option. 368 * grecs: Update. 369 * tests/shell.at: New test case. 370 * tests/Makefile.am: Add new test. 371 * tests/testsuite.at: Add new test. 372 373 Globbing patterns in #include and #include_once 374 375 * grecs: Update. 376 * src/direvent.c (main): Allocate tag to avoid coredump if 377 redefined in the config. 378 * tests/re05.at: Escape backslash. 379 * NEWS: Update. 380 * doc/direvent.conf.5: Update. 381 * doc/direvent.texi: Update. 382 3832015-04-23 Sergey Poznyakoff <gray@gnu.org.ua> 384 385 Fix doc generation. 386 387 Default Config file applied to all output formats, which is wrong. 388 Use a dedicated configuration file for html output formats, and 389 defaults for the rest. 390 391 * doc/Makefile.am (GENDOCS): Add html-specific configuration file. 392 * doc/Config: Rename to doc/html.init (with changes). 393 3942015-04-16 Sergey Poznyakoff <gray@gnu.org.ua> 395 396 Version 5.0.90 397 3982015-03-01 Sergey Poznyakoff <gray@gnu.org> 399 400 Switch to Texinfo 5.0 401 402 * doc/Config: Rewrite. 403 * doc/Makefile.am: Use Makeinfo 5 instead of texi2htm 404 * doc/gendocs_template: Ps is not built 405 * imprimatur: Upgrade. 406 4072014-09-18 Sergey Poznyakoff <gray@gnu.org.ua> 408 409 Minor documentation fixes. 410 411 * doc/direvent.8: Escape dashes in examples. 412 * doc/direvent.conf.5: Likewise. 413 * doc/direvent.texi: Reword copyright statement (part about covers). 414 4152014-09-06 Sergey Poznyakoff <gray@gnu.org> 416 417 Version 5.0 418 4192014-09-06 Sergey Poznyakoff <gray@gnu.org.ua> 420 421 Add new test 422 423 * tests/samepath.at: New file. 424 * tests/Makefile.am: Add new testcase. 425 * tests/testsuite.at: Likewise. 426 427 * NEWS: Update 428 * README: Update 429 4302014-09-01 Sergey Poznyakoff <gray@gnu.org> 431 432 Version 4.1.91 433 434 Improve I18N 435 436 * po/POTFILES.in: Add grecs sources. 437 * src/Makefile.am (AM_CPPFLAGS): Add the definition of LOCALEDIR. 438 * src/cmdline.opt (help_hook): Add missing gettext markers. 439 * src/direvent.c (maint): Initialize libintl 440 4412014-09-01 Sergey Poznyakoff <gray@gnu.org.ua> 442 443 Improve and document self-test mode 444 445 * src/direvent.c (self_test): Run the program as /bin/sh -c program. 446 * doc/direvent.texi: Document self-test mode and missing options. 447 * doc/direvent.8: Document self-test. 448 * doc/direvent.conf.5: Likewise. 449 * src/cmdline.opt: Fix option declarations. 450 4512014-09-01 Sergey Poznyakoff <gray@gnu.org> 452 453 bootstrap: add option to get update po files and exit 454 4552014-08-31 Sergey Poznyakoff <gray@gnu.org> 456 457 Accept multpile watchers for the same path 458 459 * src/direvent.h (dirwatcher)<handler_tail>: New member. 460 * src/config.c (eventconf_flush): Use handler_tail to update 461 the handler list. 462 Remove erroneous check. 463 4642014-08-27 Sergey Poznyakoff <gray@gnu.org> 465 466 Minor changes 467 468 * src/direvent.c (get_user_groups): Fix typo in a diagnostic 469 message. 470 471 bootstrap: download po files 472 4732014-08-25 Sergey Poznyakoff <gray@gnu.org> 474 475 Update NEWS 476 477 Upgrade grecs 478 479 I18N 480 481 * .gitignore: Add am 482 * bootstrap: Create am, unless exists. 483 * Makefile.am (SUBDIRS): Add po 484 * acinclude.m4: New file. 485 * configure.ac: Use gettext 486 * doc/direvent.texi: Update 487 * po/.gitignore: New file 488 * po/POTFILES.in: New file. 489 * po/Makevars: New file. 490 * src/Makefile.am (LDADD): Add @LIBINTL@ 491 (noinst_HEADERS): Add gettext.h 492 * src/config.c: gettextize 493 * src/direvent.c: Likewise. 494 * src/environ.c: Likewise. 495 * src/hashtab.c: Likewise. 496 * src/progman.c: Likewise. 497 * src/watcher.c: Likewise. 498 * src/gettext.h: New file. 499 500 * src/direvent.h: Add missing prototypes. 501 * tests/re05.at: Remove superfluous quoting. 502 5032014-08-22 Sergey Poznyakoff <gray@gnu.org> 504 505 Update docs 506 5072014-08-21 Sergey Poznyakoff <gray@gnu.org> 508 509 Minor fix in docs 510 511 Direvent is dubbed GNU program 512 513 * configure.ac: Change package name to GNU Direvent 514 * doc/direvent.8: Reflect we are GNU 515 * doc/direvent.texi: Likewise. 516 * src/cmdline.opt: Likewise. 517 5182014-08-17 Sergey Poznyakoff <gray@gnu.org> 519 520 Rewrite testsuite. 521 522 Get rid of the kludgy waitpid; use the built-in self-test mode instead. 523 524 * src/cmdline.opt: New option --self-test. 525 * src/direvent.c (self_test_prog,self_test_pid) 526 (exit_code): New globals. 527 (self_test): New function. 528 (main): Call self_test if required. 529 If stop is set, break the loop immediately. 530 Return exit_code. 531 * src/direvent.h (stop,self_test_pid,exit_code): New externs. 532 * src/environ.c (environ_setup): Always define DIREVENT_SELF_TEST_PID 533 when in self-test mode. 534 * src/progman.c (process_cleanup): Special handling for termination of 535 the self-test script. 536 (runcmd): Define self_test_pid envvar in self-test mode. 537 * tests/Makefile.am: Remove waitpid. 538 * tests/waitfile.c: Removed. 539 * tests/printname: Send HUP to the self-test PID if sentinel file is created. 540 * tests/envdump.c (read_pid_and_sig): Restore arg to its pristine state 541 before exiting. 542 * tests/testsuite.at (AT_DIREVENT_TEST): New macro. 543 544 * tests/attrib.at: Rewrite using AT_DIREVENT_TEST. 545 * tests/cmdexp.at: Likewise. 546 * tests/create.at: Likewise. 547 * tests/createrec.at: Likewise. 548 * tests/delete.at: Likewise. 549 * tests/env00.at: Likewise. 550 * tests/env01.at: Likewise. 551 * tests/env02.at: Likewise. 552 * tests/env03.at: Likewise. 553 * tests/glob01.at: Likewise. 554 * tests/glob02.at: Likewise. 555 * tests/re01.at: Likewise. 556 * tests/re02.at: Likewise. 557 * tests/re03.at: Likewise. 558 * tests/re04.at: Likewise. 559 * tests/re05.at: Likewise. 560 * tests/write.at: Likewise. 561 * grecs (untracked content) 562 563 Rename project to direvent. 564 5652014-08-10 Sergey Poznyakoff <gray@gnu.org> 566 567 Version 4.1.90 568 569 * NEWS: Change version number 570 * configure.ac: Likewise. 571 * doc/dircond.conf.5: Update copyright years. 572 * doc/dircond.texi: Update copyright years. 573 * src/config.c: Update copyright years. 574 * src/dircond.h: Update copyright years. 575 * src/fnpat.c: Update copyright years. 576 * tests/envdump.c: Update copyright years. 577 5782014-07-29 Sergey Poznyakoff <gray@gnu.org> 579 580 Introduce pattern negation. 581 582 * doc/dircond.conf.5: Document negated patterns. 583 * doc/dircond.texi: Likewise. 584 * src/config.c (file_name_pattern): A ! in front of a pattern 585 indicates negation. 586 * src/dircond.h (filename_pattern)<neg>: New member. 587 * src/fnpat.c: Honor neg member. 588 * tests/envdump.c (main): don't depend on the order of command 589 line options. 590 * tests/glob02.at: New test case. 591 * tests/re05.at: Likewise. 592 * tests/Makefile.am: Add new files. 593 * tests/testsuite.at: Include new testcases. 594 5952013-12-27 Sergey Poznyakoff <gray@gnu.org.ua> 596 597 Remove trailing tabs in doc/dircond.8 598 599 Update gendocs_template 600 601 Update dircond.conf.5 602 603 Version 4.1 604 605 * NEWS: Document new release. 606 607 * Makefile.am 608 * configure.ac: Enable silent rules. Set version number 4.1 609 * doc/Makefile.am: Add copyleft header. 610 * src/Makefile.am: Likewise. 611 * tests/Makefile.am: Add missing silent rule markers. 612 613 Fix documentation of the "file" statement. 614 615 Implement filename selection 616 617 * NEWS: Update. 618 * doc/dircond.texi: Document the file statement. 619 * src/fnpat.c: New file. 620 * src/Makefile.am (dircond_SOURCES): Add fnpat.c 621 * src/config.c (eventconf) <fnames>: New member. 622 (eventconf_free): Free fnames. 623 (eventconf_flush): Set fnames. 624 (watcher_kw) <file>: New statement. 625 * src/dircond.h (filename_pattern): New struct. 626 (handler) <fnames>: New member. 627 (handler_matches_event): New macro. 628 (filename_pattern_free) 629 (filename_pattern_match): New proto. 630 * src/ev_inotify.c (process_event): Use handler_matches_event. 631 * src/ev_kqueue.c: Likewise. 632 * src/watcher.c (deliver_ev_create): Likewise. 633 634 * tests/Makefile.am: Add new tests. 635 * tests/testsuite.at: Likewise. 636 * tests/create.at: Add a distinctive keyword. 637 * tests/glob01.at: New testcase. 638 * tests/re01.at: New testcase. 639 * tests/re02.at: Likewise. 640 * tests/re03.at: Likewise. 641 * tests/re04.at: Likewise. 642 6432013-12-17 Sergey Poznyakoff <gray@gnu.org> 644 645 Upgrade grecs 646 6472013-10-02 Sergey Poznyakoff <gray@gnu.org.ua> 648 649 Fix the testsuite, bump version number 650 651 * configure.ac: Update version number. 652 * NEWS: Update version number. 653 * tests/Makefile.am: Distribute printname. 654 * tests/printname: New file. 655 * tests/atlocal.in (SRCDIR): New variable. 656 * tests/createrec.at: Fix path to printname. 657 6582013-09-29 Sergey Poznyakoff <gray@gnu.org.ua> 659 660 Generate genev_create event for subdirectories. 661 662 A genev_create event is generated for all files and directories below the 663 newly created one, if required by the configuration. At the same time, new 664 watchers are installed. This is illustrated by the testcase "createrec.at", 665 which version 4.0 wouldn't pass, because it incorrectly assumed that a 666 notification would arrive for each subdirectory or subfile, once the watcher 667 is installed for the parent directory. 668 669 * src/watcher.c (subwatcher_create): Return integer. 670 Take additional argument (notify). If it is true, register 671 watchers for the subdirectories. 672 (deliver_ev_create): New function. 673 (watch_subdirs): Return number of watchers installed or -1 674 on error. 675 (watch_pathname): Remove. All callers use subwatcher_create 676 instead. 677 * tests/Makefile.am: Add new test. 678 * tests/testsuite.at: Likewise. 679 * tests/attrib.at: Use pwd -P, instead of plain pwd. 680 * tests/cmdexp.at: Likewise. 681 * tests/create.at: Likewise. 682 * tests/delete.at: Likewise. 683 * tests/env00.at: Likewise. 684 * tests/env01.at: Likewise. 685 * tests/env02.at: Likewise. 686 * tests/env03.at: Likewise. 687 * tests/write.at: Likewise. 688 6892013-09-15 Sergey Poznyakoff <gray@gnu.org.ua> 690 691 Minor fixes in the docs. 692 6932013-06-05 Sergey Poznyakoff <gray@gnu.org.ua> 694 695 Fix typos in manpages 696 697 Update scripts for generating documentation output. 698 6992013-06-04 Sergey Poznyakoff <gray@gnu.org.ua> 700 701 Update dircond manpage 702 703 Finish the docs. Set version number 4.0. Change bug-report address. 704 705 Update docs. 706 707 * NEWS: Update. 708 * doc/dircond.conf.5: Update. 709 * doc/dircond.texi: Update. 710 * src/config.c (cb_watcher): Treat missing "event" 711 statement as "all events". 712 * src/dircond.h (evtsetall): New prototype. 713 * src/event.c (evtsetall): New function. 714 * src/environ.c: Minor fix. 715 716 inotify: fix definition of the generic write event 717 718 * src/ev_inotify.c (genev_xlat): Translate IN_MODIFY|IN_CLOSE_WRITE 719 to GENEV_WRITE. 720 721 Update docs 722 7232013-06-03 Sergey Poznyakoff <gray@gnu.org.ua> 724 725 Reorganize namespace. 726 727 Revamp initialization system in a cleaner way. 728 729 * src/Makefile.am: Use the proper detach-*.c source depending 730 on the configuration output. 731 * src/rdaemon.c: Remove. 732 * src/detach-std.c: New file. 733 * src/detach-bsd.c: New file. 734 * src/detach-darwin.c: New file. 735 * src/dircond.c (signal_setup): Use sigv_set_all. 736 (sigmain): Do not reinstall the handler. 737 (main): Use detach() instead of daemon(). 738 * src/dircond.h (detach): New proto. 739 (NITEMS): New macro. 740 (sigv_set_action, sigv_set_all) 741 (sigv_set_tab, sigv_set_action_tab): New protos. 742 * src/sigv.c: New file. 743 * tests/waitfile.c: Remove unused variable. 744 * doc/dircond.8: Update. 745 * doc/dircond.texi: Update. 746 747 Improve docs 748 7492013-06-02 Sergey Poznyakoff <gray@gnu.org.ua> 750 751 Fix a copy-paste error. 752 753 Write the docs in manpage format: 754 755 * doc/.gitignore 756 * doc/Makefile.am: Add rules for texinfo documents. 757 * doc/dircond.1: Removed. 758 * doc/dircond.8: New file. 759 * doc/dircond.conf.5: New file. 760 * doc/dircond.texi: New file (a placeholder). 761 * doc/fdl.texi: New file. 762 * doc/gendocs_template: New file. 763 764 Rename event variables and the corresponding environment 765 ones: 766 767 * src/environ.c 768 * src/dircond.c 769 * src/progman.c 770 * tests/.gitignore 771 * tests/attrib.at 772 * tests/cmdexp.at 773 * tests/create.at 774 * tests/delete.at 775 * tests/env00.at 776 * tests/env01.at 777 * tests/env03.at 778 * tests/remove.at 779 * tests/write.at 780 7812013-06-01 Sergey Poznyakoff <gray@gnu.org.ua> 782 783 Bugfix 784 785 * src/dircond.c (vdiag): Fix memory allocation 786 787 Uograde grecs 788 789 Upgrade grecs 790 791 Initial support for Darwin. 792 793 Basically the same as BSD, except that it lacks rfork, which 794 makes it impossible to initialize watchers before daemonizing. 795 796 * configure.ac: Check for rfork, define the DIRCOND_FORK conditional 797 if present. 798 * src/Makefile.am [DIRCOND_KQUEUE][DIRCOND_RFORK]: Add rdaemon.c 799 to the sources. 800 * src/dircond.c: Define INIT_EARLY if it is safe to initialize 801 the event system before forking. Currently the only supported 802 system that's not capable of that is Darwin. 803 (main): Call setup_watchers conditionally, before or after the 804 call to daemon. 805 Move call to evsys_init to setup_watchers. 806 Reorganize the main loop. 807 * src/dircond.h (event_mask_init): Change signature. The third 808 argument specifies which mask bits we're interested in. 809 All uses changed. 810 * src/event.c: Ditto. 811 * src/watcher.c (setup_watchers): Call evsys_init. 812 813 Test environment modifications. 814 815 * src/config.c (cb_environ): Accept list argument. 816 * tests/Makefile.am: Add new tests. 817 * tests/testsuite.at: Add new tests. 818 * tests/env00.at: New file. 819 * tests/env01.at: New file. 820 * tests/env02.at: New file. 821 * tests/env03.at: New file. 822 823 Test command line expansions. 824 825 * envdump.c: Accept unrecognized command line parameters. 826 Use -f option to redirect output to a file. All uses updated. 827 * cmdexp.at: New file. 828 * Makefile.am: Add cmdexp.at 829 * testsuite.at: Include cmdexp.at 830 831 Fix CREATE detection with kqueue. 832 833 * src/ev_kqueue.c (check_created): Fall back to hash lookup 834 to see if the file is recently created. 835 * tests/create.at: Remove the sleep. Wait for the pidfile to 836 appear before proceding with the test. 837 * tests/delete.at: Wait for the pidfile to appear before 838 proceding with the test. 839 * tests/remove.at: Likewise. 840 * tests/write.at: Likewise. 841 842 Minor fixes. 843 844 Minor fixes 845 846 Fix daemon mode on BSD. Provide a testsuite. 847 848 * configure.ac: Initialize the testsuite. 849 * src/Makefile.am [DIRCOND_KQUEUE] (dircond_SOURCES): Add rdaemon.c 850 * src/rdaemon.c: New file. 851 * src/cmdline.opt: New option -l. 852 * src/config.c (get_priority): New function. 853 * src/dircond.c (log_to_stderr): New variable. 854 (vdiag): Optionally output the message both to 855 stderr and syslog. 856 (stop): New global. 857 (sigmain): Set stop. 858 (main): Initialize logging early. 859 Loop until stop is set. 860 Remove pidfile before returning. 861 * src/dircond.h (read_facility): Remove. 862 (get_facility,get_priority): New protos. 863 * src/ev_kqueue.c (evsys_select): Fix error handling. 864 * tests/.gitignore: New file. 865 * tests/Makefile.am: Provide autotest framework. 866 * tests/atlocal.in: New file. 867 * tests/attrib.at: New file. 868 * tests/create.at: New file. 869 * tests/delete.at: New file. 870 * tests/remove.at: New file. 871 * tests/testsuite.at: New file. 872 * tests/envdump.c: Add more features. 873 * tests/waitfile.c: New file. 874 875 Add tests directory. 876 877 * Makefile.am (SUBDIRS): Add tests 878 * configure.ac: Build tests/Makefile. 879 * tests/.gitignore: New file 880 * tests/Makefile.am: New file. 881 * tests/envdump.c: New file. 882 883 Minor fixes 884 885 * src/cmdline.opt (help_hook): Change wording. 886 * src/config.c (config_help): Fix a typo. 887 * src/dircond.c (signal_setup): Include SIGCHLD 888 (main): Reset grecs_log_to_stderr. 889 * src/progman.c (run_handler): SIGCHLD is handled 890 by signal_setup. 891 892 Improve command line handling. 893 894 * configure.ac (GRECS_SETUP): Request getopt. 895 * src/.gitignore: Add cmdline.h 896 * src/cmdline.opt: New file. 897 * src/Makefile.am: Add new rules. 898 * src/config.c: New statement "user". 899 * src/dircond.c: Change command line handling. 900 901 Control execution environment and handler arguments. 902 903 * src/environ.c: New file. 904 * src/Makefile.am: Add environ.c 905 * src/config.c: Rename "event" compound statement to "watcher". 906 New statement "environ". 907 * src/dircond.h (handler) <env>: New member. 908 (environ_setup): New proto. 909 * src/progman.c (event_to_env): Remove function. 910 (runcmd): New function. 911 (run_handler): Call runcmd to prepare execution environment and 912 launch the handler. 913 914 Minor improvements 915 916 * /src/dircond.c (vdiag): Implement print-priority. 917 (main): Print version number along with the startup 918 and shutdown messages. 919 920 Upgrade grecs 921 922 Add bootstrap 923 924 Rewrite configuration support using grecs. 925 926 * grecs: Incorporate grecs as a submodule 927 * .gitmodules: New file. 928 * src/config.c: Rewrite. 929 * src/dircond.c: Use grecs. 930 * src/dircond.h (opt_facility): Remove 931 (syslog_include_prio): New global. 932 (pathent) <next>: Remove. 933 * pathdefn.c: Remove. 934 935 Switch to deep structure. 936 937 Change version number. Update THANKS file. Improve -h output. 938 939 Make sure directory and filename parts are meaningful when calling the handler. 940 941 * dircond.h (dirwatcher) <split_p>: New member. 942 <file_mode>: Change type to mode_t. 943 (run_handler): Change signature. 944 (split_pathname,unsplit_pathname): New protos. 945 * ev_inotify.c (process_event): Use split_pathname 946 to obtain file and directory parts if the watched 947 object is not a directory. 948 * ev_kqueue.c (filename): Remove function. 949 (check_created): Change call to run_handler. 950 (process_event): Use split_pathname 951 to obtain file and directory parts. 952 * progman.c (run_handler): Change signature and 953 calling convention. 954 * watcher.c (watch_subdirs): Fix diagnostics message. 955 (split_pathname,unsplit_pathname): New functions. 956 957 One more fix. 958 959 * dircond.c (trans_strtotok): 2nd arg is const 960 * dircond.h: Ditto. 961 962 Add missing include. 963 964 Keep separate process entries for redirectors. 965 966 * dircond.h: Remove unneeded prototypes. 967 * progman.c (process) <type,v>: New members. 968 (register_process): Take process type as the first argument. 969 (process_cleanup): Update. 970 (open_redirector): Change type of the last argument. 971 (run_handler): Reflect changes in open_redirector. 972 973 Move process management functions into a separate module. 974 975 Minor fixes. 976 977 Introduce system-independent event codes. 978 979 * config.c (parse_event, parse_onevent): Use event_mask structure. 980 * dircond.c (trans_strtotok, trans_toktostr) 981 (trans_toknext,trans_tokfirst) 982 (ev_log): New functions 983 (event_to_env): New static. 984 (run_handler): Take a pointer to event_mask. 985 Use event_to_env to construct the environment. 986 (man): Initialize system-independent events. 987 * dircond.h (SIE_CREATE, SIE_WRITE) 988 (SIE_ATTRIB, SIE_DELETE): System-independent event codes. 989 (event_mask): New typedef. 990 (event): Remove structure. 991 (transtab): New structure. 992 (handler) <ev_mask>: Change type to event_mask. 993 (evsys_filemask): New proto. 994 (evsys_add_watch,run_handler): Change signature. 995 (defevt, getevt): Likewise, 996 (evtnullp, event_mask_init): New protos. 997 (sie_xlat, sie_trans, evsys_transtab): New externs. 998 (trans_strtotok, trans_toktostr) 999 (trans_tokfirst, trans_toknext): New protos. 1000 * ev_inotify.c (evsys_transtab): New global. 1001 (sie_xlat): New global. 1002 (ev_log): Remove. 1003 (evsys_filemask): Remove variable, add function. 1004 (evsys_add_watch): Change signature. 1005 * ev_kqueue.c (events): Remove. 1006 (evsys_transtab): New global. 1007 (evsys_name_to_code, evsys_code_to_name): Remove. 1008 (evsys_filemask): Remove variable, add function. 1009 (ev_log): Remove. 1010 (sie_xlat): New global. 1011 (evsys_add_watch): Change signature. 1012 Add NOTE_WRITE to directory flags if SIE_CREATE is requested. 1013 (check_created): Deliver the SIE_CREATE event. 1014 (process_event): Update. 1015 * event.c (symevt) <mask>: Change type to event_mask. 1016 (defevt,getevt): Rewrite taking event_mask as additional 1017 argument. 1018 (evtnullp): New function 1019 (sie_trans): New global. 1020 (event_mask_init): New function. 1021 * watcher.c (dirwatcher_init): Initialize both system-dependent 1022 and system-independent event masks. 1023 (watch_subdirs): Call evsys_filemask to decide which files to 1024 watch. 1025 1026 Use fd_set capable of keeping sysconf(_SC_OPEN_MAX) descriptors. 1027 1028 * dircond.c (bigfd_set): New type 1029 (BIGFD_SET_COUNT, BIGFD_SET_ALLOC) 1030 (BIGFD_SET, BIGFD_ISSET): New macros. 1031 (close_fds): Use bigfd_set. All callers updated. 1032 1033 Bugfix 1034 1035 * dircond.h (dirwatcher_lookup): New proto. 1036 * watcher.c (dirwatcher_lookup): Remove static qualifier. 1037 1038 kqueue: handle file creates and deletes. 1039 1040 * dircond.h (dirwatcher) [USE_IFACE == IFACE_KQUEUE] <file_mode> 1041 <file_ctime>: New members. 1042 (remove_watcher): Remove prototype. 1043 (dirwatcher_destroy,watch_pathname): New protos. 1044 * ev_inotify.c (remove_watcher): New function (from watcher.c) 1045 * ev_kqueue.c (evsys_add_watch): Use EV_CLEAR instead of EV_ONESHOT. 1046 Initialize file_mode and file_ctime. 1047 (evsys_rm_watch): Fix conditional. 1048 (check_created): New function. 1049 (process_event): Handle file additions and deletions. 1050 * watcher.c (watch_subdirs): Use watch_pathname. 1051 (watch_pathname): New function. 1052 1053 Restore default timeout. 1054 1055 The default timeout setting was inadvertently lost in 02f27691. 1056 1057 * config.c (opt_timeout): Initialize. 1058 * dircond.h (DEFAILT_TIMEOUT): New constant. 1059 1060 Bugfix. 1061 1062 * ev_kqueue.c (process_event): Strip directory prefix off the 1063 file name. 1064 1065 Move commonly used headers to dircond.h 1066 1067 Change main loop. 1068 1069 * dircond.c: Change main loop. 1070 * dircond.h (evsys_loop): Remove. 1071 (evsys_select): New proto. 1072 * ev_inotify.c: Likewise. 1073 * ev_kqueue.c: Likewise. 1074 1075 Initial implementation of kqueue support. 1076 1077 * ev_inotify.c: New file. 1078 * ev_kqueue.c: New file. 1079 * configure.ac: Set up automake conditionals and defines 1080 depending on the selected interface. Bail out if no suitable 1081 interface is found. 1082 * Makefile.am: Add the right ev_*.c source to dircond_SOURCES. 1083 * dircond.c (run_handler): Remove static qualifier. 1084 (process_event): Remove. 1085 (main): Use evsys_* calls for interface-dependent operations. 1086 * dircond.h (event): New struct. 1087 (ifd): Remove extern. 1088 (signo): New extern. 1089 (ev_name_to_code): Rename to evsys_name_to_code. 1090 (ev_code_to_name): Rename to evsys_code_to_name. 1091 (ev_log): Remove. 1092 (evsys_init,evsys_add_watch) 1093 (evsys_rm_watch,evsys_loop): New protos. 1094 (evsys_filemask): New extern. 1095 * event.c: Remove interface-dependent stuff. 1096 * watcher.c (dirwatcher_install): Initialize wd to -1. 1097 (watch_subdirs): Use evsys_filemask to decide whether to scan the 1098 directory. 1099 All functions: Use evsys_* calls for interface-dependent operations. 1100 1101 Autoconfiscate 1102 1103 * .gitignore: Update 1104 * AUTHORS: New file. 1105 * Makefile.am: New file. 1106 * THANKS: New file. 1107 * configure.ac: New file. 1108 * Makefile: Remove. 1109 * NEWS: Update. 1110 * dircond.c: Include config.h 1111 * event.c: Likewise. 1112 * hashtab.c: Likewise. 1113 * pathdefn.c: Likewise. 1114 * watcher.c: Likewise. 1115 1116 Update NEWS 1117 11182013-05-30 Sergey Poznyakoff <gray@gnu.org.ua> 1119 1120 Fix a typo 1121 11222013-05-29 Sergey Poznyakoff <gray@gnu.org.ua> 1123 1124 Bugfix 1125 1126 * watcher.c (watch_subdirs): Fix erroneous conversion specifier 1127 in the diagnostics message. 1128 11292013-05-28 Sergey Poznyakoff <gray@gnu.org.ua> 1130 1131 Bugfix. 1132 1133 * config.c (parse_option): Fix the sense of the nowait option. 1134 1135 Fix help output. 1136 11372013-05-27 Sergey Poznyakoff <gray@gnu.org.ua> 1138 1139 Restore default timeout. 1140 1141 The default timeout setting was inadvertently lost in 02f27691. 1142 1143 * config.c (opt_timeout): Initialize. 1144 * dircond.h (DEFAILT_TIMEOUT): New constant. 1145 1146 Bugfix. 1147 1148 * pathdefn.c (pathdefn_get): Fix return value. 1149 11502013-05-26 Sergey Poznyakoff <gray@gnu.org.ua> 1151 1152 Lint mode 1153 1154 * dircond.c (main): Use the -L option to introduce syslog tag 1155 and the -t option to request "lint" behavior. 1156 * dircond.1: Update. 1157 11582013-03-22 Sergey Poznyakoff <gray@gnu.org.ua> 1159 1160 Bugfix 1161 1162 * dircond.c (setuser): Set up supplementary groups of the user. 1163 11642013-03-08 Sergey Poznyakoff <gray@gnu.org.ua> 1165 1166 New feature: run handler as a specified user. 1167 1168 * config.c (parse_onevent): Change "call" to "run". Retain 1169 the latter for compatibility. 1170 Hanlde optional "as USER" clause. 1171 Bugfix: initialize hp->next. 1172 * dircond.1: Document changes. 1173 * dircond.c (run_handler): Switch to the requested user 1174 privileges before running the handler. 1175 * dircond.h (handler) <uid,gidv,gidc>: New members. 1176 11772013-03-07 Sergey Poznyakoff <gray@gnu.org.ua> 1178 1179 Fix syslog vs. stderr inconsistency. 1180 1181 * config.c (opt_facility): new global. 1182 (parse_syslog): Set opt_facility, unless 1183 it is already set (in the command line). 1184 * dircond.c (main) <opt_facility>: Remove (now global). 1185 * dircond.h (opt_facility): New extern. 1186 1187 * Makefile (clean): add dircond 1188 11892013-03-06 Sergey Poznyakoff <gray@gnu.org.ua> 1190 1191 More fixes. 1192 1193 * dircond.c (print_status): Take sigset_t* as the 1194 second argument. Mask out diagnostic messages 1195 according to it. 1196 (process_cleanup): Mask out SIGTERM and SIGKILL 1197 as needed. 1198 (run_handler): Swap redirectors syslog priorities: 1199 stderr goes to LOG_ERR, and stdout to LOG_INFO. 1200 1201 Bugfixes. 1202 1203 * config.c (read_facility): Fix return value. 1204 * dircond.c: Fix help output. 1205 * dircond.1: Fix incorrect example. 1206 12072013-02-14 Sergey Poznyakoff <gray@gnu.org.ua> 1208 1209 Update docs. 1210 1211 New option -V 1212 1213 * Makefile (CPPFLAGS): Define VERSION 1214 * dircond.c: New option -V (print version). 1215 * dircond.1: Document new option. 1216 1217 Bugfixes. 1218 1219 * Makefile (DISTFILES): Bugfix. 1220 * config.c (parse_event): Bugfix. 1221 * NEWS: Update (version 3.0, preliminary) 1222 12232013-01-29 Sergey Poznyakoff <gray@gnu.org.ua> 1224 1225 Bugfixes. 1226 1227 * config.c (nextln): Fix out of range read. 1228 * dircond.1: Update. 1229 * event.c (ev_code_to_name): Find first matching event. 1230 Do not rely on exact match, because the even mask may 1231 have several bits set. 1232 1233 Improve error handling. 1234 1235 * config.c (parse_path): Bail out if incorrect option 1236 is given. 1237 * dircond.h (hashtab_count): New proto. 1238 * hashtab.c (hashtab_count): New function. 1239 * watcher.c (setup_watchers): Bail out if no handlers configured 1240 or if unable to install any. 1241 1242 Improve configuration syntax, document the changes. 1243 1244 * config.c (path statement): New keyword "recursive". 1245 * dircond.c (process_event): Provide a detailed 1246 event logging. 1247 * event.c (ev_log): New function. 1248 1249 * dircond.1: Document all changes. 1250 1251 * dircond.h: Add file. 1252 1253 Major revamp 1254 1255 All configuration moved to configuration file (default: /etc/dircond.conf). 1256 Only a few command line options have been retained. 1257 1258 Watcher structures are kept in hash tables, which allows for faster 1259 lookups, especially if there are many watchers. 1260 1261 * Makefile: Add new source. 1262 * config.c: New file. 1263 * dircond.c (conffile): New global. 1264 (facility): Default to stderr. Will be changed by main if 1265 going daemon. 1266 (handler_timeout, autowatch): Remove. 1267 Move datatype definitions and macros to dircond.h 1268 (ev_name_to_code, ev_code_to_name): Move to event.c 1269 (erealloc, estrdup): New functions. 1270 (proc_unlink, proc_pop, proc_push): Define explicitly, now 1271 that dlist.c is gone. 1272 (read_facility): Move to config.c, changing signature. 1273 (set_handler): Remove. 1274 (dirwatcher_free, dirwatcher_create) 1275 (dirwatcher_destroy, dirwatcher_find_wd) 1276 (dirwatcher_find_name): Remove. See watcher.c 1277 (remove_watcher, subwatcher_create) 1278 (check_new_watcher, watch_subdirs): Move to watcher.c 1279 (get_facility): New function. 1280 (process_event): New function. 1281 (main): Parse configuration file. Use command line options 1282 to override its settings. 1283 * dlist.c: Remove. 1284 * event.c: New file. 1285 * hashtab.c: New file. 1286 * pathdefn.c: New file. 1287 * watcher.c: New file. 1288 12892013-01-17 Sergey Poznyakoff <gray@gnu.org.ua> 1290 1291 Revamp the event and handler system. 1292 1293 Events are directly mapped to those of inotify. Handlers are kept in a 1294 doubly-linked list; a special field keeps the mask of supported events. 1295 The accepted '-p' syntax is changed accordingly. Docs are not yet 1296 updated. 1297 1298 * dircond.c (event): New struct. 1299 (evtab): New global. 1300 (handler) <prev,next,ev_mask>: New members. 1301 (dirwatcher) <handler_list>: New member (instead of the 1302 handler array). 1303 (handler_list,handler_mask): New globals. 1304 (ev_name_to_code,ev_code_to_name): New functions. 1305 (set_handler): Change accepted syntax. The new syntax is 1306 1307 event[,event...][:flag[,flag...]]:pathname 1308 1309 (dirwatcher_create): Use handler_mask instead of the hardcoded 1310 mask. 1311 (dirwatcher_destroy): Free the handler list, if this is a top-level 1312 watcher. 1313 (subwatcher_create): Update to use new variables. 1314 (main): Likewise. 1315 13162013-01-10 Sergey Poznyakoff <gray@gnu.org.ua> 1317 1318 Improve error reporting. 1319 1320 * dircond.c (run_handler,set_handler): Check if the handler can 1321 be executed. 1322 1323 Update documentation 1324 1325 Watch existing subdirectories, as requested by the autowatch option. 1326 1327 * dircond.c (subwatcher_create): New function. 1328 (check_new_watcher): Use subwatcher_create. 1329 (watch_subdirs): New function. 1330 (main): Recursively add directories after watchpoint if autowatch 1331 requests so. 1332 1333 Make autowatch feature watchpoint-specific. 1334 1335 Each particular watchpount can have its own setting of autowatch, as 1336 specified by the -a option. 1337 1338 * dircond.c (dirwatcher) <autowatch>: New member. 1339 (dirwatcher_create): Fill allocated structure with zeroes. 1340 (dirlevel): Remove function. 1341 (check_new_watcher): Use dirwatcher->autowatch to determine 1342 whether to watch the new directory. Inherit autowatch setting. 1343 (main): Set dirwatcher->autowatch. 1344 1345 New flag "timeout=" 1346 1347 * dircond.c (set_handler): The timeout=N flag sets timeout 1348 for that particular handler (equivalent to -T option used 1349 before -p). 1350 * dircond.1: Document the new flag. 1351 13522013-01-09 Sergey Poznyakoff <gray@gnu.org.ua> 1353 1354 Add documentation files. Raise version to 2.0 1355 1356 * .gitignore: Update. 1357 * Makefile: Add NEWS and ChangeLog, generate the latter. 1358 * NEWS: New file. 1359 * git2chg.awk: New file. 1360 1361 Fix help output. 1362 1363 Support multiple per-directory handlers. 1364 1365 * dircond.c (handler) <timeout>: New member. 1366 (dirwatcher) <handler>: New member. 1367 (process) <master>: Remove. 1368 <timeout>: New member. 1369 Fix comments. 1370 (set_handler): Change supported syntax. The program name 1371 is separated from the event spec and optional flags by 1372 a semicolon. It can be empty, allowing to cancel a prior 1373 definition of the same handler. 1374 (register_process): Take timeout as the third argument. 1375 (process_timeouts): Use per-process timeout. 1376 (open_redirector): Fix the use of facility. 1377 (run_handler): Change signature. 1378 (main): Change option handling, allowing to intermix 1379 handler and watchpoint definitions. 1380 * README: Update. 1381 * dircond.1: Update. 1382 * dlist.c: Add copyright header. 1383 1384 Fix a "fencepost" error in close_fds. 1385 1386 * dircond.c (close_fds): Start iterating from max_fd-1. 1387 13882012-12-31 Sergey Poznyakoff <gray@gnu.org.ua> 1389 1390 Minor fixes. 1391 1392 * COPYING: New file. 1393 * Makefile: Distribute COPYING. 1394 * dircond.c (main): tag is now const char *. 1395 1396 Switch to user privileges only if -u option is explicitly given. 1397 1398 Improve documentation. 1399 14002012-12-24 Sergey Poznyakoff <gray@gnu.org.ua> 1401 1402 Add a manpage. 1403 1404 * Makefile: Add a manpage. 1405 * dircond.c (run_handler): Pass event code and 1406 event symbolic name to the handler. 1407 1408 Add support for IN_MOVED_FROM and IN_MOVED_TO. 1409 1410 Initial commit 1411 1412Local Variables: 1413mode: change-log 1414version-control: never 1415buffer-read-only: t 1416End: 1417