path: root/src
AgeCommit message (Collapse)AuthorFiles
2017-01-02Happy GNU YearSergey Poznyakoff35
2014-06-13Bugfixes.Sergey Poznyakoff1
* modules/mailutils/mod_mailutils.c (wy_config): Initialize allocated struct mailevt with 0s. * src/module.c (conf_notification_modules): Avoid coredump if np->modnode == NULL. * grecs: Upgrade. * tests/ Add a unique keyword.
2013-03-13Bugfixes. Add a stub for new module.Sergey Poznyakoff2
* include/wydawca/wydawca.h (WY_EXPORT): Add an internal prefix. That's a stupid lossage: having not found the composed name (modname_LTX_sym), libtool tries to look up sym itself, which makes it impossible to use names like "open", etc. * src/module.c (resolve_sym): Reflect the above. Take an extra argument specifying whether the symbol is mandatory. (modules_load): Configure modules used in default_notification list. * src/config (cb_load_path): New callback to ensure that multiple module-path* statements accumulate. * modules/logstat/mod_logstat.c: New file. * modules/logstat/Makefile: New file. * Build modules/logstat/Makefile. * modules/ (SUBDIRS): Add logstat.
2013-03-12Minor change.Sergey Poznyakoff2
* doc/wydawca.texi: Document the use of -d together with -t. * src/update-2.0.awk: Remove. * src/ Update.
2013-03-12New informative options.Sergey Poznyakoff4
* modules/mailutils/mod_mailutils.c (wy_help): Implement module help. * src/wydawca.c (main): Using -t and -d options together produces a print out of the configuration parse tree. Additional -d option includes source file locations. * src/module.c (module_help): New function. * src/module.h (module_help): New proto.
2013-03-12Namespace normalization (2). Provide installable headers.Sergey Poznyakoff18
* (SUBDIRS): Add include. * Build include/*/Makefile Set-up grecs as a shared convenience library. Install its headers. * include/ New file. * include/wydawca/ New file. * include/wydawca/cfg.h: New file. * include/wydawca/wydawca.h: New file. * modules/mailutils/ (AM_CPPFLAGS): Add include/ * src/ (LDADD): Use @GRECS_LDADD@ (AM_CPPFLAGS): Add include/. * tests/ Likewise. * src/wydawca.h: Include wydawca/wydawca.h. (__cat2__, __cat3__): Move to installable header and rename. (struct wy_user): Move to installable header. (struct file_triplet): Rename to wy_triplet. All uses changed. (enum notification_event): Rename to wy_event and move to installable header. (struct metadef): Rename to wy_metadef and move to installable header. (dry_run_mode): Rename to wy_dry_run and move to installable header. (wydawca_gpg_homedir): Rename to wy_gpg_homedir and move to installable header. (wy_version, wy_debug_level, wy_log_to_stderr) (wy_log_facility, wy_syslog_tag) (wy_log,wy_dbg): Move to installable header. * modules/mailutils/mod_mailutils.c: Update. * src/cmdline.opt * src/config.c * src/directive.c * src/diskio.c * src/event.c * src/gpg.c * src/job.c * src/meta.c * src/module.c * src/null.c * src/timer.c * src/triplet.c * src/verify.c * src/vtab.c * src/watcher.c * src/wydawca.c
2013-03-12Improve triplet API.Sergey Poznyakoff4
* src/wydawca.h (uploader_info): Rename to wy_user. (file_triplet) <uploader_count>: Remove. <admin_list>: New member. (triplet_get_uploaders,triplet_get_uploader) (triplet_get_admins): New protos. * src/triplet.c (wy_user_create) (wy_userlist_free): New static functions. (hash_triplet_free): Use wy_userlist_free. (triplet_get_uploaders,triplet_get_uploader) (triplet_get_admins): New functions. * src/verify.c (verify_directive_file): Rewrite using triplet_get_uploaders. * src/gpg.c (verify_directive_signature): Call triplet_get_uploaders to initialize the uploaders list. * modules/mailutils/mod_mailutils.c (get_recipient): Remove. (get_owner_address): New function. All callers updated. Remove useless const qualifiers.
2013-03-12Enable notification tests conditionally.Sergey Poznyakoff1
The tests are enabled only if the mailutils module is built. * (WD_MAILUTILS): New subst variable. * tests/ (WD_MAILUTILS): New variable. * tests/ (AT_MAILUTILS_PREREQ): New macro. * tests/ Skip the test if mailutils is not configured. * tests/ Likewise. * tests/ Likewise. * modules/mailutils/mod_mailutils.c (get_uploader_email): Simplify the signature. (expand_email_admin,expand_email_owner): Make static. * src/wydawca.h (expand_email_admin,expand_email_owner): Remove protos.
2013-03-11Follow up to 87602f54.Sergey Poznyakoff3
Fix minor bugs. Update the testsuite. All tests pass now. * modules/mailutils/mod_mailutils.c (cb_statistics): Remove. Use wy_cb_statistics. (expand_email_admin, expand_email_owner): Add missing functions. * src/config.c (wy_cb_statistics): New function. (wydawca_kw): Restore "statistics" statement. * src/dictionary.c (dictionary_lookup): Fix debug levels. * src/wydawca.h (wy_cb_statistics): New proto. * tests/ (wydawca_expandmeta): Expand @WD_MODDIR@ * tests/ Create notify.rc from notify.rcin * tests/ Likewise. * tests/ Likewise. * tests/ Fix the expected output. * tests/etc/mailstats.rc: Rename to tests/etc/mailstats.rcin. * tests/etc/notify.rc: Rename to tests/etc/notify.rcin. * tests/etc/ Update. * tests/etc/wydawca.rcin: Update to the new syntax.
2013-03-11Namespace normalization (1).Sergey Poznyakoff4
syslog_tag -> wy_syslog_tag log_facility -> wy_log_facility log_to_stderr -> wy_log_to_stderr
2013-03-10Put back admin and owner address expansions.Sergey Poznyakoff3
* src/meta.c (metadef_join): New function. * src/triplet.c (triplet_expand_param): Extra argument supplies an additional metadef to use together with triplet_meta. * src/wydawca.h (triplet_expand_param): Change signature. * modules/mailutils/mod_mailutils.c (t_notify): Provide extra metadef for admin and owner addresses.
2013-03-10Provide a convenient debugging macro.Sergey Poznyakoff20
Rename logmsg to wy_log.
2013-03-10Replace mail notification with module event notification framework.Sergey Poznyakoff22
The new framework is to be general-purpose; the mail notification is implemented as a module. Althoug the program is operational, the change is not completed yet. In particular, the docs are out of date and the tests will mostly fail. * .gitignore: Update. * (SUBDIRS): Add modules. * Mailutils is now optional (though highly recommended). (AC_CONFIG_FILES): Build modules/Makefile and modules/mailutils/Makefile. * modules/ New file. * modules/mailutils/ New file. * modules/mailutils/mod_mailutils.c: New file. * src/mail.c: Remove. * src/mail.h: Remove. * src/event.c: New file. * src/ (wydawca_SOURCES): Update. (LDADD): Remove MAILUTILS_LIBS. * src/config.c: Remove mail-related configuration statements. Add module-related ones instead. * src/wydawca.h (notification_event) <ev_statistics>: New event. (notification_target): Remove. (notification) <tgt,sign_keys,msg>: Remove. <statmask>: New member. (register_message_template): Remove. (notify_stats,notify_flush): New protos. (notification_target_str): Remove. (format_fn): Remove. (module) <next,modinit,open> <flush,close>: New members. <notify>: Change signature. (modules_close, module_set_init) (module_flush): New protos. (debug_level): Rename to wy_debug_level. All uses changed. (wy_version): New extern. (admin_stat_message,admin_stat_sign_key): Remove. (default_notification): New global. (triplet_expand_param,triplet_expand_dictionary_query): The file_triplet argument is const pointer. (assert_string_arg): Rename to wy_assert_string_arg. * src/wydawca.c (debug_level): Rename to wy_debug_level. (wy_version): New global. (logstats): Call notify_stats. (main): Call modules_close. * src/module.c: Keep modules in a singly-linked list instead of a symtab. Provide new functions. * src/net.c: Update. * src/dictionary.c: Update. * src/directive.c: Update. * src/diskio.c: Update. * src/exec.c: Update. * src/gpg.c: Update. * src/job.c (wydawca_scanner): Call notify_flush. * src/null.c: Update. * src/process.c: Update. * src/sql.c: Update. * src/tcpwrap.c: Update. * src/triplet.c: Update. * src/verify.c: Update. * src/watcher.c: Update.
2013-03-06Replace mu_url_t with a custom URL.Sergey Poznyakoff9
2013-02-26Introduce loadable modules.Sergey Poznyakoff7
* .gitignore: Update. * Require libtool Require Grecs tree-api. * Incorporate libtool * bootstrap: Create m4 if it does not exist. * doc/ Use texi2html * grecs: Upgrade * src/module.c: New file. * src/ (wydawca_SOURCES): Add module.c * src/config.c: Switch callbacks to tree-api. Add statements for working with modules: module-load-path, module-prepend-load-path and module in the global scope and module and module-config in notify-event blocks. * src/mail.c (do_notify): Call module_notify if a module is configured. * src/tcpwrap.c: Switch callbacks to tree-api. * src/wydawca.c (main): Load modules. * src/wydawca.h (notification) <modname> <modcfg,modnode>: New members. (module): New struct. (cb_module,modules_load,module_notify): New functions. (module_load_path) (module_prepend_load_path): New globals.
2013-02-04Avoid reusing already freed data.Sergey Poznyakoff1
* src/job.c (procspool): Take a pointer to the triplet pointer as a closure data. Return immediately if it is NULL. (wydawca_scanner): Pass a pointer in the second argument in call to for_each_spool.
2013-01-01Avoid processing same triplet twice.release-2.2Sergey Poznyakoff6
* src/wydawca.h (file_triplet) <jq_prev,jq_next,job>: New members. (spool_commit_triplets,schedule_job): Update signature. (count_processable_triplets): Remove. (link_processable_triplets): New proto. (remove_triplet): New proto. (triplet_jq_unlink): New proto. * src/job.c (job) <triplet_list>: New member. (triplet_jq_unlink,jq_clear): New functions. (procspool): Create and stop spool timers. (wydawca_scanner): Call spool_create_timers. (schedule_job): Additional argument specifies triplets to process. Initialize job->triplet_list; (job_queue_runner): Call jq_clear. * src/net.c (handle_connection): Update call to schedule_job. * src/process.c (spool_cwd_add_new_file): Update call to spool_commit_triplets. * src/triplet.c (remove_triplet): Now extern. Takes two args. All uses updated. (spool_commit_triplets): Additional argument specifies triplets to process. (count_processable_triplets): Remove. (link_processable_triplets): New function. * src/watcher.c: Use link_processable_triplets to obtain a doubly-linked list of triplets to process. Pass it to schedule_job.
2013-01-01Minor changes.Sergey Poznyakoff6
2013-01-01Update copyright years. Switch to a familiar style.Sergey Poznyakoff35
2012-12-30Check returns from pipe, dup2 and chmod. Don't use obsolete MU functions.Sergey Poznyakoff5
2012-12-29Remove unnecessary virtual function.Sergey Poznyakoff3
The source_dir of a spool always refers to a directory on a file system, so the get_path method is unnecessary and is removed.
2012-12-29Use AM_CPPFLAGS instead of the INCLUDES in Makefiles.Sergey Poznyakoff1
2012-12-24Improve triplet queue handling.Sergey Poznyakoff5
Remove the expired and invalid triplets in the master process. * src/job.c (job_queue_runner): Take estimated minimal interval as an argument. Set timer even if no wake-up is scheduled. * src/net.c: Call triplet_sweep to sweep off expired triplets and estimate minimal timeout for job_queue_runner. * src/triplet.c: Link all registered triplets into a doubly- linked list ordered by the triplet age, in descending order. Use that list to estimate minimal timeout. (triplet_list): New variable. (triplet_timestamp, triplet_ttl) (triplet_list_unlink,triplet_list_insert_before) (triplet_list_ordered_insert): New static functions. (register_file): Insert triplet into the list. (triplet_expired_p): Take one argument. Obtain the ttl from the associated spool. Fix condition. (remove_triplet): Remove triplet from the list and symtab. (triplet_sweep): New function. (triplet_counter): Remove bad and expired triplets. (triplet_remove_file): Call remove_triplet. * src/wydawca.h (file_triplet) <next,prev>: New members. (triplet_sweep): New proto. (job_queue_runner): Change signature.
2012-12-22Fix memory leaks, provide config statements for disabling inotify.Sergey Poznyakoff8
* src/config.c: New statement "inotify" (global and spool-specific). * src/gpg.c (gpg_verify_signature): Free key when no longer needed. (verify_directive_signature): Fix memory leak. * src/job.c (job_queue_runner): Free the unlinked job. * src/triplet.c (triplet_lookup): Free * src/verify.c (fill_project_name): Return immediately if trp->blurb is not null. * src/watcher.c (create_watcher): Ignore spool if its inotify_enable is false. (watcher_init): Return immediately if inotify_enable is false. * src/wydawca.c (inotify_enable): New global. * src/wydawca.h: Likewise.
2012-12-22Implement inotify support.Sergey Poznyakoff11
* New option --with-inotify. Bye default, use inotify if it is present. * src/watcher.c: New file. Implements inotify watcher. * src/ [COND_INOTIFY] (wydawca_SOURCES): Add watcher.c * src/diskio.c (dir_get_path): New function. * src/job.c (job) <spool>: Remove const qualifier. All uses changed. (inotify_spool): New pseudo-spool. (fake_spool): Remove static qualifier. (wydawca_scanner): Support for inotify spools. * src/net.c (open_listener): Don't exit if the listener address is not set. (wydawca_listener): Listen on the listener socket and on the inotify descriptor. If none is set, bail out. * src/process.c (for_each_spool) (file_info_cleanup) (spool_cwd_add_new_file,spool_add_new_file): New functions. (scan_spool_unlocked): Use spool_cwd_add_new_file. Don't initialize dictionaries here: it will be done in spool_commit_triplets. (spool_open_dictionaries): New function. (close_dictionaries): Rename to spool_close_dictionaries. Clear dict_inited. * src/triplet.c (hash_triplet_compare): Compare spools as well. (register_file): Likewise. (triplet_lookup): New function. (check_triplet_state): New argument: noauth. All uses updated. (enumerate_triplets): Rename to spool_commit_triplets. Call spool_open_dictionaries. (count_processable_triplets,triplet_remove_file): New functions. * src/verify.c (verify_directive_file): New argument: noauth. All uses updated. * src/vtab.c (reg): Initialize get_path member. (get_path): New function. * src/wydawca.c (main): Set print_version_hook. * src/wydawca.h (virt_tab) <get_path>: New method. (spool) <dict_inited>: New member. (fake_spool, inotify_spool): New externs. (spool_add_new_file, spool_cwd_add_new_file) (spool_open_dictionaries, spool_close_dictionaries) (for_each_spool, count_processable_triplets) (triplet_remove_file, get_path): New protos. (enumerate_triplets): Rename to spool_commit_triplets. (verify_directive_file): Take two arguments.
2012-05-27Implement upload directives version 1.2Sergey Poznyakoff8
* NEWS: Update. * README: Update. * doc/wydawca.texi: Document changes. * src/cmdline.opt: Update copyright years. * src/config.c: Update for new grecs version. New keywords: min-version and max-version. * src/directive.c (directive_unpack_version): New function. (directive_version_in_range_p): Set trp->version and print it. (directive) <replace_dir>: New directive. (directive_table): New directive "replace". (verify_directive_format): Use globals min_directive_version and max_directive_version. (process_directives): Handle replace_dir * src/diskio.c (dir_move_file): Use the "replace" directive to act on existing files. * src/wydawca.c (min_directive_version) (max_directive_version): New globals. (main): Loosen gpgme requirement: version 1.1.0 is Ok. * src/wydawca.h (MAX_DIRECTIVE_VERSION): Set to 102 (file_triplet) <version>: New member. (min_directive_version) (max_directive_version): New globals. (directive_unpack_version): New proto. * tests/ New file. * tests/ New file. * tests/ New file. * tests/ (TESTSUITE_AT): Add new files. * tests/ (wydawca_upload): Change invocation. All uses updated. (wydawca_cmparc): New function. * tests/ Update. * tests/ Update. * tests/ Update. * tests/dist/file12f.directive.asc: New file. * tests/dist/file12t.directive.asc: New file. * tests/etc/wydawca.rcin (test): Define "archive" clause. * tests/ Update. * tests/ Update. * tests/ Include new files. * tests/ Update. * tests/ Update.
2012-04-23Bugfixes.Sergey Poznyakoff1
* Use AC_SYS_LARGEFILE. * grecs: Upgrade. * src/wydawca.c (main): Check GPGME version.
2011-07-05Update for MU 5e1d982e.Sergey Poznyakoff1
2011-06-27Update grecs.Sergey Poznyakoff2
2011-06-23Bugfixes.Sergey Poznyakoff2
* grecs: Update. * src/config.c (config_help): Use grecs_print_* functions. * src/diskio.c (copy_file): Fix diagnostic message. * tests/ Forgotten to commit :(
2011-05-13Minor change.Sergey Poznyakoff2
* src/wydawca.c: Setup MU streams properly.
2011-05-13Update copyright yearsSergey Poznyakoff34
2011-05-13Drop gnulib.Sergey Poznyakoff21
* bootstrap: Rewrite. * bootstrap.conf: Remove. * Remove gl_EARLY/gl_INIT * src/backup.c: New file. * src/txtacc.c (txtacc_finish): Make sure a new entry is appended only once to the list. * (all sources): Use grecs memory allocation functions. * src/wydawca.h" Include fnmatch.h and regex.h (backup_type): New enum. (simple_backup_suffix): New extern. (find_backup_file_name): New proto. * tests/bkupname.c: New file. * tests/ New file. * tests/ New file. * tests/ New file. * tests/ New file. * tests/ Add new tests. * tests/ Add new tests. * grecs: Update.
2011-05-11Improve the txtacc interface.Sergey Poznyakoff10
2011-05-11Remove obstack.Sergey Poznyakoff12
* src/txtacc.c: New file. * gnulib.modules: Remove obstack. * src/wydawca.h (txtacc_create, txtacc_free) (txtacc_free_string, txtacc_grow) (txtacc_finish): New functions. (txtacc_1grow): New macro.
2011-05-10Remove save-cwd.Sergey Poznyakoff6
* src/pushd.c: New file. * src/ Add pushd.c * src/wydawca.h (push_dir, pop_dir): New functions. * src/diskio.c: Use push_dir/pop_dir. * src/exec.c: Likewise. * src/gpg.c: Likewise. * gnulib.modules: Remove save-cwd. * tests/pushck.c: New file. * tests/ New file. * tests/ Add * tests/ Likewise. * tests/.gitignore: Add pushck.
2011-05-10Drop dependencies on argmatch and xgethostname.Sergey Poznyakoff2
2011-05-10Remove c-ctype module.Sergey Poznyakoff2
2011-05-10Remove progname module.Sergey Poznyakoff2
2011-05-10Remove inttostr module.Sergey Poznyakoff2
2011-05-10Remove vasprintf module.Sergey Poznyakoff4
2011-05-10Update grecs.Sergey Poznyakoff13
* (ChangeLog): Use git2chg.awk. * bootstrap.conf (gnulib_modules): Don't access grecs/gnulib.modules. * (GRECS_SETUP): Add options. * gnulib.modules (getopt,gitlog-to-changelog) (hash,error,version-etc): Remove. * src/ Remove getopt.m4, use one from grecs. * src/getopt.m4: Remove. * src/cmdline.opt: Rewrite. * src/config.c: Update. * src/wydawca.h (spool) <aliases>: Change data type. (all_spool_aliases): Change data type. (config_finish): New proto. * src/wydawca.c: Use grecs functions. * src/dictionary.c: Likewise. * src/net.c: Likewise. * src/process.c: Likewise. * src/mail.c: Use grecs_symtab. * src/timer.c: Likewise. * src/triplet.c: Likewise.
2010-12-28Switch to Mailutils 3.xSergey Poznyakoff2
2010-01-06Improve SQL configuration.Sergey Poznyakoff3
* src/config.c (sql_kw): New statements: config-file and config-group. * src/sql.c (sql_init_dictionary): Handle config-file and config-group. Set CLIENT_MULTI_RESULTS option. * src/sql.h (struct sqlconn): New members: config_file and config_group. * NEWS, doc/wydawca.texi: Update.
2010-01-03Improve memory management and optimize function signatures.Sergey Poznyakoff7
* src/wydawca.h (file_triplet): New members: relative_dir, obstk. (virt_tab): Remove spool and reldir from argument lists. (triplet_strdup): New prototype. (move_file, archive_file, symlink_file) (rmsymlink_file, dir_move_file, dir_archive_file) (dir_symlink_file, dir_rmsymlink_file) (null_move_file, null_archive_file) (null_symlink_file, null_rmsymlink_file): Remove spool and reldir from argument lists. * src/directive.c (run_check_script): Use trp->obstk to store the program output. (process_directives): Update calls to vtab interfaces. * src/diskio.c (dir_move_file) (dir_archive_file, dir_symlink_file) (dir_rmsymlink_file): Remove spool and reldir arguments. Use the corresponding members of the struct file_triplet. * src/null.c (null_move_file, null_archive_file) (null_symlink_file, null_rmsymlink_file): Likewise. * src/vtab.c (move_file, archive_file) (symlink_file, rmsymlink_file): Likewise. * src/triplet.c (hash_triplet_free): Free obstack and uploader_list. (triplet_strdup): New function. (register_file): Initialize trp->obstck. (fill_project_name): Fill relative_dir as well. (verify_directive_file): Use triplet_strdup to keep string values.
2010-01-03Do not pass spool as a separate parameter, register it early in the triplet.Sergey Poznyakoff7
* src/directive.c (process_directives): Remove spool parameter. * src/gpg.c (verify_directive_signature) (verify_detached_signature): Remove spool parameter. * src/process.c (scan_spool_unlocked): Update call to register_file. * src/triplet.c (register_file): Take spool ptr as second argument. (triplet_processor): Ignore proc_data. (enumerate_triplets): Pass NULL as proc_data. * src/verify.c (verify_directive_file): Remove spool parameter. * src/wydawca.h (ASGN_SPOOL): New macro. (register_file, verify_directive_file) (verify_directive_signature, verify_detached_signature) (process_directives): Remove spool parameter. * src/getopt.m4 (print_help): Minor fix.
2010-01-02Minor fixesSergey Poznyakoff1
* src/wydawca.c (stat_kwname): New keyword stat:check-failures. * doc/wydawca.texi: Document stat:check-failures counter * tests/, tests/ Update.
2010-01-02Bugfixes.Sergey Poznyakoff1
* src/directive.c (run_check_script): Close stdin. Call shell as "sh".
2010-01-02New email-related meta-variables.Sergey Poznyakoff3
These variables make it possible to avoid setting `recipient' statement in `notify' blocks, instead specifying recipients directly in the message headers and using the default recipient setting, which is `read'. * src/mail.c (expand_email_admin) (expand_email_owner): New functions. * src/triplet.c (triplet_processor): Remove the triplet if process_directives returns !0. (expand_email_user): New function. (triplet_meta): New keywords email:user (not to be confused with user:email), email:admin and email:owner. * src/wydawca.h (expand_email_admin) (expand_email_owner): New functions. * NEWS, doc/wydawca.texi: Updated.
2010-01-02$- construct (similar to m4's dnl).Sergey Poznyakoff2
* src/meta.c: Special construct $- removes the character immediately following it. * doc/wydawca.texi: Document the use of $- construct. * src/triplet.c (expand_triplet_ls_full) (expand_triplet_ls_upload): Keep trailing newline in the expansion. * tests/etc/notify.rc: Update.

Return to:

Send suggestions and report system problems to the System administrator.