aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2009-02-28 18:54:48 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2009-02-28 18:54:48 +0200
commit5fc738e4d43eb708428c4b30e60e570e2dd55470 (patch)
treea96f33c70162ff8a825b800fc9276360d95d154a
parent514797c56e431f37de9a00834281f990a7b15c46 (diff)
downloadwydawca-5fc738e4d43eb708428c4b30e60e570e2dd55470.tar.gz
wydawca-5fc738e4d43eb708428c4b30e60e570e2dd55470.tar.bz2
Various fixes
* doc/Makefile.am: Improve checking and final rules. * doc/fdl.texi, doc/rendition.texi: Use single-space sentence separators. * doc/wydawca.texi: Update. * src/config.c (cb_email_address): Accept a list of addresses. * src/meta.c (meta_expand_string): Take two additional arguments. Quote expansions if they are provided. * src/triplet.c (triplet_expand_method_query): New function. * src/mail.c, src/verify.c: Use triplet_expand_method_query * src/wydawca.h: Update. * src/meta.c (meta_escape): Remove.
-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
@@ -38,18 +38,26 @@ manual:
TEXINPUTS=$(srcdir):$(top_srcdir)/build-aux:$(TEXINPUTS) \
MAKEINFO="$(MAKEINFO) $(MAKEINFOFLAGS)" \
TEXI2DVI="$(TEXI2DVI) -t @finalout" \
$(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' \
'/@c option --/{s///;s/^\(help\|version\|usage\)//;p}' \
$(top_srcdir)/src/cmdline.opt -- \
$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) -E - \
@@ -67,13 +75,13 @@ check-fixmes:
sed -n 'N;/@FIXME{/{s/\(^[0-9][0-9]*\).*@FIXME{\([^}]*\).*/$(info_TEXINFOS):\1: \2/gp}' > $@-t; \
if [ -s $@-t ]; then echo "Unresolved FIXMEs:"; cat $@-t;\
fi
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; \
rm $@-t; \
false;\
else \
@@ -99,8 +107,17 @@ check-docs:
master-menu:
emacs -batch -l mastermenu.el -f make-master-menu $(info_TEXINFOS)
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
@@ -20,34 +20,34 @@ assure everyone the effective freedom to copy and redistribute it,
with or without modifying it, either commercially or noncommercially.
Secondarily, this License preserves for the author and publisher a way
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
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.
A ``Modified Version'' of the Document means any work containing the
Document or a portion of it, either copied verbatim, or with
modifications and/or translated into another language.
@@ -62,52 +62,52 @@ any mathematics.) The relationship could be a matter of historical
connection with the subject or with related matters, or of legal,
commercial, philosophical, ethical or political position regarding
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,
represented in a format whose specification is available to the
general public, that is suitable for revising the document
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},
PostScript or @acronym{PDF} produced by some word processors for
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.
A section ``Entitled XYZ'' means a named subunit of the Document whose
title either is precisely XYZ or contains XYZ in parentheses following
@@ -115,29 +115,29 @@ text that translates XYZ in another language. (Here XYZ stands for a
specific section name mentioned below, such as ``Acknowledgements'',
``Dedications'', ``Endorsements'', or ``History''.) To ``Preserve the Title''
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
no effect on the meaning of this License.
@item
VERBATIM COPYING
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
you may publicly display copies.
@item
@@ -145,16 +145,16 @@ COPYING IN QUANTITY
If you publish printed copies (or copies in media that commonly have
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.
If the required texts for either cover are too voluminous to fit
legibly, you should put the first ones listed (as many as fit
@@ -183,20 +183,20 @@ MODIFICATIONS
You may copy and distribute a Modified Version of the Document under
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
List on the Title Page, as authors, one or more persons or entities
responsible for authorship of the modifications in the Modified
Version, together with at least five of the principal authors of the
@@ -226,40 +226,40 @@ and required Cover Texts given in the Document's license notice.
@item
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
Version as stated in the previous sentence.
@item
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.
@item
For any section Entitled ``Acknowledgements'' or ``Dedications'', Preserve
the Title of the section, and preserve in the section all the
substance and tone of each of the contributor acknowledgements and/or
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
Do not retitle any existing section to be Entitled ``Endorsements'' or
to conflict in title with any Invariant Section.
@@ -267,27 +267,27 @@ to conflict in title with any Invariant Section.
Preserve any Warranty Disclaimers.
@end enumerate
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.
You may add a section Entitled ``Endorsements'', provided it contains
nothing but endorsements of your Modified Version by various
parties---for example, statements of peer review or that the text has
been approved by an organization as the authoritative definition of a
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
permission from the previous publisher that added the old one.
The author(s) and publisher(s) of the Document do not by this License
@@ -303,23 +303,23 @@ versions, provided that you include in the combination all of the
Invariant Sections of all of the original documents, unmodified, and
list them all as Invariant Sections of your combined work in its
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.
Make the same adjustment to the section titles in the list of
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
COLLECTIONS OF DOCUMENTS
You may make a collection consisting of the Document and other documents
@@ -358,51 +358,51 @@ TRANSLATION
Translation is considered a kind of modification, so you may
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.
If a section in the Document is Entitled ``Acknowledgements'',
``Dedications'', or ``History'', the requirement (section 4) to Preserve
its Title (section 1) will typically require changing the actual
title.
@item
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.
@item
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.
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
@page
@appendixsec ADDENDUM: How to use this License for your documents
diff --git a/doc/rendition.texi b/doc/rendition.texi
index 45ac068..5d04105 100644
--- a/doc/rendition.texi
+++ b/doc/rendition.texi
@@ -2,16 +2,16 @@
@c I extended it by adding a FIXME_FOOTNOTE variable, which controls
@c whether FIXME information should be placed in footnotes or
@c inlined.
@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 ======================================================================
@c Set this symbol if you wish FIXMEs to appear in footnotes, instead
@c of being inserted into the text.
diff --git a/doc/wydawca.texi b/doc/wydawca.texi
index 589f2f7..237f196 100644
--- a/doc/wydawca.texi
+++ b/doc/wydawca.texi
@@ -34,17 +34,17 @@ Boston, MA 02110-1301, USA
Copyright @copyright{} 2007, 2009 Sergey Poznyakoff
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
@titlepage
@title Wydawca Manual
@subtitle version @value{VERSION}, @value{UPDATED}
@@ -86,26 +86,47 @@ already listed, mentioned here so you can get to them in one step:
@detailmenu
--- The Detailed Node Listing ---
How to Configure @command{wydawca}.
+* Syntax:: Configuration file syntax.
* syslog::
* sql::
* access methods::
* archivation::
* spool::
* 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
@node Intro
@chapter Introduction to Wydawca
@@ -181,14 +202,14 @@ effective and consumes little resources.
@node overview
@chapter Operation Overview
@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
@acronym{NFS}. Future versions will contain special provisions for
that case.
@@ -229,13 +250,13 @@ maintain, Information for maintainers of GNU software}.
Standalone directives}.
@end ifhtml
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.
Then, the utility ensures that each of the remaining triplets is
created by a single person. Any triplets that do not are immediately
removed.
@@ -351,13 +372,13 @@ reports them on its error output and exits with a non-zero status.
other inconsistencies and to exit with status 0 if no errors were
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.
@xopindex{config-help, introduced}
The rest of this section describes the configuration file syntax in
@@ -380,19 +401,20 @@ directives any time by running @command{wydawca --config-help}.
Wydawca configuration file consists of statements and comments.
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
@subsection Comments
@cindex Comments in a configuration file
@cindex single-line comments
@@ -466,22 +488,22 @@ If the latter is absent, the remembered file name does not change.
This is a special form of @code{#line} statement, understood for
compatibility with the @sc{c} preprocessor.
@end table
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
@cindex statements, configuration file
@cindex configuration file statements
@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:
@smallexample
daemon yes;
@@ -558,22 +580,60 @@ example above:
@group
"a long string may be"
" split over several lines"
@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
A @dfn{here-document} is a special construct that allows to introduce
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
<<EOT
A multiline
string
@@ -654,13 +714,49 @@ spool download @{
@}
@end group
@end smallexample
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
@kwindex syslog
Unless told otherwise, @command{wydawca} uses @code{syslog} to print
@@ -743,13 +839,13 @@ database.
@deffn {Configuration} host @var{hostname}[:@var{port-or-socket}]
Set the hostname or @acronym{IP} address of the host running the
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}
Specifies the database name.
@end deffn
@@ -794,13 +890,13 @@ access-method @var{method-name} @{
params (@var{param1},@var{param2},...);
@}
@end smallexample
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.
There are four access methods, identified by the value of
@var{method-name} tag:
@@ -853,30 +949,49 @@ future use.
See below for a detailed description of these access methods.
@end deffn
@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
@kwindex u
@kwindex user
@item u
@itemx user
+@itemx user:name
The system name of the user that submitted the triplet.
@kwindex p
@kwindex project
@item p
@itemx project
The system name of the project for which the triplet is
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
@deffn {Configuration} params (@var{param1}, @var{param2}, ...)
Supplies additional parameters for the method.
@end deffn
@@ -937,17 +1052,17 @@ consisting of two columns: an email address and a user name, in this order.
@smallexample
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
@node user-data-sql
@subsubsection User-data-sql: an SQL Implementation
@cindex user-data
@@ -969,17 +1084,17 @@ access-method user-data @{
@smallexample
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
@node builtin type
@subsection Built-in access methods
@@ -1007,13 +1122,13 @@ their existing files.
@cindex archivation methods
@kwindex archive
@code{Wydawca} supports two basic archivation methods: to a
@command{tar} file, and