diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2009-12-22 02:06:55 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2009-12-22 02:06:55 +0200 |
commit | 6f49d439216e3067d3f2994221edb8ea16e2c74e (patch) | |
tree | 515173740b95a06faee97f11c0b14270c7c26ea5 /src | |
parent | b200591a7a85ddb90169b1791355af25b009fa1a (diff) | |
download | wydawca-6f49d439216e3067d3f2994221edb8ea16e2c74e.tar.gz wydawca-6f49d439216e3067d3f2994221edb8ea16e2c74e.tar.bz2 |
Fix documentation + minor changes.
* bootstrap.conf: Unconditionally update submodules.
* configure.ac: Fix wording of an error message.
* doc/Makefile.am (check-config)
(check-sub-config): Fix regexps.
* doc/wydawca.texi: Update.
* src/cmdline.opt (selected_spools): New function,
* src/config.c (spool_kw): Move "archive-signatures" to
wydawca_kw.
* src/wydawca.c (main): selected_spools implies
cron_option.
* src/wydawca.h (selected_spools): New proto.
Diffstat (limited to 'src')
-rw-r--r-- | src/cmdline.opt | 8 | ||||
-rw-r--r-- | src/config.c | 5 | ||||
-rw-r--r-- | src/job.c | 4 | ||||
-rw-r--r-- | src/wydawca.c | 2 | ||||
-rw-r--r-- | src/wydawca.h | 1 |
5 files changed, 14 insertions, 6 deletions
diff --git a/src/cmdline.opt b/src/cmdline.opt index 3515072..116c3e5 100644 --- a/src/cmdline.opt +++ b/src/cmdline.opt @@ -24,12 +24,18 @@ static bool string_eq (const void *elt1, const void *elt2) { return strcmp ((const char *)elt1, (const char *)elt2) == 0; } int +selected_spools () +{ + return (source_list != NULL || tag_list != NULL); +} + +int enabled_spool_p (const struct spool *spool) { if (source_list || tag_list) return (source_list && gl_list_search (source_list, spool->source_dir)) || (tag_list && gl_list_search (tag_list, spool->tag)); return 1; @@ -92,13 +98,13 @@ OPTION(config-file,c,FILE, [<use FILE instead of the default configuration>]) BEGIN conffile = optarg; END OPTION(spool,S,TAG, - [<process only spool with the given tag>]) + [<process only spool with the given tag (may be used multiple times)>]) BEGIN if (!tag_list) tag_list = gl_list_create_empty (&gl_linked_list_implementation, string_eq, NULL, NULL, false); gl_list_add_last (tag_list, optarg); diff --git a/src/config.c b/src/config.c index 15c191c..c3b2e22 100644 --- a/src/config.c +++ b/src/config.c @@ -1174,14 +1174,12 @@ static struct grecs_keyword spool_kw[] = { { "dictionary", N_("ident"), N_("Define data dictionary"), grecs_type_section, NULL, offsetof(struct spool, dictionary), cb_dictionary, NULL, dictionary_kw }, { "archive", N_("type: string"), N_("Set up archivation"), grecs_type_section, NULL, offsetof(struct spool, archive), cb_archive, NULL, archive_kw }, - { "archive-signatures", NULL, N_("Control implicit signature archivation"), - grecs_type_bool, &archive_signatures }, { "notify-event", NULL, N_("Configure notification"), grecs_type_section, NULL, offsetof(struct spool, notification), cb_notify_event, NULL, notify_event_kw }, { NULL } }; @@ -1425,12 +1423,15 @@ static struct grecs_keyword wydawca_kw[] = { { "tar-program", N_("prog"), N_("Set tar invocation command line"), grecs_type_string, &tar_command_name, 0, cb_absolute_name }, { "umask", N_("mask: octal"), N_("Set umask"), grecs_type_string, NULL, 0, cb_set_umask }, + { "archive-signatures", NULL, N_("Control implicit signature archivation"), + grecs_type_bool, &archive_signatures }, + { "statistics", N_("items"), N_("Print these stats at the end of run"), grecs_type_string, &print_stats, 0, cb_statistics }, { "sql", N_("id: string"), N_("Define SQL database"), grecs_type_section, NULL, 0, cb_sql, NULL, sql_kw }, @@ -83,14 +83,14 @@ wydawca_scanner (struct job *job) initstats(); timer_start ("wydawca"); if (job->spool == &fake_spool) rc = scan_all_spools (1, &job->uid); else { - spool_create_timers (); - rc = scan_spool (job->spool, 1, &job->uid); + spool_create_timers (); + rc = scan_spool (job->spool, 1, &job->uid); } timer_stop ("wydawca"); logstats (); mail_finish (); return rc; } diff --git a/src/wydawca.c b/src/wydawca.c index f098bb1..e5b66d4 100644 --- a/src/wydawca.c +++ b/src/wydawca.c @@ -315,13 +315,13 @@ main (int argc, char **argv) if (grecs_parse (conffile)) exit (EX_CONFIG); if (lint_mode) exit (0); - if (dry_run_mode) + if (dry_run_mode || selected_spools ()) cron_option = 1; if (cron_option) daemon_mode = 0; if (foreground_option >= 0) foreground = foreground_option; if (single_process_option >= 0) diff --git a/src/wydawca.h b/src/wydawca.h index d9933d6..4dbe6c6 100644 --- a/src/wydawca.h +++ b/src/wydawca.h @@ -441,12 +441,13 @@ int directive_first (struct file_triplet *trp, int directive_next (struct file_triplet *trp, int n, const char **pkey, const char **pval); int process_directives (struct file_triplet *trp, const struct spool *spool); int enabled_spool_p (const struct spool *spool); +int selected_spools (void); int parse_time_interval (const char *str, time_t *pint, const char **endp); |