*** gnats/ChangeLog Fri Dec 12 21:14:49 1997 --- gnats/ChangeLog Fri Dec 12 21:26:19 1997 *************** *** 1,3 **** --- 1,20 ---- + Fri Sep 26 16:00:00 1997 Abe Feldman + + * file-pr.c: Changed log messages and "punt" function call + to mention default category + * gnats.texi: added references to default category + * p-admin.text: added description of how to set a default category + + Sun Sep 21 21:20:00 1997 Abe Feldman + + * config.c.in: Added call to CN_OPT to create default_category + variable, to be read in from config file + * gnats.h: added extern char *default_category + * file-pr.c: (gnats) Changed from hard-coded "pending" default + category to default_category variable + * pr.c: Changed default value of category entry in PR data structure + from PENDING constant to default_category variable string + Sun Dec 7 20:33:20 1997 Karl Fogel * file-pr.c (check_if_reply): don't file if category in Subject *** gnats/config.c.in Fri Dec 12 21:11:01 1997 --- gnats/config.c.in Fri Dec 12 21:25:38 1997 *************** *** 47,52 **** --- 47,54 ---- CN_OPT(bweek_end, BWEEK_END, int) CN_OPT(mail_agent, MAIL_AGENT, char[], STR_MAX) CN_OPT(bindir, BINDIR, char[], STR_MAX) + #define DEFAULT_CATEGORY "pending" + CN_OPT(default_category, DEFAULT_CATEGORY, char[], STR_MAX) struct conf { *** gnats/file-pr.c Fri Dec 12 21:14:49 1997 --- gnats/file-pr.c Fri Dec 12 21:25:38 1997 *************** *** 49,54 **** --- 49,55 ---- char *site, *bug_group; char *subject = NULL, *synopsis = NULL; char *p; + char message[STR_MAX]; mode_t mode; struct stat sbuf; *************** *** 84,98 **** bug_group = field_value (CATEGORY); if (find_category (&category, bug_group) == -1) { ! log_msg (LOG_INFO, 1, "resetting bug category to pending from:", ! bug_group); ! bug_group = PENDING; ! set_field (CATEGORY, PENDING); ! /* Again, but with `pending' now. If it's not there, kick this to the GNATS_ADMIN. */ if (find_category (&category, bug_group) == -1) ! punt (1, "No `pending' directory under gnats-root (%s).", gnats_root); } /* Set responsible field, adding full name as well (if found). If it's --- 85,100 ---- bug_group = field_value (CATEGORY); if (find_category (&category, bug_group) == -1) { ! sprintf (message, "%s from: %s\n", default_category, bug_group); ! log_msg (LOG_INFO, 1, "resetting bug category to ", message); ! bug_group = default_category; ! set_field (CATEGORY, default_category); ! /* Again, but with default now. If it's not there, kick this to the GNATS_ADMIN. */ if (find_category (&category, bug_group) == -1) ! punt (1, "No `%s' directory under gnats-root (%s).", ! default_category, gnats_root); } /* Set responsible field, adding full name as well (if found). If it's *************** *** 184,217 **** expired = get_response_time (submitter.rtime); /* Put together the path to where the bug will be stored. If the dir ! is not there, and the category is PENDING, auto-create that one, if we want to. If not, make the bug pending, and store in there. */ sprintf (path, "%s/%s", gnats_root, bug_group); err = stat (path, &sbuf); if (err == -1 && !flag_autocreate) { ! bug_group = PENDING; ! set_field (CATEGORY, PENDING); ! log_msg (LOG_INFO, 1, "directory does not exist, changing to pending:", path); sprintf (path, "%s/%s", gnats_root, bug_group); err = stat (path, &sbuf); } ! /* Check ERR again, to see if pending was there. */ if (err == -1) { ! if (strcmp (bug_group, PENDING) == 0) { ! log_msg (LOG_INFO, 0, "pending does not exist, creating..."); #ifdef S_IRWXU mode = S_IRWXU | S_IRGRP | S_IXGRP; #else mode = 0750; #endif if (mkdir (path, mode) == -1) ! punt (1, "Can't create `pending' directory under gnats_root (%s).", ! gnats_root); } else if (flag_autocreate) { --- 186,220 ---- expired = get_response_time (submitter.rtime); /* Put together the path to where the bug will be stored. If the dir ! is not there, and the category is the default, auto-create that one, if we want to. If not, make the bug pending, and store in there. */ sprintf (path, "%s/%s", gnats_root, bug_group); err = stat (path, &sbuf); if (err == -1 && !flag_autocreate) { ! bug_group = default_category; ! set_field (CATEGORY, default_category); ! log_msg (LOG_INFO, 1, "directory does not exist, changing to default:", path); sprintf (path, "%s/%s", gnats_root, bug_group); err = stat (path, &sbuf); } ! /* Check ERR again, to see if default category was there. */ if (err == -1) { ! if (strcmp (bug_group, default_category) == 0) { ! log_msg (LOG_INFO, 1, default_category, ! " does not exist, creating..."); #ifdef S_IRWXU mode = S_IRWXU | S_IRGRP | S_IXGRP; #else mode = 0750; #endif if (mkdir (path, mode) == -1) ! punt (1, "Can't create `%s' directory under gnats_root (%s).", ! default_category, gnats_root); } else if (flag_autocreate) { *************** *** 244,250 **** log_msg (LOG_INFO, 1, "PR written out:", path); /* Add a line into the index for use by query-pr. */ ! /* This should be done regardless of whether the bug is pending or not. */ add_to_index (); /* If it fell into pending, don't send all of the mail for it, don't create --- 247,253 ---- log_msg (LOG_INFO, 1, "PR written out:", path); /* Add a line into the index for use by query-pr. */ ! /* This should be done regardless of whether the bug is default or not. */ add_to_index (); /* If it fell into pending, don't send all of the mail for it, don't create *** gnats/gnats.h Fri Dec 12 21:11:01 1997 --- gnats/gnats.h Fri Dec 12 21:25:38 1997 *************** *** 162,167 **** --- 162,170 ---- /* The definition of GNATS_USER as generated for config.c. */ extern char *gnats_user; + /* The default category, read from the config file. */ + extern char *default_category; + /* Possible values for the logging mode. Note "syslog" will only be used if the system supports it---otherwise it will relegate to "mail". */ typedef enum *** gnats/gnats.texi Fri Dec 12 21:11:02 1997 --- gnats/gnats.texi Fri Dec 12 21:25:38 1997 *************** *** 223,229 **** @cindex @code{pending} directory @cindex unparseable incoming PRs @cindex incoming PRs that @sc{gnats} cannot parse ! @sc{gnats} does not have the ability to decipher random text, so any problem reports which arrive in a format @sc{gnats} does not recognize are placed in a separate directory pending investigation by the @sc{gnats} administrator (@pxref{Management,,@sc{gnats} Administration}). --- 223,230 ---- @cindex @code{pending} directory @cindex unparseable incoming PRs @cindex incoming PRs that @sc{gnats} cannot parse ! @sc{gnats} does not have the ability to decipher random text. ! If there is no default category set, any problem reports which arrive in a format @sc{gnats} does not recognize are placed in a separate directory pending investigation by the @sc{gnats} administrator (@pxref{Management,,@sc{gnats} Administration}). *************** *** 618,626 **** Incoming Problem Reports are queued here until the next iteration of @w{@samp{queue-pr -r}} (@pxref{queue-pr,,Handling incoming traffic}). @item pending ! Problem Reports which arrive without a valid category value are reassigned to the category @samp{pending} and placed here pending ! intervention by the @sc{gnats} administrator. @xref{Management,,@sc{gnats} administration}. @item @var{category} Each valid category has a corresponding subdirectory in the database. --- 619,628 ---- Incoming Problem Reports are queued here until the next iteration of @w{@samp{queue-pr -r}} (@pxref{queue-pr,,Handling incoming traffic}). @item pending ! If no default category is set, problem reports without a category are reassigned to the category @samp{pending} and placed here pending ! intervention by the @sc{gnats} administrator. In this case, the submitter ! will not receive an automated reply. @xref{Management,,@sc{gnats} administration}. @item @var{category} Each valid category has a corresponding subdirectory in the database. *** gnats/p-admin.texi Fri Dec 12 21:11:02 1997 --- gnats/p-admin.texi Fri Dec 12 21:28:39 1997 *************** *** 211,216 **** --- 211,220 ---- @item The values which define business hours. + + @item + A default category for problem reports which come in without a category. + @end itemize @cindex @code{categories} file *************** *** 485,490 **** --- 489,506 ---- Defines the ending day of the business week. @var{integer} values must fall between @samp{0} (Sunday) and @samp{6} (Saturday). The default is @samp{5} (Friday). + + @cindex default category + @item DEFINE_CATEGORY="category" + Defines the category where problem reports are placed when they come in + without a category. The category you choose must be listed in the + @code{categories} file. + + This line does not appear in the @code{config} file when you install + @sc{gnats}, so you must add it to the @code{config} file if you want to set a + default category. If there is no default category listed, problem reports + will be put into the "pending" category. + @end table @end table *************** *** 1058,1070 **** If the @samp{>Category:} field does not contain a valid category value (i.e., matching a line in the @code{categories} file; ! @pxref{categories,,The @code{categories} file}), the PR is given a @samp{>Category:} value of @samp{pending} and is placed in the @file{pending} directory. The @sc{gnats} administrator is notified of the unplaceable PR. @code{file-pr} assigns the Problem Report an identification number, ! files it in the @sc{gnats} database (under @w{@samp{pending}}, if the @samp{>Category:} field contains an invalid category), and sends acknowledgements to appropriate parties. The person responsible for that category of problem (@pxref{categories,,The @code{categories} --- 1074,1088 ---- If the @samp{>Category:} field does not contain a valid category value (i.e., matching a line in the @code{categories} file; ! @pxref{categories,,The @code{categories} file}), the PR is assigned to ! the default category, as set in the @code{config} file. If there is no ! default category defined, the PR is given a @samp{>Category:} value of @samp{pending} and is placed in the @file{pending} directory. The @sc{gnats} administrator is notified of the unplaceable PR. @code{file-pr} assigns the Problem Report an identification number, ! files it in the @sc{gnats} database (under the default, if the @samp{>Category:} field contains an invalid category), and sends acknowledgements to appropriate parties. The person responsible for that category of problem (@pxref{categories,,The @code{categories} *** gnats/pr.c Fri Dec 12 21:11:02 1997 --- gnats/pr.c Fri Dec 12 21:25:38 1997 *************** *** 310,316 **** pr[PRIORITY].datatype = Enum; pr[CATEGORY].name = CATEGORY_STRING; ! pr[CATEGORY].default_value = PENDING; pr[CATEGORY].datatype = Text; /* really enum, matching category file */ #ifdef GNATS_RELEASE_BASED --- 310,316 ---- pr[PRIORITY].datatype = Enum; pr[CATEGORY].name = CATEGORY_STRING; ! pr[CATEGORY].default_value = default_category; pr[CATEGORY].datatype = Text; /* really enum, matching category file */ #ifdef GNATS_RELEASE_BASED