summaryrefslogtreecommitdiffabout
authorSergey Poznyakoff <gray@gnu.org.ua>2009-03-05 13:50:00 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2009-03-05 13:50:00 (GMT)
commitb597bbb6893be07010e286f6a6195ed3c323a16b (patch) (side-by-side diff)
tree3c14dfa7942f3d2709e96874473dbbd909154a89
parent47576447626ac40b61f978836ccb5becbd2b9091 (diff)
parent5fc738e4d43eb708428c4b30e60e570e2dd55470 (diff)
downloadwydawca-b597bbb6893be07010e286f6a6195ed3c323a16b.tar.gz
wydawca-b597bbb6893be07010e286f6a6195ed3c323a16b.tar.bz2
Merge branch 'master' of ssh://git.gnu.org.ua/gitroot/wydawca
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--doc/Makefile.am23
-rw-r--r--doc/fdl.texi82
-rw-r--r--doc/rendition.texi6
-rw-r--r--doc/wydawca.texi1031
-rw-r--r--src/config.c54
-rw-r--r--src/mail.c8
-rw-r--r--src/meta.c48
-rw-r--r--src/triplet.c34
-rw-r--r--src/verify.c29
-rw-r--r--src/wydawca.h10
10 files changed, 731 insertions, 594 deletions
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 0ef1e64..f53e47c 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -41,12 +41,20 @@ manual:
$(GENDOCS) $(PACKAGE) '$(PACKAGE_NAME) manual'
# Checking
-check-format:
+check-tabs:
@if test -n "`cat $(info_TEXINFOS) $(wydawca_TEXINFOS) | tr -d -c '\t'`"; then \
echo "Sources contain tabs; run make untabify"; \
false; \
fi
+check-sentence-spacing:
+ @if grep -q '\. [@A-Z]' $(info_TEXINFOS) $(wydawca_TEXINFOS); then \
+ echo >&2 "Sources contain double-space sentence separators"; \
+ echo >&2 "Run make fix-sentence-spacing to fix"; \
+ fi
+
+check-format: check-tabs check-sentence-spacing
+
check-options:
@check-docs.sh options \
'/OPTIONS_BEGIN/,/OPTIONS_END/s/OPTION( *\([^,][^,]*\),.*/\1/pg' \
@@ -70,7 +78,7 @@ check-fixmes:
rm -f $@-t
check-writeme:
- @grep -Hn @WRITEME $(info_TEXINFOS) $(mailfromd_TEXINFOS) > $@-t; \
+ @grep -Hn @WRITEME $(info_TEXINFOS) $(wydawca_TEXINFOS) > $@-t; \
if [ -s $@-t ]; then \
echo "Empty nodes:"; \
cat $@-t; \
@@ -102,5 +110,14 @@ master-menu:
untabify:
emacs -batch -l untabify.el $(info_TEXINFOS) $(wydawca_TEXINFOS)
-final: untabify master-menu
+fix-sentence-spacing:
+ for file in $(info_TEXINFOS) $(wydawca_TEXINFOS); \
+ do \
+ if grep -q '\. [@A-Z]' $$file; then \
+ mv $$file $${file}~; \
+ sed -r 's/\. ([@A-Z])/. \1/g' $${file}~ > $$file; \
+ fi; \
+ done
+
+final: untabify fix-sentence-spacing master-menu
diff --git a/doc/fdl.texi b/doc/fdl.texi
index edd86d4..3f42957 100644
--- a/doc/fdl.texi
+++ b/doc/fdl.texi
@@ -23,16 +23,16 @@ to get credit for their work, while not being considered responsible
for modifications made by others.
This License is a kind of ``copyleft'', which means that derivative
-works of the document must themselves be free in the same sense. It
+works of the document must themselves be free in the same sense. It
complements the GNU General Public License, which is a copyleft
license designed for free software.
We have designed this License in order to use it for manuals for free
software, because free software needs free documentation: a free
program should come with manuals providing the same freedoms that the
-software does. But this License is not limited to software manuals;
+software does. But this License is not limited to software manuals;
it can be used for any textual work, regardless of subject matter or
-whether it is published as a printed book. We recommend this License
+whether it is published as a printed book. We recommend this License
principally for works whose purpose is instruction or reference.
@item
@@ -40,11 +40,11 @@ APPLICABILITY AND DEFINITIONS
This License applies to any manual or other work, in any medium, that
contains a notice placed by the copyright holder saying it can be
-distributed under the terms of this License. Such a notice grants a
+distributed under the terms of this License. Such a notice grants a
world-wide, royalty-free license, unlimited in duration, to use that
-work under the conditions stated herein. The ``Document'', below,
-refers to any such manual or work. Any member of the public is a
-licensee, and is addressed as ``you''. You accept the license if you
+work under the conditions stated herein. The ``Document'', below,
+refers to any such manual or work. Any member of the public is a
+licensee, and is addressed as ``you''. You accept the license if you
copy, modify or distribute the work in a way requiring permission
under copyright law.
@@ -65,15 +65,15 @@ them.
The ``Invariant Sections'' are certain Secondary Sections whose titles
are designated, as being those of Invariant Sections, in the notice
-that says that the Document is released under this License. If a
+that says that the Document is released under this License. If a
section does not fit the above definition of Secondary then it is not
-allowed to be designated as Invariant. The Document may contain zero
-Invariant Sections. If the Document does not identify any Invariant
+allowed to be designated as Invariant. The Document may contain zero
+Invariant Sections. If the Document does not identify any Invariant
Sections then there are none.
The ``Cover Texts'' are certain short passages of text that are listed,
as Front-Cover Texts or Back-Cover Texts, in the notice that says that
-the Document is released under this License. A Front-Cover Text may
+the Document is released under this License. A Front-Cover Text may
be at most 5 words, and a Back-Cover Text may be at most 25 words.
A ``Transparent'' copy of the Document means a machine-readable copy,
@@ -83,19 +83,19 @@ straightforwardly with generic text editors or (for images composed of
pixels) generic paint programs or (for drawings) some widely available
drawing editor, and that is suitable for input to text formatters or
for automatic translation to a variety of formats suitable for input
-to text formatters. A copy made in an otherwise Transparent file
+to text formatters. A copy made in an otherwise Transparent file
format whose markup, or absence of markup, has been arranged to thwart
or discourage subsequent modification by readers is not Transparent.
An image format is not Transparent if used for any substantial amount
-of text. A copy that is not ``Transparent'' is called ``Opaque''.
+of text. A copy that is not ``Transparent'' is called ``Opaque''.
Examples of suitable formats for Transparent copies include plain
@sc{ascii} without markup, Texinfo input format, La@TeX{} input
format, @acronym{SGML} or @acronym{XML} using a publicly available
@acronym{DTD}, and standard-conforming simple @acronym{HTML},
-PostScript or @acronym{PDF} designed for human modification. Examples
+PostScript or @acronym{PDF} designed for human modification. Examples
of transparent image formats include @acronym{PNG}, @acronym{XCF} and
-@acronym{JPG}. Opaque formats include proprietary formats that can be
+@acronym{JPG}. Opaque formats include proprietary formats that can be
read and edited only by proprietary word processors, @acronym{SGML} or
@acronym{XML} for which the @acronym{DTD} and/or processing tools are
not generally available, and the machine-generated @acronym{HTML},
@@ -104,7 +104,7 @@ output purposes only.
The ``Title Page'' means, for a printed book, the title page itself,
plus such following pages as are needed to hold, legibly, the material
-this License requires to appear in the title page. For works in
+this License requires to appear in the title page. For works in
formats which do not have any title page as such, ``Title Page'' means
the text near the most prominent appearance of the work's title,
preceding the beginning of the body of the text.
@@ -118,7 +118,7 @@ of such a section when you modify the Document means that it remains a
section ``Entitled XYZ'' according to this definition.
The Document may include Warranty Disclaimers next to the notice which
-states that this License applies to the Document. These Warranty
+states that this License applies to the Document. These Warranty
Disclaimers are considered to be included by reference in this
License, but only as regards disclaiming warranties: any other
implication that these Warranty Disclaimers may have is void and has
@@ -131,10 +131,10 @@ You may copy and distribute the Document in any medium, either
commercially or noncommercially, provided that this License, the
copyright notices, and the license notice saying this License applies
to the Document are reproduced in all copies, and that you add no other
-conditions whatsoever to those of this License. You may not use
+conditions whatsoever to those of this License. You may not use
technical measures to obstruct or control the reading or further
-copying of the copies you make or distribute. However, you may accept
-compensation in exchange for copies. If you distribute a large enough
+copying of the copies you make or distribute. However, you may accept
+compensation in exchange for copies. If you distribute a large enough
number of copies you must also follow the conditions in section 3.
You may also lend copies, under the same conditions stated above, and
@@ -148,10 +148,10 @@ printed covers) of the Document, numbering more than 100, and the
Document's license notice requires Cover Texts, you must enclose the
copies in covers that carry, clearly and legibly, all these Cover
Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
-the back cover. Both covers must also clearly and legibly identify
-you as the publisher of these copies. The front cover must present
+the back cover. Both covers must also clearly and legibly identify
+you as the publisher of these copies. The front cover must present
the full title with all words of the title equally prominent and
-visible. You may add other material on the covers in addition.
+visible. You may add other material on the covers in addition.
Copying with changes limited to the covers, as long as they preserve
the title of the Document and satisfy these conditions, can be treated
as verbatim copying in other respects.
@@ -186,14 +186,14 @@ the conditions of sections 2 and 3 above, provided that you release
the Modified Version under precisely this License, with the Modified
Version filling the role of the Document, thus licensing distribution
and modification of the Modified Version to whoever possesses a copy
-of it. In addition, you must do these things in the Modified Version:
+of it. In addition, you must do these things in the Modified Version:
@enumerate A
@item
Use in the Title Page (and on the covers, if any) a title distinct
from that of the Document, and from those of previous versions
(which should, if there were any, be listed in the History section
-of the Document). You may use the same title as a previous version
+of the Document). You may use the same title as a previous version
if the original publisher of that version gives permission.
@item
@@ -229,7 +229,7 @@ Include an unaltered copy of this License.
@item
Preserve the section Entitled ``History'', Preserve its Title, and add
to it an item stating at least the title, year, new authors, and
-publisher of the Modified Version as given on the Title Page. If
+publisher of the Modified Version as given on the Title Page. If
there is no section Entitled ``History'' in the Document, create one
stating the title, year, authors, and publisher of the Document as
given on its Title Page, then add an item describing the Modified
@@ -239,7 +239,7 @@ Version as stated in the previous sentence.
Preserve the network location, if any, given in the Document for
public access to a Transparent copy of the Document, and likewise
the network locations given in the Document for previous versions
-it was based on. These may be placed in the ``History'' section.
+it was based on. These may be placed in the ``History'' section.
You may omit a network location for a work that was published at
least four years before the Document itself, or if the original
publisher of the version it refers to gives permission.
@@ -252,11 +252,11 @@ dedications given therein.
@item
Preserve all the Invariant Sections of the Document,
-unaltered in their text and in their titles. Section numbers
+unaltered in their text and in their titles. Section numbers
or the equivalent are not considered part of the section titles.
@item
-Delete any section Entitled ``Endorsements''. Such a section
+Delete any section Entitled ``Endorsements''. Such a section
may not be included in the Modified Version.
@item
@@ -270,7 +270,7 @@ Preserve any Warranty Disclaimers.
If the Modified Version includes new front-matter sections or
appendices that qualify as Secondary Sections and contain no material
copied from the Document, you may at your option designate some or all
-of these sections as invariant. To do this, add their titles to the
+of these sections as invariant. To do this, add their titles to the
list of Invariant Sections in the Modified Version's license notice.
These titles must be distinct from any other section titles.
@@ -282,9 +282,9 @@ standard.
You may add a passage of up to five words as a Front-Cover Text, and a
passage of up to 25 words as a Back-Cover Text, to the end of the list
-of Cover Texts in the Modified Version. Only one passage of
+of Cover Texts in the Modified Version. Only one passage of
Front-Cover Text and one of Back-Cover Text may be added by (or
-through arrangements made by) any one entity. If the Document already
+through arrangements made by) any one entity. If the Document already
includes a cover text for the same cover, previously added by you or
by arrangement made by the same entity you are acting on behalf of,
you may not add another; but you may replace the old one, on explicit
@@ -306,7 +306,7 @@ license notice, and that you preserve all their Warranty Disclaimers.
The combined work need only contain one copy of this License, and
multiple identical Invariant Sections may be replaced with a single
-copy. If there are multiple Invariant Sections with the same name but
+copy. If there are multiple Invariant Sections with the same name but
different contents, make the title of each such section unique by
adding at the end of it, in parentheses, the name of the original
author or publisher of that section if known, or else a unique number.
@@ -316,7 +316,7 @@ Invariant Sections in the license notice of the combined work.
In the combination, you must combine any sections Entitled ``History''
in the various original documents, forming one section Entitled
``History''; likewise combine any sections Entitled ``Acknowledgements'',
-and any sections Entitled ``Dedications''. You must delete all
+and any sections Entitled ``Dedications''. You must delete all
sections Entitled ``Endorsements.''
@item
@@ -361,11 +361,11 @@ distribute translations of the Document under the terms of section 4.
Replacing Invariant Sections with translations requires special
permission from their copyright holders, but you may include
translations of some or all Invariant Sections in addition to the
-original versions of these Invariant Sections. You may include a
+original versions of these Invariant Sections. You may include a
translation of this License, and all the license notices in the
Document, and any Warranty Disclaimers, provided that you also include
the original English version of this License and the original versions
-of those notices and disclaimers. In case of a disagreement between
+of those notices and disclaimers. In case of a disagreement between
the translation and the original version of this License or a notice
or disclaimer, the original version will prevail.
@@ -378,9 +378,9 @@ title.
TERMINATION
You may not copy, modify, sublicense, or distribute the Document except
-as expressly provided for under this License. Any other attempt to
+as expressly provided for under this License. Any other attempt to
copy, modify, sublicense or distribute the Document is void, and will
-automatically terminate your rights under this License. However,
+automatically terminate your rights under this License. However,
parties who have received copies, or rights, from you under this
License will not have their licenses terminated so long as such
parties remain in full compliance.
@@ -389,9 +389,9 @@ parties remain in full compliance.
FUTURE REVISIONS OF THIS LICENSE
The Free Software Foundation may publish new, revised versions
-of the GNU Free Documentation License from time to time. Such new
+of the GNU Free Documentation License from time to time. Such new
versions will be similar in spirit to the present version, but may
-differ in detail to address new problems or concerns. See
+differ in detail to address new problems or concerns. See
@uref{http://www.gnu.org/copyleft/}.
Each version of the License is given a distinguishing version number.
@@ -399,7 +399,7 @@ If the Document specifies that a particular numbered version of this
License ``or any later version'' applies to it, you have the option of
following the terms and conditions either of that specified version or
of any later version that has been published (not as a draft) by the
-Free Software Foundation. If the Document does not specify a version
+Free Software Foundation. If the Document does not specify a version
number of this License, you may choose any version ever published (not
as a draft) by the Free Software Foundation.
@end enumerate
diff --git a/doc/rendition.texi b/doc/rendition.texi
index 45ac068..5d04105 100644
--- a/doc/rendition.texi
+++ b/doc/rendition.texi
@@ -5,10 +5,10 @@
@c ======================================================================
@c This document has three levels of rendition: PUBLISH, DISTRIB or PROOF,
-@c as decided by @set symbols. The PUBLISH rendition does not show
-@c notes or marks asking for revision. Most users will prefer having more
+@c as decided by @set symbols. The PUBLISH rendition does not show
+@c notes or marks asking for revision. Most users will prefer having more
@c information, even if this information is not fully revised for adequacy,
-@c so DISTRIB is the default for distributions. The PROOF rendition
+@c so DISTRIB is the default for distributions. The PROOF rendition
@c show all marks to the point of ugliness, but is nevertheless useful to
@c those working on the manual itself.
@c ======================================================================
diff --git a/doc/wydawca.texi b/doc/wydawca.texi
index 589f2f7..237f196 100644
--- a/doc/wydawca.texi
+++ b/doc/wydawca.texi
@@ -37,11 +37,11 @@ Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2 or
any later version published by the Free Software Foundation; with no
Invariant Sections, with the Front-Cover texts being ``A GNU Manual'',
-and with the Back-Cover Texts as in (a) below. A copy of the license
+and with the Back-Cover Texts as in (a) below. A copy of the license
is included in the section entitled ``GNU Free Documentation License''.
(a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify
-this GNU Manual, like GNU software. Copies published by the Free
+this GNU Manual, like GNU software. Copies published by the Free
Software Foundation raise funds for GNU development.''
@end copying
@@ -89,6 +89,7 @@ already listed, mentioned here so you can get to them in one step:
How to Configure @command{wydawca}.
+* Syntax:: Configuration file syntax.
* syslog::
* sql::
* access methods::
@@ -97,12 +98,32 @@ How to Configure @command{wydawca}.
* statistics::
* notification::
+Configuration file syntax
+
+* Comments::
+* Pragmatic Comments::
+* Statements::
+* Preprocessor::
+
+Access Methods
+
+* sql type::
+* builtin type::
+* external type::
+
+SQL Access Methods
+
+* gpg-key-sql::
+* project-owner-sql::
+* user-data-sql::
+* verify-user-sql::
+
Mail Notification
-* mailer::
-* templates::
-* statreports::
-* event notification::
+* mailer::
+* templates::
+* statreports::
+* event notification::
@end detailmenu
@end menu
@@ -184,8 +205,8 @@ effective and consumes little resources.
@cindex operation
@cindex overview
Usually, @command{wydawca} is installed on the machine that receives
-release uploads. It may be run either periodically as a cron-job, or
-as a standalone daemon. It supposes that both upload and distribution
+release uploads. It may be run either periodically as a cron-job, or
+as a standalone daemon. It supposes that both upload and distribution
directories are accessible in the local file system hierarchy. If that
is not the case (e.g. if upload and distribution sites are handled by
different machines), one of them should be mounted using
@@ -232,7 +253,7 @@ Standalone directives}.
Each @dfn{incomplete} triplet, i.e. such that misses one or more
necessary files, is then verified by checking if the modification
date of its oldest file is older than a predefined amount of time
-(@pxref{file-sweep-time}), and if so, all files from this triplet are
+(@FIXME-pxref{file-sweep-time}), and if so, all files from this triplet are
removed (an @dfn{expired triplet}). This gives users the possibility
to restart interrupted or otherwise broken uploads later.
@@ -354,7 +375,7 @@ detected, and withs status 1 otherwise.
@opindex -E, introduced
@xopindex{no-preprocessor, introduced}
Before parsing, configuration file is preprocessed using
-@command{m4} (@FIXME-pxref{Preprocessor}). To see the preprocessed
+@command{m4} (@pxref{Preprocessor}). To see the preprocessed
configuration without actually parsing it, use @option{-E} command
line option. To avoid preprocessing it, use
@option{--no-preprocessor} option.
@@ -383,13 +404,14 @@ directives any time by running @command{wydawca --config-help}.
There are three classes of lexical tokens: keywords, values, and
separators. Blanks, tabs, newlines and comments, collectively called
@dfn{white space} are ignored except as they serve to separate
-tokens. Some white space is required to separate otherwise adjacent
+tokens. Some white space is required to separate otherwise adjacent
keywords and values.
@menu
* Comments::
* Pragmatic Comments::
* Statements::
+* Preprocessor::
@end menu
@node Comments
@@ -469,7 +491,7 @@ compatibility with the @sc{c} preprocessor.
In fact, these statements provide a rudimentary preprocessing
features. For more sophisticated ways to modify configuration before
-parsing, see @FIXME-ref{Preprocessor}.
+parsing, see @ref{Preprocessor}.
@node Statements
@subsection Statements
@@ -478,7 +500,7 @@ parsing, see @FIXME-ref{Preprocessor}.
@cindex statement, simple
@cindex simple statements
A @dfn{simple statement} consists of a keyword and value
-separated by any amount of whitespace. Simple statement is terminated
+separated by any amount of whitespace. Simple statement is terminated
with a semicolon (@samp{;}).
Examples of simple statements:
@@ -561,6 +583,44 @@ example above:
@end group
@end smallexample
+@anchor{meta-interpretation}
+Depending on the context, the contents of a quoted string may be
+subject to @dfn{meta-variable interpretation}. During this process,
+any sequence
+
+@smallexample
+$@{@var{var}@}
+@end smallexample
+
+@noindent
+where @var{var} is the name of a defined meta-variable, is replaced with
+the value of the variable. This sequence is called @dfn{meta-
+reference}. For example, if the meta-variable @samp{user} has the
+value @samp{smith}, then the string
+
+@smallexample
+"where user = '$@{user@}'"
+@end smallexample
+
+@noindent
+becomes
+
+@smallexample
+"where user = 'smith'"
+@end smallexample
+
+If the name of the variable consists of a single character, the curly
+braces around it may be omitted. Thus, @code{$@{u@}} and @code{$u} are
+equivalent.
+
+If @var{var} is not defined, the meta-reference is left unchanged.
+
+To insert a literal @samp{$} character in a string that is subject to
+meta-variable interpretation, duplicate it: @samp{$$}.
+
+The exact set of defined meta-variables and their values depend on the
+context and are discussed in detail below.
+
@anchor{here-document}
@item Here-document
@cindex here-document
@@ -569,8 +629,8 @@ strings of text containing embedded newlines.
The @code{<<@var{word}} construct instructs the parser to read all
the following lines up to the line containing only @var{word}, with
-possible trailing blanks. Any lines thus read are concatenated
-together into a single string. For example:
+possible trailing blanks. Any lines thus read are concatenated
+together into a single string. For example:
@smallexample
@group
@@ -657,7 +717,43 @@ spool download @{
The closing curly brace may be followed by a semicolon, although
this is not required.
-
+
+@node Preprocessor
+@subsection Preprocessor
+@cindex preprocessor
+@cindex m4
+ Before parsing its configuration file, @command{wydawca} preprocesses
+it. The built-in preprocessor handles only file inclusion
+and @code{#line} statements (@pxref{Pragmatic Comments}), while the
+rest of traditional preprocessing facilities, such as macro expansion,
+is supported via @command{m4}, which is used as an external preprocessor.
+
+ The detailed description of @command{m4} facilities lies far beyond
+the scope of this document. You will find a complete user manual in
+@ifnothtml
+@ref{Top, GNU M4 manual, GNU M4, m4, GNU M4 macro processor}.
+@end ifnothtml
+@ifhtml
+@uref{http://www.gnu.org/software/m4/manual}.
+@end ifhtml
+For the rest of this subsection we assume the reader is sufficiently
+acquainted with @command{m4} macro processor.
+
+@cindex @file{pp-setup}
+ The external preprocessor is invoked with @option{-s} flag, which
+instructs it to include line synchronization information in its
+output. This information is then used by the parser to display meaningful
+diagnostic. An initial set of macro definitions is supplied by the
+@file{pp-setup} file, located in
+@file{@var{$prefix}/share/wydawca/@var{version}/include} directory (where
+@var{version} means the version of Wydawca package).
+
+The default @file{pp-setup} file renames all @command{m4} built-in
+macro names so they all start with the prefix @samp{m4_}. This
+is similar to GNU m4 @option{--prefix-builtin} options, but has an
+advantage that it works with non-GNU @command{m4} implementations as
+well.
+
@node syslog
@section Syslog Configuration Directives
@cindex syslog, configuration
@@ -746,7 +842,7 @@ database. Optional @var{port-or-socket} specifies port number (for
@acronym{TCP} connections) or socket name (for @acronym{UNIX} sockets)
to use. In the latter case, the @var{hostname} and the colon may be
omitted. If, however, it is present, it must be @samp{localhost}.
-@xref{sql-host}, for more information and examples.
+@FIXME-xref{sql-host}, for more information and examples.
@end deffn
@deffn {Configuration} database @var{name}
@@ -797,7 +893,7 @@ access-method @var{method-name} @{
Access method statements can appear either in the global scope of
the configuration file, or inside a @code{spool} statement
-(@FIXME-pxref{spool}). Global definitions affect all directory
+(@pxref{spool}). Global definitions affect all directory
pairs in the configuration file, and ones inside a @code{directory}
statement override them for that particular directory pair.
@@ -856,7 +952,7 @@ See below for a detailed description of these access methods.
@deffn {Configuration} query @var{string}
Sets the query used for retrieving the data. The @var{string} is
-subject to meta-variable expansion (@FIXME-pxref{meta-variables}). The
+subject to meta-variable interpretation (@pxref{meta-interpretation}). The
following meta-variables are defined:
@table @code
@@ -864,6 +960,7 @@ following meta-variables are defined:
@kwindex user
@item u
@itemx user
+@itemx user:name
The system name of the user that submitted the triplet.
@kwindex p
@@ -874,6 +971,24 @@ following meta-variables are defined:
submitted. It is defined as the value of directive
@code{directory}, or, in case this value contains slashes, the
shortest initial prefix of that value, not containing slashes.
+
+@item spool
+ The name of the distribution spool where this upload originates
+(@pxref{spool}).
+
+@item url
+ The @acronym{URL} of the spool, as set in the @code{url} statement
+of the @code{spool} block (@pxref{spool, url}).
+
+@item dir
+Directory (relative to the project distribution root) where the
+files are going to be uploaded.
+
+@item dest-dir
+Spool destination directory (@pxref{spool, destination}).
+
+@item source-dir
+Spool source directory (@pxref{spool, source}).
@end table
@end deffn
@@ -940,11 +1055,11 @@ access-method project-owner @{
type sql;
params (default);
query "SELECT user.email, user.realname "
- "FROM user,user_group,groups "
- "WHERE user_group.user_id=user.user_id "
- "AND user_group.group_id=groups.group_id "
- "AND user_group.admin_flags = 'A' "
- "AND groups.unix_group_name = '$@{project@}'";
+ "FROM user,user_group,groups "
+ "WHERE user_group.user_id=user.user_id "
+ "AND user_group.group_id=groups.group_id "
+ "AND user_group.admin_flags = 'A' "
+ "AND groups.unix_group_name = '$@{project@}'";
@}
@end smallexample
@@ -972,11 +1087,11 @@ access-method verify-user @{
type sql;
params (default);
query "SELECT user.user_name "
- "FROM user,user_group, groups "
- "WHERE user_group.user_id=user.user_id "
- "AND user_group.group_id=groups.group_id "
- "AND user_group.admin_flags = 'A' "
- "AND groups.unix_group_name='$@{project@}' "
+ "FROM user,user_group, groups "
+ "WHERE user_group.user_id=user.user_id "
+ "AND user_group.group_id=groups.group_id "
+ "AND user_group.admin_flags = 'A' "
+ "AND groups.unix_group_name='$@{project@}' "
"AND user.user_name='$@{user@}'";
@}
@end smallexample
@@ -1010,7 +1125,7 @@ their existing files.
@command{tar} file, and to a separate directory. The method to be used
is configured using @code{archive} statement. This statement can
appear either in the global scope, in which case it affects all
-spools, or within a @code{spool} block (@FIXME-pxref{spool}),
+spools, or within a @code{spool} block (@pxref{spool}),
where it affects only the given spool.
@kwindex archive
@@ -1186,7 +1301,7 @@ spool @var{tag} @{
The @var{tag} argument defines a unique identifier for this spool. It
will be used in log messages, timers (@FIXME-pxref{timers}) and in
-meta-substitutions (@FIXME-pxref{meta-variables, spool}).
+meta-variable interpretation (@pxref{meta-interpretation}).
@deffn {Configuration} url @var{string}
Defines download @acronym{URL}, associated with this spool. Its value
@@ -1264,10 +1379,9 @@ spool ftp @{
@node statistics
@section Statistics
@cindex statistics
-@UNREVISED
At the end of the run, @command{wydawca} prints a detailed
statistics of its execution on the diagnostic channel @samp{info}.
-The statistics is printed only if at least one of the items is not zero.
+The statistics is printed only if at least one of its items is not zero.
The following example illustrates what you might get if you configured
full statistics output:
@@ -1354,18 +1468,18 @@ A symlink is removed.
@end table
@kwindex statistics
- Amount of information included in the statistics summary is
+ The amount of information included in the statistics summary is
configured using the @code{statistics} statement. This statement takes
a list of arguments, each one being one of the keywords, described
above. For example, the following statement causes only the
information about errors and warnings to be printed:
@smallexample
-statistics errors warnings
+statistics (errors, warnings);
@end smallexample
@noindent
-It will produce the following output:
+The output produced looks like:
@smallexample
errors: 0
@@ -1373,28 +1487,27 @@ warnings: 2
@end smallexample
@kwindex none@r{, statistics}
- The special keyword @samp{none} can be used to suppress this output
+ A special keyword @samp{none} can be used to suppress this output
altogether (which is the default), as in
@smallexample
-statistics none
+statistics none;
@end smallexample
@kwindex all@r{, statistics}
- Another special keyword is @samp{all}, that enables all statistics
+ Another special keyword is @samp{all}. It enables full statistics
output. This keyword may also be followed by any number of statistics
keywords, which are in this case @emph{excluded} from the
summary. For example, to output all statistics, except errors and
warnings one would set:
@smallexample
-statistics all errors warnings
+statistics (all, errors, warnings);
@end smallexample
@node notification
@section Mail Notification
@cindex mail notification
-@UNREVISED
While running, @command{wydawca} keeps track of certain events
occurring, such as, for example, broken @acronym{PGP} signatures or
file uploads attempted by unauthorized users. The utility can notify,
@@ -1403,168 +1516,229 @@ concern their projects. Additionally, the system administrator can
choose to obtain via email the execution statistics, described in the
previous section.
-@kwindex from-address
The sender email address for these notifications is set using the
-@code{from-address} statement, e.g.:
+@code{from-address} statement.
+
+@deffn {Configuration} from-address @var{address}
+Set sender address for outgoing mails. E.g.:
@smallexample
-from-address ftp-uploads@@gnu.org.ua
+from-address ftp-uploads@@gnu.org.ua;
@end smallexample
+@end deffn
-@noindent
-It is not strictly necessary to specify it, however. In the absence of
-@code{from-address} statement, the sender email will be constructed
-from the name of the user @command{wydawca} runs as (usually
-@samp{root}) and the full domain name of the machine it runs at.
+It is not strictly necessary to specify the sender address. In the
+absence of @code{from-address} statement, the sender email will be
+constructed from the name of the user @command{wydawca} runs as
+(@FIXME-pxref{user privs}) and the full domain name of the machine it
+runs at.
+
+@deffn {Configuration} admin-address @var{email}
+Sets the admin email address or addresses. The statistics
+notifications and any notifications configured to be sent to admins
+will be forwarded to this address. The @var{email} argument is either
+a @acronym{RFC} 822 email address, or a list of such addresses. For
+example, the following statement configures a single admin address:
+
+@smallexample
+admin-address root@@gnu.org.ua;
+@end smallexample
+
+The example below illustrates how to configure multiple addresses:
+
+@smallexample
+admin-address "root@@gnu.org.ua,ftp-adm@@gnu.org.ua";
+@end smallexample
+
+Yet another way to configure them is:
+
+@smallexample
+admin-address (root@@gnu.org.ua, ftp-adm@@gnu.org.ua);
+@end smallexample
+@end deffn
@menu
-* mailer::
-* templates::
-* statreports::
-* event notification::
+* mailer::
+* templates::
+* statreports::
+* event notification::
@end menu
@node mailer
@subsection Mailer
@cindex mailer
-@kwindex mailer
-@UNREVISED
To send messages, @command{wydawca} uses a special logical entity
-called @dfn{mailer}. It is set in the configuration file using
-@code{mailer} keyword:
+called a @dfn{mailer}. It is set in the configuration file using
+@code{mailer} keyword.
-@smallexample
-mailer @var{url}
-@end smallexample
+@deffn {Configuration} mailer @var{url}
+Set mailer @acronym{URL}.
+@end deffn
@cindex @acronym{URL}, mailer
@cindex mailer @acronym{URL}
- A mailer @acronym{URL} begins with a protocol specification.
-Two protocol specifications are currently supported: @samp{sendmail}
-and @samp{smtp}. The former means to use a
-@command{sendmail}-compatible program to send mails. Such a program
-must be able to read mail from its standard input and must support the
-following options:
+ A mailer @acronym{URL} consists of a scheme specification, followed
+by @samp{://} separator and additional data. The @acronym{URL}s
+supported by Wydawca version @value{VERSION} are described in the
+table below. As usual, square brackets indicate optional parts:
+
+@table @asis
+@item smtp://@var{host}[:@var{port}]
+Use an SMTP server on @var{host} to relay messages. The @var{host} part is
+either an IP address in dotted-quad notation or as a symbolic host
+name. In the latter case, DNS system is be used to resolve
+it. Optional @var{port} specifies port number or symbolic name (as
+defined in @file{/etc/services}). It defaults to 25. For example:
+
+@smallexample
+mailer smtp://remote.server.net:24;
+@end smallexample
+
+@item sendmail://@var{progname}
+Use sendmail-compatible program
+@var{progname}. @dfn{Sendmail-compatible} means that the program must
+be able to read an RFC-822 message from its standard input and must
+support the following command line options:
@table @option
@item -oi
-Do not treat '.' as message terminator.
+Do not treat @samp{.} as message terminator.
@item -f @var{addr}
-Use @var{addr} as the address of the sender.
+Use @var{addr} as the sender address.
@item -t
Get recipient addresses from the message.
@end table
-These conditions are met by most existing @acronym{MTA} programs, such
-as @command{exim} or @command{postfix} (to say nothing of
-@command{sendmail} itself).
+Example:
+
+@smallexample
+mailer sendmail:///usr/sbin/exim;
+@end smallexample
+
+@item sendmail:
+This is a special form of the @samp{sendmail} mailer. It uses the
+@command{sendmail} binary from the @code{_PATH_SENDMAIL} macro in your
+@file{/usr/include/paths.h}. It is the default mailer.
-Following the protocol specification is the @dfn{mailer location}, which
-is separated from it with a colon. For the @samp{sendmail} protocol,
-the mailer location sets the full file name of the sendmail-compatible
-@acronym{MTA} binary, for example:
+@item prog://@var{progname}?@var{query}
+A @dfn{prog} mailer. This is a generalization of @samp{sendmail}
+mailer that allows to use arbitrary external programs as mailers.
+
+The full file name of the program is given in @var{progname} part.
+The @var{query} part is a list of arguments, separated by @samp{&}
+signs. Arguments may contain the following macro-substitutions:
+
+@table @samp
+@item $@{sender@}
+Expands to the sender email address.
+
+@item $@{rcpt@}
+Expands to the recipient email addresses.
+
+The program @var{progname} must read an RFC-822 message from its
+standard input.
+
+An example of @samp{prog} mailer definition:
+
+@smallexample
+mailer "prog:///bin/nullmail?localhost&-F$@{sender@}&$@{rcpt@}
+@end smallexample
+
+When sending a mail, @command{wydawca} will invoke:
@smallexample
-mailer sendmail:/usr/sbin/sendmail
+/bin/nullmail localhost -F@var{sender} @var{rcpt}
@end smallexample
-A special form of a sendmail @acronym{URL}, consisting of protocol
-specification only (@samp{sendmail:}) is also allowed. It means
-``use the sendmail binary from the @code{_PATH_SENDMAIL}
-macro in your @file{/usr/include/paths.h} file''. This is the default
-mailer.
+@noindent
+where @var{sender} means the sender address, and @var{rcpt} stands for
+the recipient email address.
-The @samp{smtp} protocol means to use an @acronym{SMTP} server directly.
-In this case, mailer location consists of two slashes,
-followed by the @acronym{IP} address or host name of the @acronym{SMTP}
-server, and, optionally, the port number. If the port number is
-present, it is separated from the rest of @acronym{URL} by a colon.
-For example:
+@item | @var{prog} @var{args..}
+Equivalent to the @samp{prog} mailer, described above, but written in
+a more natural fashion. In this notation, the example definition above
+becomes:
@smallexample
-@group
-mailer smtp://remote.server.net
-mailer smtp://remote.server.net:24
-@end group
+mailer "|/bin/nullmail localhost -F$@{sender@} $@{rcpt@}"
@end smallexample
+@end table
+@end table
+
@node templates
@subsection Message Templates
@cindex templates, notification messages
@cindex notification message template
@cindex message template
-@UNREVISED
Each notification message is build from a message template, by
-expanding any occurrences of @samp{%@{@var{name}@}} within it with the value
-of macro-variable @var{name}. Sets of defined macro-variables
-depend on the type of the notification and are described below.
+expanding meta-variables (@pxref{meta-interpretation}) within it.
+The message text may be specified either in place within the
+configuration directive it belongs to (@FIXME-pxref{notification}), or
+defined by @code{define-message} statement.
+
+@deffn {Configuration} define-message @var{name} @var{text};
+Define message @var{name} to be @var{text}. This message can be
+referred to from other configuration statements by @code{@@@var{name}}
+notation.
+@end deffn
-@kwindex define-message
- Message templates are defined using @code{define-message}
-statement. Its syntax is as follows:
+The message text must be formatted as a valid RFC-822 message, i.e. it
+must consist of two parts, message headers and body, separated by a
+single empty line. Therefore @var{text} is usually a
+@dfn{here-document} construct (@pxref{here-document}). For example:
@smallexample
-define-message @var{id} [-]@var{delimiter}
-@var{lines}
-@var{delimiter}
+define-message my-message <<EOT
+From: Wydawca
+Subject: test
+
+This is a test message.
+EOT;
@end smallexample
-@noindent
-where @var{id} is a symbolic identifier used to refer to this message
-in another configuration statements, @var{delimiter} is a delimiter
-used to mark the end of the message template, and @var{lines} are any
-number of lines that form the message template. If @var{delimiter} is
-prefixed by a minus sign, any leading whitespace will be removed from
-each template line, thus allowing to indent the template text in a natural
-way. Furthermore, the @var{delimiter} itself is optional. If it is
-omitted, the string @samp{end} is used to delimit the message.
-The following example illustrates the simplest way to define a message
-template:
+If you do not wish to supply any headers (which is unlikely, because a
+mail should at least have a @code{Subject} header), simply begin the
+message text with an empty line, like this:
@smallexample
-define-message my-message
-Subject: test
+define-message my-message <<EOT
This is a test message.
-end
+EOT;
@end smallexample
- Following is the same message template, but indented in a more
-natural way. @samp{EOT} is used as a message delimiter:
+@node statreports
+@subsection Statistic Reports
+@kwindex mail-statistics
+@UNREVISED
+Sending statistic reports to the system administrator is configured by
+@code{mail-statistics} statement.
@smallexample
-define-message my-message -EOT
- Subject: test
-
- This is a test message.
-EOT
+mail-statistics @{
+ message @var{text-or-id};
+ statistics @var{item-list};
+@}
@end smallexample
- It is important to notice, that the message template must supply
-both @acronym{RFC} 822 headers, and message body, so it must always
-consist of two parts, separated by a single empty line. If you do not
-wish to supply any headers (which is unlikely, because a mail should
-at least have a @code{Subject} header), simply begin the message text
-with an empty line, like this:
+@deffn {Configuration} message @var{text-or-id}
+Define the message text. The argument is either the message text
+template, or a reference to a template previously defined by a
+@code{define-message} (@pxref{templates}). The reference syntax is:
@smallexample
-define-message my-message -EOT
-
- This is a test message.
-EOT
+message @@@var{name};
@end smallexample
-@node statreports
-@subsection Statistic Reports
-@kwindex mail-admin-stat
-@UNREVISED
-Sending statistic reports to the system administrator is enabled by
-@code{mail-admin-stat} statement. It takes two or more arguments.
-The first argument supplies the identifier of a message template,
-which should be previously defined by a @code{define-message}.
-The rest of arguments is a list of statistics keywords as described in
+@noindent
+where @var{name} is the message name as used in @code{define-message}.
+@end deffn
+
+@deffn {Configuration} statistics @var{item-list}
+The argument is a list of statistics keywords as described in
@ref{statistics}. A report will be sent only if statistics
counters for at least one of the requested categories are not
zero. For example, the following statement requires sending
@@ -1572,21 +1746,15 @@ notifications only if there occurred any errors or access violation
attempts, or any bad signature was uploaded:
@smallexample
-mail-admin-stat stat-msg errors access-violations bad-signatures
+statistics (stat-msg, errors, access-violations, bad-signatures);
@end smallexample
+@end deffn
-@kwindex admin-address
- The recipient address for these notifications is set using
-@code{admin-address} statement. Its argument is either a single
-@acronym{RFC} 822 email address, or a comma-separated list of such
-addresses, e.g.:
-
-@smallexample
-admin-address root@@gnu.org.ua, ftp-adm@@gnu.org.ua
-@end smallexample
+The statistics message is sent to addresses configured by
+@code{admin-address} statement (@pxref{notification, admin-address}).
@cindex meta-variables in admin notifications
-The meta-variables available for use in admin notifications are:
+The meta-variables available for use in statistics reports are:
@multitable @columnfractions 0.50 0.50
@headitem Variable @tab Replaced with
@@ -1623,10 +1791,15 @@ triplets.
@item stat:rmsymlinks @tab Number of symbolic links removed.
@end multitable
+@FIXME{timers: @code{timer:@var{id}:user} }
+
An example definition of the admin notification template follows:
@smallexample
-define-message stat-msg
+mail-statistics @{
+ statistics (errors,warnings,bad_signatures,
+ access_violations);
+ message <<EOT
Subject: Wydawca stats
This is to notify you that my run on %@{date@}
@@ -1639,19 +1812,33 @@ access violation attempts .......... %@{stat:access_violations@}
Regards,
Wydawca
-end
+@}
@end smallexample
@node event notification
@subsection Event Notification
@cindex event notification
@UNREVISED
-The following @dfn{events} are tracked during the execution. Any of
+A number of @dfn{events} are tracked during the execution. Any of
them can be used to trigger an email notification of any party
concerned: the system administrator, project administrators, or
-the user that initiated the upload:
+the user that initiated the upload. These notifications are configured
+using the @code{notify-event} statement:
-@table @code
+@kwindex notify-event
+@smallexample
+notify-event @{
+ event @var{ev-id};
+ recipient @var{who};
+ message @var{text-or-id};
+@}
+@end smallexample
+
+@deffn {Configuration} event @var{ev-id}
+Send notification when the event @var{ev-id} occurs. The following
+table describes the available @var{ev-id}s:
+
+@table @asis
@kwindex success
@item success
Successful upload.
@@ -1670,33 +1857,30 @@ uploader.
The detached signature does not match the public key of the
uploader.
@end table
+@end deffn
-@kwindex notify-event
- These notifications are configured using the following statement:
-
-@smallexample
-notify-event @var{event} @var{who} @var{msg-id}
-@end smallexample
-
-@noindent
-where @var{event} is one of the events described above, @var{msg-id}
-is the identifier of a previously defined message template
-(@pxref{templates}), and @var{who} determines who should receive the
-notification. The following values for @var{who} are allowed:
+@deffn {Configuration} recipient @var{who}
+Determines who should receive the notification. The following values
+for @var{who} are allowed:
@table @code
@kwindex admin
@item admin
-The system administrator.
+The system administrator, as defined in @code{admin-address} statement
+(@pxref{notification, admin-address}).
@kwindex owner
@item owner
-Administrators of the project for which the files where uploaded.
+Administrators of the project for which the files where
+uploaded. Their addresses are retrieved using the @samp{project-owner}
+access method (@pxref{access methods}).
@kwindex user
@item user
-A user who uploaded files.
+The user who uploaded files. The user address is returned by
+@samp{user-data} access method (@pxref{access methods}).
@end table
+@end deffn
For example, the following two statements instruct @command{wydawca}
to email notifications about any @code{bad-directive-signature} event to
@@ -1704,8 +1888,17 @@ project administrators and to the user who did the upload, using two
different templates:
@smallexample
-notify-event bad-directive-signature user user-bad-directive-signature
-notify-event bad-directive-signature owner owner-bad-directive-signature
+notify-event @{
+ event bad-directive-signature;
+ recipient user;
+ message @@usermsg;
+@}
+
+notify-event @{
+ event bad-directive-signature;
+ recipient owner;
+ message @@ownermsg;
+@}
@end smallexample
The following macro-variables may be used in templates for these
@@ -1720,9 +1913,13 @@ Project system name.
@item url
@acronym{URL} of the distribution site.
+@kwindex spool
+@item spool
+Name of the spool (@pxref{spool}).
+
@kwindex dir
@item dir
-Directory (relative to the project distribution root) to where the
+Directory (relative to the project distribution root) where the
files where uploaded.
@kwindex dest-dir
@@ -1776,6 +1973,25 @@ Real name of the user who uploaded the triplet.
@kwindex user:email
@item user:email
Email of the user who uploaded the triplet.
+
+@item timer:wydawca:real
+@FIXME
+@item timer:wydawca:system
+@FIXME
+@item timer:wydawca:user
+@FIXME
+@item timer:triplet:real
+@FIXME
+@item timer:triplet:system
+@FIXME
+@item tumer:triplet:user
+@FIXME
+@item timer:spool:real
+@FIXME
+@item timer:spool:system
+@FIXME
+@item tumer:spool:user
+@FIXME
@end table
@dfn{Listings} referred to in the table above, are similar to those
@@ -1790,378 +2006,251 @@ example, here is a possible @code{%@{triplet:full@}} listing:
@end smallexample
-
The following example shows how to configure success notification
for the user:
@smallexample
-# @r{Define a message template.}
-define-message user-success
-Subject: Upload of %@{project@} successful
+notify-event @{
+ event success;
+ recipient user;
+ message <<EOT
+Subject: Upload of $@{project@} successful
-Upload of %@{project@} to %@{dir@} finished successfully.
+Upload of $@{project@} to $@{url@}/$@{dir@} finished successfully.
Files uploaded:
-%@{triplet:upload@}
+$@{triplet:upload@}
+
+Resource usage: $@{timer:triplet:real@}/$@{timer:wydawca:real@}r \
+$@{timer:triplet:user@}/$@{timer:wydawca:user@}u \
+$@{timer:triplet:system@}/$@{timer:wydawca:system@}s
Regards,
Wydawca
The Project Submission Robot
-end
-
-# @r{Use this template in a success notification.}
-notify-event success user user-success
+EOT;
+@}
@end smallexample
@node wydawca.rc
@chapter @command{Wydawca} configuration file.
@cindex configuration statements, reference
-@UNREVISED
-This chapter contains a concise reference list of all configuration
-file statements.
-
-@deffn {Wydawca Statement} archive @var{type} @var{archive-name} @
- [@var{backup-method}]
-Defines archivation and backup methods. @xref{archivation}, for a
-detailed discussion. @xref{archivation}, for a detailed explanation.
-
-The archivation type is specified by @var{type} argument:
-
-@table @asis
-@item tar
-@var{archive-name} is a full file name of the @command{tar}
-archive used for archivation. Files being archived are appended to
-that archive using @command{tar -r} command (@pxref{appending files,
-Appending Files to an Archive, Appending Files to an Archive, tar,
-@acronym{GNU} tar: an archiver tool}). The default file name of the
-@command{tar} binary is set by @code{tar-program} statement.
-
-@item directory
-@var{archive-name} specifies a directory name where to store
-archive copies. If it is a relative file name, this directory will be
-created under the @code{destination} directory. If it is absolute file
-name, the archive name directory will be constructed for each triplet
-using the following rule:
+@WRITEME
@smallexample
-@var{archive-name}/@var{dir}
-@end smallexample
-
-@noindent
-where @var{dir} is the value of @code{directory} directive from the
-triplet file.
-@end table
-
-@vindex VERSION_CONTROL
-@cindex backups
-For @samp{directive} archivation type, the optional @var{backup-method}
-parameter specifies how to back up an existing file whose name
-coincides with the one @command{wydawca} is about to create. If
-@var{backup-method} is not specified, the value of the @env{VERSION_CONTROL}
-environment variable will be used. And if @env{VERSION_CONTROL} is not set,
-the @samp{existing} method (see below) is used by default.
-
-@vindex version-control @r{Emacs variable}
-This option corresponds to the Emacs variable @samp{version-control};
-the same values for @var{backup-method} are accepted as in Emacs. This option
-also allows more descriptive names. Valid @var{method}s are:
-
-@table @samp
-@item t
-@itemx numbered
-Always make numbered backups.
-
-@item nil
-@itemx existing
-Make numbered backups of files that already have them, simple backups.
-of the others.
-
-@item never
-@itemx simple
-Always make simple backups.
-
-@end table
-
-@end deffn
-
-@deffn {Wydawca Statement} syslog-facility @var{facility}
-Output diagnostics to the given syslog facility. The @var{facility}
-may be one of the following: @samp{user}, @samp{daemon}, @samp{auth},
-@samp{authpriv}, @samp{local0} through @samp{local7}, and @samp{mail}.
-the string matching is case insensitive. optionally, @samp{log_}
-(sense-insensitive as well) prefix may be prepended to @var{facility}.
-
-@xref{syslog}, for more information.
-@end deffn
-
-@deffn {Wydawca Statement} syslog-tag @var{tag}
-Mark @command{wydawca} diagnostics with the given syslog tag. By
-default the string @samp{wydawca} is used.
-
-@xref{syslog}, for more information.
-@end deffn
-
-@deffn {Wydawca Statement} syslog-print-priority @var{bool}
-Begin each diagnostic message with its priority.
-
-@xref{syslog}, for more information.
-@end deffn
+# Configuration file structure for wydawca.
+# For more information, use `info wydawca configuration'.
-@deffn {Wydawca Statement} statistics @var{stat-list}
-Print usage statistics at the end of the run. These data are output
-at @samp{info} priority. The @var{stat-list} is a white-space
-separated list of items that specify what statistics data are to be
-printed. The valid items of @var{stat-list} are:
+# Enable daemon mode
+daemon @var{arg:@i{<boolean>}};
-@table @option
-@item archives
-Number of files successfully archived.
+# Start in foreground even in daemon mode
+foreground @var{arg:@i{<boolean>}};
-@item bad_triplets
-Number of bad triplets detected.
+# Do not spawn subprocesses
+single-process @var{arg:@i{<boolean>}};
-@item complete_triplets
-Number of complete triplets.
+# Set wake-up interval
+wakeup-interval @var{time:@i{<string>}};
-@item errors
-Number of errors during the run.
+# Set pid file name
+pidfile @var{file:@i{<string>}};
-@item expired_triplets
-Number of expired triplets.
+# Run with UID and GID of this user
+user @var{name:@i{<string>}};
-@item incomplete_triplets
-Number of incomplete triplets.
+# Retain these supplementary groups
+group @var{arg:@i{<list of string>}};
-@item rmsymlinks
-Number of symlinks successfully removed.
+# Enable or disable locking
+locking @var{arg:@i{<boolean>}};
-@item symlinks
-Number of symlinks successfully created.
+# Set directory for lock files
+lockdir @var{dir:@i{<string>}};
-@item triplet_success
-Number of triplets successfully processed.
+# Define lock expiration interval
+lock-expire-time @var{interval:@i{<string>}};
-@item uploads
-Number of successful uploads.
+# Listen on this address
+listen @var{socket:@i{<sock-addr>}};
-@item warnings
-Number of warnings.
-@end table
+# Configure TCP wrappers
+tcp-wrapper @{
+ # Enable TCP wrapper access control. Default is "yes".
+ enable @var{arg:@i{<boolean>}};
- Two special keywords are also recognized:
+ # Set daemon name for TCP wrapper lookups. Default is program name.
+ daemon @var{name:@i{<string>}};
-@table @option
-@item all
-Print all information.
+ # Use file for positive client address access control (default:
+ # /etc/hosts.allow).
+ allow-table @var{file:@i{<string>}};
-@item none
-Do not print any statistics.
-@end table
+ # Use file for negative client address access control (default:
+ # /etc/hosts.deny).
+ deny-table @var{file:@i{<string>}};
-@xref{statistics}, for more information.
-@end deffn
+ # Log host allows at this syslog priority.
+ allow-syslog-priority @var{prio:@i{<string>}};
-@anchor{file-sweep-time}
-@deffn {Wydawca Statement} file-sweep-time @var{interval}
-Sets the amount of time after which any unprocessed file will be
-removed.
+ # Log host denies at this syslog priority.
+ deny-syslog-priority @var{prio:@i{<string>}};
+@}
- The @var{interval} is a string that defines a time interval, much
-the same way we do this in English: it consists of one or more pairs
-``@samp{number} @samp{time unit}''. For example, the following are
-valid interval specifications:
+# Set mailer URL
+mailer @var{url:@i{<string>}};
-@smallexample
-@group
-1 hour
-2 hours 35 seconds
-1 year 7 months 2 weeks 2 days 11 hours 12 seconds
-@end group
-@end smallexample
+# Set admin email address
+admin-address @var{email:@i{<string>}};
-@noindent
-The pairs can occur in any order, however unusual it may sound to a
-human ear, e.g. @samp{2 days 1 year}. If the @samp{time unit} is
-omitted, seconds are supposed.
-@end deffn
+# Set sender email address
+from-address @var{email:@i{<string>}};
-@deffn {Wydawca Statement} umask @var{value}
-Sets the umask to be used. The @var{value} must be octal.
-@end deffn
+# Define file sweep time
+file-sweep-time @var{interval:@i{<string>}};
-@deffn {Wydawca Statement} tar-program @var{string}
-Sets the file name of the @command{tar} utility. If @var{string} is
-not an absolute file name, it will be searched in @env{PATH}.
+# Set tar invocation command line
+tar-program @var{prog:@i{<string>}};
-@xref{archivation}, for more information on when this statement is needed.
-@end deffn
+# Set umask
+umask @var{mask:@i{<octal>}};
-@deffn {Wydawca Block Statement} sql @var{identifier}
-This statement begins a MySQL database definition. It may contain
-several sub-statements, defining how to access the database. The
-statement ends with the @code{end} keyword on a line by itself.
+# Print these stats at the end of run
+statistics @var{items:@i{<string>}};
-@xref{sql}, for more information.
+# Define SQL database
+sql @var{id:@i{<string>}} @{
+ # Set SQL server hostname or IP address
+ host @var{host:@i{<string>}};
-@var{Identifier} is the symbolic name that can be used in
-subsequent configuration statements to refer to this @acronym{SQL}
-database.
+ # Set database name
+ database @var{dbname:@i{<string>}};
-@smallexample
-sql default
- host localhost:/tmp/mysql.sock
- database savane
- user savane
- password guessme
-end
-@end smallexample
+ # Set SQL user name
+ user @var{name:@i{<string>}};
-The following statements are recognized within the @code{sql} block:
+ # Set SQL user password
+ password @var{arg:@i{<string>}};
+@}
-@anchor{sql-host}
-@deffn {Wydawca Statement} host @var{hostname}[:@var{port-or-socket}]
-Hostname where the database is running; @var{hostname} is either
-a symbolic hostname of the machine, or its IP address in usual
-@samp{dotted-quad} notation.
+# Configure syslog logging
+syslog @{
+ # Set syslog facility. Arg is one of the following: user, daemon, auth,
+ # authpriv, mail, cron, local0 through local7 (case-insensitive), or a
+ # facility number.
+ facility @var{name:@i{<string>}};
-The optional @var{port-or-socket} specifies port number (for
-@acronym{TCP} connections) or socket name (for @acronym{UNIX} sockets)
-to use. In the latter case, @var{hostname} may be omitted. If,
-however, it is present, it must be @samp{localhost}.
+ # Tag syslog messages with this string
+ tag @var{string:@i{<string>}};
-Examples:
+ # Prefix each message with its priority
+ print-priority @var{arg:@i{<boolean>}};
+@}
-@smallexample
-host 10.10.10.1
-host sql.server.com
-host sql.server.com:3100
-host localhost:/tmp/mysql.sock
-host /tmp/mysql.sock
-@end smallexample
-@end deffn
+# Define message text
+define-message @var{ident:@i{<string>}} @var{text:@i{<string>}};
-@deffn {Wydawca Statement} database @var{string}
-Specifies the database name.
-@end deffn
+# Set up archivation
+archive @var{type:@i{<string>}} @{
+ # Name of archive file or directory
+ name @var{file-or-dir:@i{<string>}};
-@deffn {Wydawca Statement} user @var{string}
-Specifies the database user name.
-@end deffn
+ # Define backup type
+ backup @var{type:@i{<string>}};
+@}
-@deffn {Wydawca Statement} password @var{string}
-Specifies the password.
-@end deffn
-@end deffn
+# Send statistics
+mail-statistics @{
+ # Message text
+ message @var{text:@i{<string>}};
-@deffn {Wydawca Block Statement} directory
-Defines a directory pair. The syntax is:
+ # Send mail if one or more of these items are set
+ statistics @var{items:@i{<string>}};
+@}
-@smallexample
-@group
-directory [@var{url}]
- source @var{name}
- destination @var{name}
- [@var{statements}]
-end
-@end group
-@end smallexample
+# Configure notification
+notify-event @{
+ # Event on which to notify
+ event @var{ev-id:@i{<string>}};
-@noindent
-where optional @var{url} specifies the @acronym{URL} of the
-distribution site defined by this directory (for diagnostic purposes),
-@code{source} and @code{destination} are two obligatory statements,
-defining source and distribution directories, and @var{statements} are
-any optional archive and/or access method definitions, overriding the
-global ones for this directory pair.
+ # Notify this recipient
+ recipient @var{who:@i{<string>}};
-@xref{spool}, for more information.
+ # Text of the notification or identifier of a defined message template
+ message @var{text-or-id:@i{<string>}};
+@}
-The following statements must be present in a @code{directory} block:
+# Define access method
+access-method @var{ident} @{
+ # Method type
+ type @var{type:@i{<string>}};
-@deffn {Wydawca Statement} source @var{dirname}
-Sets source directory name. The @var{dirname} must be an absolute file
-name.
-@end deffn
+ # Query template
+ query @var{string:@i{<string>}};
-@deffn {Wydawca Statement} destination @var{dirname}
-Sets source directory name. The @var{dirname} must be an absolute file
-name.
-@end deffn
-@end deffn
+ # Set method parameters
+ params @var{arg:@i{<list of string>}};
+@}
-@deffn {Wydawca Statement} gpg-key @var{type} @var{id} @var{command}
-@cindex @acronym{PGP} public key, retrieving
-@cindex public @acronym{PGP} key, retrieving
-Defines an access method for retrieving user's public @acronym{PGP}
-key.
+# Define distribution spool
+spool @var{tag:@i{<string>}} @{
+ # URL corresponding to this spool
+ url @var{arg:@i{<string>}};
-@xref{access methods}, for a detailed description.
-@end deffn
+ # Aliases
+ alias @var{arg:@i{<list of string>}};
-@deffn {Wydawca Statement} project-owner @var{type} @var{id} @var{command}
-Defines an access method for retrieving email addresses and real names
-of administrators (@dfn{owners}) of a project.
+ # Source directory
+ source @var{dir:@i{<string>}};
-@xref{access methods}, for a detailed description.
-@end deffn
+ # Destination directory
+ destination @var{dir:@i{<string>}};
-@deffn {Wydawca Statement} verify-user @var{type} @var{id} @var{command}
-Defines an access method for verifying if the user is allowed to make
-uploads for a certain project.
+ # Define file sweep time
+ file-sweep-time @var{interval:@i{<string>}};
-@xref{access methods}, for a detailed description.
-@end deffn
+ # Define access method
+ access-method @var{ident} @{
+ # Method type
+ type @var{type:@i{<string>}};
-@deffn {Wydawca Statement} user-data @var{type} @var{id} @var{command}
-Defines an access method for retrieving email address and real name of
-a user.
+ # Query template
+ query @var{string:@i{<string>}};
-@xref{access methods}, for a detailed description.
-@end deffn
+ # Set method parameters
+ params @var{arg:@i{<list of string>}};
+ @}
-@deffn {Wydawca Statement} admin-address @var{email}
-Sets email address or addresses to send administrator notification to.
+ # Set up archivation
+ archive @var{type:@i{<string>}} @{
+ # Name of archive file or directory
+ name @var{file-or-dir:@i{<string>}};
-@xref{statreports}.
-@end deffn
+ # Define backup type
+ backup @var{type:@i{<string>}};
+ @}
-@deffn {Wydawca Statement} from-address @var{email}
-Sets the sender address for mail notifications.
+ # Control implicit signature archivation
+ archive-signatures @var{arg:@i{<boolean>}};
-@xref{notification}, for more information on this statement.
-@end deffn
+ # Configure notification
+ notify-event @{
+ # Event on which to notify
+ event @var{ev-id:@i{<string>}};
-@deffn {Wydawca Statement} mail-admin-stat @var{msg-id} @var{condition-list}
-Defines statistics categories that trigger statistic reports.
+ # Notify this recipient
+ recipient @var{who:@i{<string>}};
-@xref{statreports}.
-@end deffn
+ # Text of the notification or identifier of a defined message template
+ message @var{text-or-id:@i{<string>}};
+ @}
+@}
-@deffn {Wydawca Statement} define-message
-Define a message template. The full syntax is:
+# Service names that request scanning all spools
+all-spools @var{arg:@i{<list of string>}};
-@smallexample
-define-message @var{id} [[-]@var{delimiter}]
-@var{lines}
-@var{delimiter}
@end smallexample
-@noindent
-where @var{id} supplies the template identifier, @var{lines} gives
-message headers and body, separated by a newline. If @var{delimiter}
-is prefixed by @samp{-}, any leading whitespace is removed from the
-template lines. If @var{delimiter} is not given, @samp{end} is
-assumed.
-
-@xref{templates}, for more information on message templates.
-@end deffn
-
-@deffn {Wydawca Statement} mailer @var{url}
-Sets the mailer @acronym{URL} to use.
-
-@xref{mailer}, for more information on mailers.
-@end deffn
-
@node invocation
@chapter @command{Wydawca} invocation summary.
@cindex invocation
@@ -2211,10 +2300,10 @@ implies @option{--debug --stderr}.
@opsummary{include-directory}
@item --include-directory=@var{dir}
-@itemx -I[@var{dir}]
+@itemx -I @var{dir}
Add @var{dir} to include search path.
-@FIXME-xref{include, File inclusion}.
+@xref{Pragmatic Comments, #include}.
@opsummary{lint}
@item --lint
diff --git a/src/config.c b/src/config.c
index 1cce5fc..11ac92d 100644
--- a/src/config.c
+++ b/src/config.c
@@ -278,15 +278,53 @@ cb_email_address (enum gconf_callback_command cmd,
void *cb_data)
{
int rc;
- mu_address_t addr;
+ mu_address_t addr = NULL;
- if (assert_string_arg (locus, cmd, value))
- return 1;
- rc = mu_address_create (&addr, value->v.string);
- if (rc)
- gconf_error (locus, 0, _("invalid email address: %s"), mu_strerror (rc));
- else
- *(mu_address_t*) varptr = addr;
+ switch (value->type)
+ {
+ case GCONF_TYPE_STRING:
+ rc = mu_address_create (&addr, value->v.string);
+ if (rc)
+ {
+ gconf_error (locus, 0, _("%s: invalid email address: %s"),
+ value->v.string, mu_strerror (rc));
+ return rc;
+ }
+ break;
+
+ case GCONF_TYPE_LIST:
+ {
+ const void *p;
+ gl_list_iterator_t itr = gl_list_iterator (value->v.list);
+
+ while (gl_list_iterator_next (&itr, &p, NULL))
+ {
+ const gconf_value_t *vp = p;
+ mu_address_t a;
+ if (assert_string_arg (locus, cmd, vp))
+ return 1;
+
+ rc = mu_address_create (&a, vp->v.string);
+ if (rc == 0)
+ rc = mu_address_union (&addr, a);
+ else
+ {
+ gconf_error (locus, 0, _("%s: invalid email address: %s"),
+ vp->v.string, mu_strerror (rc));
+ }
+ mu_address_destroy (&a);
+ if (rc)
+ break;
+ }
+ }
+ break;
+
+ case GCONF_TYPE_ARRAY:
+ gconf_error (locus, 0, _("too many arguments"));
+ return 1;
+ }
+
+ *(mu_address_t*) varptr = addr;
return rc;
}
diff --git a/src/mail.c b/src/mail.c
index ba77f49..5065306 100644
--- a/src/mail.c
+++ b/src/mail.c
@@ -249,7 +249,7 @@ mail_stats ()
admin_stat_message);
return;
}
- text = meta_expand_string (tmpl, exp, NULL);
+ text = meta_expand_string (tmpl, exp, NULL, NULL, NULL);
mail_send_message (admin_address, text);
@@ -264,7 +264,6 @@ get_recipient (struct access_method *method, struct file_triplet *trp,
char **errp)
{
unsigned nrows, ncols, i;
- struct metadef def[5];
mu_address_t rcpt = NULL;
char *text;
int rc;
@@ -283,10 +282,7 @@ get_recipient (struct access_method *method, struct file_triplet *trp,
return NULL;
}
- make_default_meta (def, trp->user, trp->project);
- meta_escape (method, md, def);
- text = meta_expand_string (method->query, def, NULL);
- meta_free (def);
+ text = triplet_expand_method_query (method, md, trp);
rc = method_run (method, md, text);
free (text);
diff --git a/src/meta.c b/src/meta.c
index e60651a..eb332f5 100644
--- a/src/meta.c
+++ b/src/meta.c
@@ -50,11 +50,12 @@ find_expansion_word (const char *kw, size_t len,
}
char *
-meta_expand_string (const char *string, struct metadef *def, void *data)
+meta_expand_string (const char *string, struct metadef *def, void *data,
+ struct access_method *method, void *handle)
{
const char *p, *s;
char *res;
- struct obstack stk;
+ struct obstack stk;
if (!string)
return NULL;
@@ -81,7 +82,17 @@ meta_expand_string (const char *string, struct metadef *def, void *data)
e = strchr (p + 1, '}');
if (e && (s = find_expansion_word (p + 1, e - p - 1, def, data)))
{
- obstack_grow (&stk, s, strlen (s));
+ if (method)
+ {
+ char *newval;
+ size_t len;
+ /* FIXME: Return value? */
+ method_quote_string (method, handle, s, &newval, &len);
+ obstack_grow (&stk, newval, len);
+ free (newval);
+ }
+ else
+ obstack_grow (&stk, s, strlen (s));
p = e + 1;
}
else
@@ -99,7 +110,18 @@ meta_expand_string (const char *string, struct metadef *def, void *data)
s = p - 1;
len = 1;
}
- obstack_grow (&stk, s, len);
+
+ if (method)
+ {
+ char *newval;
+ size_t len;
+ /* FIXME: Return value? */
+ method_quote_string (method, handle, s, &newval, &len);
+ obstack_grow (&stk, newval, len);
+ free (newval);
+ }
+ else
+ obstack_grow (&stk, s, len);
p++;
}
}
@@ -113,24 +135,6 @@ meta_expand_string (const char *string, struct metadef *def, void *data)
}
void
-meta_escape (struct access_method *method, void *handle, struct metadef *def)
-{
- for (; def->kw; def++)
- {
- if (def->value)
- {
- char *newval;
-
- /* FIXME: Return value? */
- method_quote_string (method, handle, def->value, &newval, NULL);
- if (def->storage)
- free (def->storage);
- def->value = def->storage = newval;
- }
- }
-}
-
-void
meta_free (struct metadef *def)
{
for (; def->kw; def++)
diff --git a/src/triplet.c b/src/triplet.c
index e060089..24ab611 100644
--- a/src/triplet.c
+++ b/src/triplet.c
@@ -481,7 +481,6 @@ fill_user_data (struct file_triplet *trp)
struct access_method *method = trp->spool->access_method[user_data_method];
char *text;
unsigned nrows, ncols;
- struct metadef def[5];
struct passwd *pw;
void *md;
@@ -498,10 +497,7 @@ fill_user_data (struct file_triplet *trp)
pw = getpwuid (TRIPLET_UID (trp));
if (!pw)
return;
- make_default_meta (def, pw->pw_name, trp->project);
- meta_escape (method, md, def);
- text = meta_expand_string (method->query, def, NULL);
- meta_free (def);
+ text = triplet_expand_method_query (method, md, trp);
rc = method_run (method, md, text);
free (text);
@@ -576,6 +572,30 @@ DECL_EXPAND_TIMER(system)
DECL_TIMER(name, user), \
DECL_TIMER(name, system)
+struct metadef triplet_default_meta[] = {
+ { "u", NULL, expand_user_name, NULL },
+ { "user", NULL, expand_user_name, NULL },
+ { "user:name", NULL, expand_user_name, NULL },
+ { "p", NULL, expand_project_base, NULL },
+ { "project", NULL, expand_project_base, NULL },
+ { "url", NULL, expand_url, NULL },
+ { "spool", NULL, expand_tag, NULL },
+ { "dir", NULL, expand_relative_dir, NULL },
+ { "dest-dir", NULL, expand_dest_dir, NULL },
+ { "source-dir", NULL, expand_source_dir, NULL },
+ { NULL }
+};
+
+char *
+triplet_expand_method_query (struct access_method *method, void *handle,
+ struct file_triplet *trp)
+{
+ char *p = meta_expand_string (method->query, triplet_default_meta, trp,
+ method, handle);
+ meta_free (triplet_default_meta);
+ return p;
+}
+
struct metadef triplet_meta[] = {
{ "project", NULL, expand_project_base, NULL },
{ "url", NULL, expand_url, NULL },
@@ -595,14 +615,14 @@ struct metadef triplet_meta[] = {
{ "report", NULL, expand_report, NULL },
DECL_FULL_TIMER(wydawca),
DECL_FULL_TIMER(triplet),
- DECL_FULL_TIMER(directory),
+ DECL_FULL_TIMER(spool),
{ NULL }
};
char *
triplet_expand_param (const char *tmpl, struct file_triplet *trp)
{
- char *p = meta_expand_string (tmpl, triplet_meta, trp);
+ char *p = meta_expand_string (tmpl, triplet_meta, trp, NULL, NULL);
meta_free (triplet_meta);
return p;
}
diff --git a/src/verify.c b/src/verify.c
index d419df5..15a2d8b 100644
--- a/src/verify.c
+++ b/src/verify.c
@@ -73,22 +73,6 @@ fill_project_name (struct file_triplet *trp)
return 0;
}
-void
-make_default_meta (struct metadef def[5], const char *user,
- const char *project)
-{
- memset (def, 0, 5 * sizeof(def[0]));
- def[0].kw = "u";
- def[0].value = (char*) user;
- def[1].kw = "user";
- def[1].value = (char*) user;
- def[2].kw = "p";
- def[2].value = (char*) project;
- def[3].kw = "project";
- def[3].value = (char*) project;
- def[4].kw = NULL;
-}
-
/* Verify if USER has upload rights on the directory (project) requested
by TRP */
int
@@ -99,7 +83,6 @@ check_access_rights (struct file_triplet *trp, const struct spool *spool,
int rc;
char *command;
const char *result;
- struct metadef def[5];
void *md;
struct group *grp;
@@ -119,11 +102,7 @@ check_access_rights (struct file_triplet *trp, const struct spool *spool,
if (!md)
return 1;
- make_default_meta (def, user, trp->project);
-
- meta_escape (method, md, def);
- command = meta_expand_string (method->query, def, NULL);
- meta_free (def);
+ command = triplet_expand_method_query (method, md, trp);
rc = method_run (method, md, command);
free (command);
@@ -156,7 +135,6 @@ verify_directive_file (struct file_triplet *trp, const struct spool *spool)
struct access_method *method = spool->access_method[gpg_key_method];
const char *pubkey;
int rc;
- struct metadef def[5];
void *md;
if (!trp->file[file_directive].name)
@@ -176,10 +154,7 @@ verify_directive_file (struct file_triplet *trp, const struct spool *spool)
trp->gid = pw->pw_gid;
trp->user = xstrdup (pw->pw_name);
- make_default_meta (def, trp->user, NULL);
- meta_escape (method, md, def);
- command = meta_expand_string (method->query, def, NULL);
- meta_free (def);
+ command = triplet_expand_method_query (method, md, trp);
rc = method_run (method, md, command);
free (command);
diff --git a/src/wydawca.h b/src/wydawca.h
index 1d18ea1..f6d6674 100644
--- a/src/wydawca.h
+++ b/src/wydawca.h
@@ -293,13 +293,9 @@ struct metadef
void *data;
};
-char *meta_expand_string (const char *string, struct metadef *def,
- void *data);
-void meta_escape (struct access_method *method, void *handle,
- struct metadef *def);
+char *meta_expand_string (const char *string, struct metadef *def, void *data,
+ struct access_method *method, void *handle);
void meta_free (struct metadef *def);
-void make_default_meta (struct metadef kwexp[5], const char *user,
- const char *project);
/* Global variables */
@@ -387,6 +383,8 @@ void register_file (struct file_info *finfo);
void enumerate_triplets (const struct spool *);
size_t count_collected_triplets (void);
char *triplet_expand_param (const char *tmpl, struct file_triplet *trp);
+char *triplet_expand_method_query (struct access_method *method, void *handle,
+ struct file_triplet *trp);
/* General-purpose method support */
struct access_method *method_new (enum access_method_id id,

Return to:

Send suggestions and report system problems to the System administrator.