|
From: Dan M. <d-...@uc...> - 2000-11-13 04:22:34
|
Hi everybody,
I've been sitting on this for a few days, hoping I will have time to
polish it up and fill in a few missing parts. Things have gotten very
busy for me though and the mailing list has gotten more active lately, so
I think it is best I just send this so everybody can see where we are at.
The main difference between this proposal and proposal #2 is the
installation method. We originally passed an argument to the installation
script which would announce where the new OMF files are at. The benefit
was that the OMF file could be installed anywhere (potentially even on a
different computer) and that ScrollKeeper would know exactly what to
install/uninstall without wasting any time finding out by other means.
The downside was that it made things somewhat complicated for developers
and packagers, since they had to prepare their metadata before
installation and pass more variables around. After talking with several
people about this, we were "strongly encouraged" to abort our previous
plan and have all of the OMF files installed in a central location and
then have the install script detect changes in this directory. The speed
penalty does not seem significant according to our tests, so I think the
benefit in terms of simplicity to developers and packagers as well as in
robustness against inevitable errors made by packagers outways the
slowdown.
Feedback is welcome :)
Dan
-----------
--------------------------------------
| ScrollKeeper 0.1 - Proposal #3 |
--------------------------------------
This document is arranged as follows:
I. Definitions and Overview
II. Building, Installing, and Uninstalling
III. Other Tools for Admin and Packaging
IV . ScrollKeeper Internals
V. Example File Snippits
I. Definitions and Overview
Contents List - This is a list of documents on the system (or more
generally, including docs which are not local to the single machine),
sorted into a tree. Generally the tree will be sorted by subject, probably
using a controlled list of subjects.
TOC (Table of Contents) - This is a tree representing the sections and
subsections of a document. The TOC can be extracted from an SGML/XML file.
Extended Contents List - This is the Contents List with the TOC for each
document merged into it. Thus, one can not only navigate through the
the docs on the system, but also the sections within each doc, all in
one tree.
Index - This is a list of terms/concepts with links to parts of a document
discussing each of the terms. This is often found at the back of printed
books. In DocBook, indexing information is manually inserted into the
document by an indexer using indexing markup. Thus, an Index can be
extracted from an SGML/XML file.
Generally a help browser will want to present all of the above information
to the user. The Contents List is determined from OMF metadata, either
from a standalone file or from a DocBook doc. The TOC and Index are generated
directly from the doc. Since all of this is metadata and must be accessed
rather frequently, and to avoid potential performance problems, this
metadata will be processed only at install and uninstall time. The
data will be stored in XML files for easy access by the help browser as
necessary.
II. Building, Installing, and Uninstalling
i. Building
The OMF documents are manipulated during the application
build process, generally as part of 'make all'. The purpose of this
is to (1) substitute the correct URL of the document where it will
actually be installed, which is not generally known until build time,
and to (2) extract the OMF from DocBook documents into a seperate file.
(NOTE: #2 may not be supported in ScrollKeeper 0.1)
This processing is done by 'scrollkeeper-preinstall'. This generally
takes three parameters: the URL for the installed document, the
original OMF metadata file in XML, and the name that the generated
OMF file should be written to. For example:
all:
<stuff>
scrollkeeper-preinstall file:$(DOCDIR)/foo-manual.sgml foo-manual-fr.omf omf-install/foo-manual-fr.omf
If the path where the generated OMF file does not exist, it is created.
So in this example, the IDENTIFIER in foo-manual-fr.omf is substituted with
a file URL which will point to the installed document and the
subsequent OMF file is written in a new directory called "omf-install".
Note that the OMF file is named <application>-<document_title>-<locale>.omf.
This is important to avoid collisions between OMF files when they are
installed.
ii. Installing
Installation is done by first copying the document and OMF file into
place and then having ScrollKeeper update its database by calling
'scrollkeeper-update'.
install:
install foo-manual.sgml $(DOCDIR)
install omf-install/foo-manual-fr.omf $(OMFDIR)
scrollkeeper-update -p $(SCROLLKEEPER_DB_DIR)
$(SCROLLKEEPER_DB_DIR) is the directory to use as the ScrollKeeper
database directory. If $(localstatedir) is set during the configure
stage, $(SCROLLKEEPER_DB_DIR) should be set to
$(localstatedir)/lib/scrollkeeper. If not, $(SCROLLKEEPER_DB_DIR)
should be set to `scrollkeeper-config --pkglocalstatedir`.
The -p option is important for building and testing purposes and should
always be used when packaging applications. When building RPMs, for
example, it guarantees that instead of actually modifying the primary
database on the builder's machine, it generates and modifies a new
database under BUILDROOT. It is clearly useful for testing purposes
as well.
scrollkeeper-update identifies the presence of a new OMF file in
OMFDIR and registers new metadata.
Uninstalling is done using 'scrollkeeper-update' as well.
uninstall:
rm $(DOCDIR)/foo-manual.sgml
rm $(OMFDIR)/foo-manual-fr.omf
scrollkeeper-update -p $(SCROLLKEEPER_DB_DIR)
scrollkeeper-update identifies that the OMF file was removed from
OMFDIR and unregisters the old metadata.
III. Other Tools for Admin and Packaging
In addition to the functions described above (scrollkeeper-preinstall
and scrollkeeper-update), ScrollKeeper provides the following additional
utilities:
scrollkeeper-rebuilddb:
This is used to rebuild the ScrollKeeper database completely using only
the original OMF files in OMFDIR. It also has a "-p" option which
allows one to specify the output directory of the newly created
database files.
scrollkeeper-config:
This is used to return various configuration paths for ScrollKeeper.
Options:
--help Prints scrollkeeper-config usage.
--version Prints Scrollkeeper version.
--prefix Scrollkeeper configure prefix. (eg. /usr)
--localstatedir Scrollkeeper configure localstatedir. (eg. /var)
--pkglocalstatedir Scrollkeeper data directory. (eg. /var/lib/scrollkeeper)
--pkgdatadir Scrollkeeper home directory. (eg. /usr/share/scrollkeeper)
--omfdir Directory where ScrollKeeper looks for OMF files.
(eg. /usr/doc/omf)
IV. ScrollKeeper Internals
This section describes some details about scrollkeeper functions.
$SCROLLKEEPER_DB_DIR is the directory where ScrollKeeper keeps its data
files. (It is typically under /var.)
$SCROLLKEEPER_DIR is the directory where ScrollKeeper installs its
static non-database files, such as the README and license files. (It is
typically under /usr or /share.)
$OMFDIR is the directory where packages must install their OMF files and
where ScrollKeeper looks to find OMF files. (This is typically
$prefix/doc/omf.)
scrollkeeper-update -p <scrollkeeper_db_dir>:
(Note: the -p flag is optional. If omitted, the path is determined
using `scrollkeeper-config --pkglocalstatedir`. However this flag
should not be omitted when scrollkeeper-update is used in Makefiles
since building often uses BUILDROOT's.)
It looks for added, removed, or updated files in OMFDIR and then calls
scrollkeeper-install and scrollkeeper-uninstall as necessary.
scrollkeeper-install -p <scrollkeeper_db_dir> <omfname>
1) Validate <omfname>
2) For each entry in <omfname> do the following:
A) Verify that the URL in the OMF entry exists. (eg. the file
it points to on the drive actually exists.) If it fails this
test, abort all further action on this OMF entry.
B) Add the entry to <scrollkeeper_db_dir>/scrollkeeper-docs.
(This file is created if it doesn't exist.) (see V. for format)
C) Update Contents List:
a) Determine title, language, and position(s) in Contents List from
TITLE, LANGUAGE, and SUBJECT.toc respectively.
b) Verify that the SUBJECT.toc lies within our controlled list
specified by `scrollkeeper-config --pkgdatadir`/contents-tree.xml
(Do we really want ScrollKeeper to rigorously enforce the
controlled list? Perhaps this should be left up to the help browser?)
c) Add this document to the Content List file in the appropriate
language's directory:
<scrollkeeper_db_dir>/<LANGUAGE>/scrollkeeper-contents-list.xml
(See IV. for format.) (Notice the doc ID is used as an attribute
to make it uninstallation easy.)
(This file is created if it doesn't exist.)
D) (for SGML and XML docs only) Extract TOC from doc, placing it
into a file: <scrollkeeper_db_dir>/TOC/<IDNUMBER>
(format to be determined)
(This file is created if it doesn't exist, or overwritten if it does.)
E) (for SGML and XML docs only) Insert TOC into an
"extended contents list". This is the Contents List with TOC listed
as a sub-tree for each doc. As above, the doc ID is used to make
uninstallation easy. This file is at
<scrollkeeper_db_dir>/<LANGUAGE>/scrollkeeper-extended-contents-list.xml
(This file is created if it doesn't exist.)
scrollkeeper-uninstall -p <scrollkeeper_db_dir> <omfname>
[ Fill in later. Should be trivial since the contents-lists and
toc are all identified by doc id.]
scrollkeeper-rebuilddb -p <scrollkeeper_db_dir>:
(Note: The option '-p' is optional. If omitted, the path is determined
using `scrollkeeper-config --pkglocalstatedir`.)
This will cause scrollkeeper to:
a) Move all of its files under <scrollkeeper_db_dir> into some
temporary location. (or maybe just delete them.)
b) Run scrollkeeper-update -p <scrollkeeper_db_dir> to enter
all OMF files into a new database in <scrollkeeper_db_dir>.
This can be used whenever the database is corrupted or becomes out-of-
date. It is also an easy (brute-force) way to allow for scrollkeeper
to update its databases when a new version is installed.
-- For use by help browsers --
scrollkeeper-get-contents-list <language>:
1) Returns the path:
${pkglocalstatedir}/<language>/scrollkeeper-contents-list.xml
scrollkeeper-get-extended-contents-list <language>:
1) Returns the path:
${pkglocalstatedir}/<language>/scrollkeeper-extended-contents-list.xml
scrollkeeper-get-toc-from-docpath <docpath>:
1) Looks in ${pkglocalstatedir}/scrollkeeper-docs to find doc id for <docpath>
2) Returns the path:
${pkglocalstatedir}/TOC/<docid>
[ Note that extending this all to include the Index should be very
similar. ]
V. Example File Snippits
scrollkeeper-docs:
This is used to keep track of which docs are on the system
(and possibly some remote docs), listing the location of
their OMF metadata, and identifying each doc by a code which
can be used to simplify uninstallation and some other tasks.
It also has a timestamp from when the OMF file was last written
so that scrollkeeper-update can detect when an OMF file has
been updated.
/usr/doc/omf/foo-manual-fr.omf 000001 /usr/doc/foo/foo-manual.sgml Sun Oct 29 13:48:50
/usr/doc/omf/bar-manual-en_US.omf 000002 /usr/doc/bar/bar-manual.sgml Tue Oct 24 02:47:28
/usr/doc/omf/foob-manual-da.omf 000003 /usr/doc/foob/foob-manual.sgml Tue Oct 24 02:47:28
contents-tree.xml:
This is the controlled list for valid Contents List sections.
scrollkeeper-contents-list.xml:
This is a simple XML file which reveals what the Contents List
looks like and where the OMF files and doc are at. This is used
by the help browser to display the Contents List.
[We will need to write up a simple DTD.]
<sect>
<title>Applications</title>
<sect>
<title>Games</title>
<doc docid="000050">
<doctitle>FreeCell</doctitle>
<docomf>/usr/local/games/freecell/freecell-omf.xml</docomf>
<docsource>/usr/local/games/freecell/freecell.sgml</docsource>
<docformat>SGML</docformat>
</doc>
</sect>
</sect>
TOC/<IDNUMBER>:
Contains a description of the sectioning layout of the doc.
It also must provide URI's for each doc section. If every
section has an "id", then this is straightforward. If not,
then .... (?? FILL THIS IN ??) (How should we store this?
XML or a flat file?)
scrollkeeper-extended-contents-list.xml:
Similar to scrollkeeper-contents-list.xml, except has TOC info in
it too. This is used by the help browser to display the
"extended Contents List".
<sect>
<title>Applications</title>
<sect>
<title>Games</title>
<doc docid="000050">
<doctitle>FreeCell</doctitle>
<docomf>/usr/local/games/freecell/freecell-omf.xml</docomf>
<docsource>/usr/local/games/freecell/freecell.sgml</docsource>
<docformat>SGML</docformat>
<toc>
<tocsect1 linkid="introduction">Introduction to FreeCell</tocsect1>
<tocsect1 linkid="playing">Playing FreeCell
<tocsect2 linkid="winning">Winning FreeCell</tocsect2>
</tocsect1>
</toc>
</doc>
</sect>
</sect>
foo-manual.omf:
[FIXME]
|
|
From: Nik C. <ni...@fr...> - 2000-11-13 09:48:36
|
On Sun, Nov 12, 2000 at 10:22:33PM -0600, Dan Mueth wrote:
> Hi everybody,
Ditto. A brief intro -- I'm the FreeBSD Documentation Project cat herder.
I was at the O'Reilly conference earlier this year, and I subscribed to this
list a few days ago. I've been working my way through the archives :-)
> Feedback is welcome :)
OK :-)
> --------------------------------------
> | ScrollKeeper 0.1 - Proposal #3 |
> --------------------------------------
>
> II. Building, Installing, and Uninstalling
>
> i. Building
>
> The OMF documents are manipulated during the application
> build process, generally as part of 'make all'. The purpose of this
> is to (1) substitute the correct URL of the document where it will
> actually be installed, which is not generally known until build time,
> and to (2) extract the OMF from DocBook documents into a seperate file.
> (NOTE: #2 may not be supported in ScrollKeeper 0.1)
You probably don't know where the application is going to be installed until
install time, not build time. Using the FreeBSD ports tree, it's trivial
to do
cd /usr/ports/foo/bar
make
make PREFIX=/somewhere/else install
Similarly, if you're building packages on BSD (or RPMs, or whatever) the
end user can change the install path after the package has been built, but
before it has been installed.
I know that FreeBSD packages and RPMs both support running commands after
the install -- I assume the .deb format does as well.
> Note that the OMF file is named <application>-<document_title>-<locale>.omf.
> This is important to avoid collisions between OMF files when they are
> installed.
Your examples don't use a sufficiently long <locale>. For example, the user
might install docs in Chinese, using both EUC and Big 5 encoding. For that,
you really need to be able to specify zh_CN.EUC and zh_TW.Big5.
Note that trying to rely on just zh_CN or zh_TW isn't sufficient for other
languages, like Japanese, where the various encodings hang off a ja_JP
prefix.
> Installation is done by first copying the document and OMF file into
> place and then having ScrollKeeper update its database by calling
> 'scrollkeeper-update'.
Seems reasonable.
> install:
> install foo-manual.sgml $(DOCDIR)
> install omf-install/foo-manual-fr.omf $(OMFDIR)
> scrollkeeper-update -p $(SCROLLKEEPER_DB_DIR)
An option to specify exactly where you installed the documentation is
probably a good idea, so that scrollkeeper-update doesn't have to rescan
a (potentially) huge directory tree of documentation.
> -- For use by help browsers --
> scrollkeeper-get-contents-list <language>:
> 1) Returns the path:
> ${pkglocalstatedir}/<language>/scrollkeeper-contents-list.xml
Should a lot of this stuff be implemented only as separate programs? What
about a scrollkeeper library that applications can link with that provides
functions that return this information from a config file somewhere. Having
to run several applications every time someone starts their help browser may
not be very efficient.
> scrollkeeper-contents-list.xml:
> This is a simple XML file which reveals what the Contents List
> looks like and where the OMF files and doc are at. This is used
> by the help browser to display the Contents List.
> [We will need to write up a simple DTD.]
>
> <sect>
> <title>Applications</title>
> <sect>
> <title>Games</title>
> <doc docid="000050">
> <doctitle>FreeCell</doctitle>
> <docomf>/usr/local/games/freecell/freecell-omf.xml</docomf>
> <docsource>/usr/local/games/freecell/freecell.sgml</docsource>
> <docformat>SGML</docformat>
> </doc>
> </sect>
> </sect>
<snip>
> scrollkeeper-extended-contents-list.xml:
> Similar to scrollkeeper-contents-list.xml, except has TOC info in
> it too. This is used by the help browser to display the
> "extended Contents List".
What's the rationale for keeping these separate? Any program iterating
over their contents should know whether it needs the extended information or
not, and ignore it, or process it, as necessary.
The choice of element or attribute in your sample is inconsistent. Either
something like
...
<doc id="00050" omf="..." source="..." format="sgml">
<title>Freecell</title>
</doc>
or
<doc>
<docid>00050</docid>
<title>...</title>
...
</doc>
might be better. When I first started writing DTDs, I was advised on
several mailing lists that if you expect to show content to the end user
(such as the title) then make it an element. Anything that is designed to
help the application (such as the format, or the source) is an attribute.
Of course, there's a case for saying that "Well, the application will be
able to show the user an icon for the source format, or the path to the
underlying document" so it's not a cut and dried decision. It's probably
best to consider what the default view would be.
N
--
Internet connection, $19.95 a month. Computer, $799.95. Modem, $149.95.
Telephone line, $24.95 a month. Software, free. USENET transmission,
hundreds if not thousands of dollars. Thinking before posting, priceless.
Somethings in life you can't buy. For everything else, there's MasterCard.
-- Graham Reed, in the Scary Devil Monastery
|
|
From: Will A. <wi...@ph...> - 2000-11-13 15:29:16
|
On Mon, Nov 13, 2000 at 09:48:25AM +0000, Nik Clayton wrote: > > The OMF documents are manipulated during the application > > build process, generally as part of 'make all'. The purpose of this > > is to (1) substitute the correct URL of the document where it will > > actually be installed, which is not generally known until build time, > > and to (2) extract the OMF from DocBook documents into a seperate file. > > (NOTE: #2 may not be supported in ScrollKeeper 0.1) > > You probably don't know where the application is going to be installed until > install time, not build time. Using the FreeBSD ports tree, it's trivial > to do > > cd /usr/ports/foo/bar > make > make PREFIX=/somewhere/else install > > Similarly, if you're building packages on BSD (or RPMs, or whatever) the > end user can change the install path after the package has been built, but > before it has been installed. On a similar topic.. Personally, I've always hoped that the ScrollKeeper protocol required a package listing. This would reduce turnaround time in creating FreeBSD ports, but probably has the drawback of being difficult to maintain for the application vendor, if there are a large number of files. However, it would be a nice thing.. I don't know what they use for debs, rpms and such, but PLISTs are currently the biggest pain in the ass for ports maintenance. Nik, I probably should have talked to you about this at BSDCon... sorry it didn't cross my mind at the aqarium. :-( -- wca |
|
From: Dan M. <d-...@uc...> - 2000-11-13 17:45:36
|
On Mon, 13 Nov 2000, Nik Clayton wrote:
> On Sun, Nov 12, 2000 at 10:22:33PM -0600, Dan Mueth wrote:
> > Hi everybody,
>
> Ditto. A brief intro -- I'm the FreeBSD Documentation Project cat herder.
> I was at the O'Reilly conference earlier this year, and I subscribed to this
> list a few days ago. I've been working my way through the archives :-)
>
> > Feedback is welcome :)
>
> OK :-)
>
> > --------------------------------------
> > | ScrollKeeper 0.1 - Proposal #3 |
> > --------------------------------------
> >
> > II. Building, Installing, and Uninstalling
> >
> > i. Building
> >
> > The OMF documents are manipulated during the application
> > build process, generally as part of 'make all'. The purpose of this
> > is to (1) substitute the correct URL of the document where it will
> > actually be installed, which is not generally known until build time,
> > and to (2) extract the OMF from DocBook documents into a seperate file.
> > (NOTE: #2 may not be supported in ScrollKeeper 0.1)
>
> You probably don't know where the application is going to be installed until
> install time, not build time. Using the FreeBSD ports tree, it's trivial
> to do
>
> cd /usr/ports/foo/bar
> make
> make PREFIX=/somewhere/else install
>
> Similarly, if you're building packages on BSD (or RPMs, or whatever) the
> end user can change the install path after the package has been built, but
> before it has been installed.
This would pose a significant problem. The original design installed each
document with something like:
scrollkeeper-install <omffile> <doc>
so that the path of the doc was given to ScrollKeeper at install
time. This would solve the problem of paths changing between build and
install time. However we decided to change the process to simplify things
for developers and packagers. (see the mailing list archives...)
I will have to consider this some more.
Anybody have an idea for a solution which is easy on the packagers but
solves the problem of people changing the default installation directory
of a package?
I would expect that changing the install path of a package after it is
built would often wreak havoc on it. Do people really do this very often,
and are most packages robust against this? (ie. Do we really have to
worry about this?)
> I know that FreeBSD packages and RPMs both support running commands after
> the install -- I assume the .deb format does as well.
>
> > Note that the OMF file is named <application>-<document_title>-<locale>.omf.
> > This is important to avoid collisions between OMF files when they are
> > installed.
>
> Your examples don't use a sufficiently long <locale>. For example, the user
> might install docs in Chinese, using both EUC and Big 5 encoding. For that,
> you really need to be able to specify zh_CN.EUC and zh_TW.Big5.
>
> Note that trying to rely on just zh_CN or zh_TW isn't sufficient for other
> languages, like Japanese, where the various encodings hang off a ja_JP
> prefix.
I don't think long locales pose any problems.
> > Installation is done by first copying the document and OMF file into
> > place and then having ScrollKeeper update its database by calling
> > 'scrollkeeper-update'.
>
> Seems reasonable.
>
> > install:
> > install foo-manual.sgml $(DOCDIR)
> > install omf-install/foo-manual-fr.omf $(OMFDIR)
> > scrollkeeper-update -p $(SCROLLKEEPER_DB_DIR)
>
> An option to specify exactly where you installed the documentation is
> probably a good idea, so that scrollkeeper-update doesn't have to rescan
> a (potentially) huge directory tree of documentation.
We originally had the location of the document passed, but this became
redundant when we had the build scripts update the OMF file to contain the
real path.
The only directory we scan is OMFDIR. These files tell us where all the
documentation is, so we never scan documentation trees.
> > -- For use by help browsers --
> > scrollkeeper-get-contents-list <language>:
> > 1) Returns the path:
> > ${pkglocalstatedir}/<language>/scrollkeeper-contents-list.xml
>
> Should a lot of this stuff be implemented only as separate programs? What
> about a scrollkeeper library that applications can link with that provides
> functions that return this information from a config file somewhere. Having
> to run several applications every time someone starts their help browser may
> not be very efficient.
Sure. We just thought we'd keep things simple for the first version.
> > scrollkeeper-contents-list.xml:
> > This is a simple XML file which reveals what the Contents List
> > looks like and where the OMF files and doc are at. This is used
> > by the help browser to display the Contents List.
> > [We will need to write up a simple DTD.]
> >
> > <sect>
> > <title>Applications</title>
> > <sect>
> > <title>Games</title>
> > <doc docid="000050">
> > <doctitle>FreeCell</doctitle>
> > <docomf>/usr/local/games/freecell/freecell-omf.xml</docomf>
> > <docsource>/usr/local/games/freecell/freecell.sgml</docsource>
> > <docformat>SGML</docformat>
> > </doc>
> > </sect>
> > </sect>
>
> <snip>
>
> > scrollkeeper-extended-contents-list.xml:
> > Similar to scrollkeeper-contents-list.xml, except has TOC info in
> > it too. This is used by the help browser to display the
> > "extended Contents List".
>
> What's the rationale for keeping these separate? Any program iterating
> over their contents should know whether it needs the extended information or
> not, and ignore it, or process it, as necessary.
Right. We could opt to dump the non-extended list, and always pass the
extended contents list. Until we get a feeling for how the performance
is, it may be nice to keep the non-extended list since it will be much
shorter.
> The choice of element or attribute in your sample is inconsistent. Either
> something like
>
> ...
> <doc id="00050" omf="..." source="..." format="sgml">
> <title>Freecell</title>
> </doc>
>
> or
>
> <doc>
> <docid>00050</docid>
> <title>...</title>
> ...
> </doc>
>
> might be better. When I first started writing DTDs, I was advised on
> several mailing lists that if you expect to show content to the end user
> (such as the title) then make it an element. Anything that is designed to
> help the application (such as the format, or the source) is an attribute.
>
> Of course, there's a case for saying that "Well, the application will be
> able to show the user an icon for the source format, or the path to the
> underlying document" so it's not a cut and dried decision. It's probably
> best to consider what the default view would be.
Don't they give any value to aesthetics? Mine is clearly the prettiest ;)
Actually I was following the convention you mention. Everything the help
browser is supposed to use is an element, and things which the help
browser isn't supposed to use (the docid) is an attribute. The docid is
only used by ScrollKeeper to make it easy to uninstall a document's
metadata.
Dan
|
|
From: Nik C. <ni...@fr...> - 2000-11-14 09:00:45
|
On Mon, Nov 13, 2000 at 11:45:26AM -0600, Dan Mueth wrote:
> > You probably don't know where the application is going to be installed until
> > install time, not build time. Using the FreeBSD ports tree, it's trivial
> > to do
> >
> > cd /usr/ports/foo/bar
> > make
> > make PREFIX=/somewhere/else install
> >
> > Similarly, if you're building packages on BSD (or RPMs, or whatever) the
> > end user can change the install path after the package has been built, but
> > before it has been installed.
>
> This would pose a significant problem. The original design installed each
> document with something like:
>
> scrollkeeper-install <omffile> <doc>
I think that's probably a bad idea. Each OS is going to have its own idea
of what program to use to physically install the document, and set the
ownership and permissions properly. I don't see much point in reinventing
install(1) or cp(1).
> so that the path of the doc was given to ScrollKeeper at install
> time. This would solve the problem of paths changing between build and
> install time. However we decided to change the process to simplify things
> for developers and packagers. (see the mailing list archives...)
I think it's probably better to provide a scrollkeeper configuration
file (in XML would be nice :-) ) that describes a list of paths down
which scrollkeeper (sk from now on) should recurse to look for new
documentation.
Most package systems should provide a mechanism to call scrollkeeper-install
after a document has been added to the system, ideally with the path in
which the document was installed. For those that don't, the system can
run something periodically that re-indexes the list of installed
documentation, in the same way that the apropos database is built at the
moment.
> I would expect that changing the install path of a package after it is
> built would often wreak havoc on it. Do people really do this very often,
> and are most packages robust against this? (ie. Do we really have to
> worry about this?)
Depends how well written the package is. Most of the FreeBSD ports install
with $PREFIX set to something other than /usr/local with no problems.
Also, keep in mind that some of these packages are going to consist of
nothing but documentation.
For example, *right now*, a FreeBSD user can do something like
pkg_add -r -p /opt/share/doc \
ftp://ftp.freebsd.org/pub/FreeBSD/doc/packages/handbook.en_US.ISO_8859-1.html.tgz
This will download the HTML version of the English FreeBSD handbook, and
install it under /opt/share/doc (instead of the more usual /usr/share/doc).
Now, pkg_add in FreeBSD has hooks to allow post-install scripts to be
run, that could call an sk command to update the index. But the sysadmin
should also be free to create /usr/local/etc/scrollkeeper.cf, and make sure
that "/opt/share/doc/" is listed as a directory to be indexed.
> > Your examples don't use a sufficiently long <locale>. For example, the user
> > might install docs in Chinese, using both EUC and Big 5 encoding. For that,
> > you really need to be able to specify zh_CN.EUC and zh_TW.Big5.
> >
> > Note that trying to rely on just zh_CN or zh_TW isn't sufficient for other
> > languages, like Japanese, where the various encodings hang off a ja_JP
> > prefix.
>
> I don't think long locales pose any problems.
As long as people are aware of the issue, that's all.
N
--
Internet connection, $19.95 a month. Computer, $799.95. Modem, $149.95.
Telephone line, $24.95 a month. Software, free. USENET transmission,
hundreds if not thousands of dollars. Thinking before posting, priceless.
Somethings in life you can't buy. For everything else, there's MasterCard.
-- Graham Reed, in the Scary Devil Monastery
|
|
From: Laszlo K. <las...@su...> - 2000-11-14 09:40:02
|
> > This would pose a significant problem. The original design installed each > > document with something like: > > > > scrollkeeper-install <omffile> <doc> > > I think that's probably a bad idea. Each OS is going to have its own idea > of what program to use to physically install the document, and set the > ownership and permissions properly. I don't see much point in reinventing > install(1) or cp(1). This is a misunderstanding. It is an addition to install and cp, not a reinvention. It installs the doc into the Scrollkeeper database after it was installed with install or cp to the right location. > I think it's probably better to provide a scrollkeeper configuration > file (in XML would be nice :-) ) that describes a list of paths down > which scrollkeeper (sk from now on) should recurse to look for new > documentation. There will be some solution in the future to extend the one directory where metadata files are now to a set of directories. This is for metadata only, Scrollkeeper intends to support cataloging of docs based anywhere locally and on the web, this is why we thought the metadata should contain the url. > Most package systems should provide a mechanism to call scrollkeeper-install > after a document has been added to the system, ideally with the path in > which the document was installed. For those that don't, the system can > run something periodically that re-indexes the list of installed > documentation, in the same way that the apropos database is built at the > moment. The problem with this is that packagers will have to create large postinstall scripts to get it working right and some of the people on this list think they will not do it if the changes are not as simple as possible. If we disregard the packagers possible reaction then most/all of the Scrollkeeper related process should be launched from postinstall scripts. But as I said some people strongly opposed that. > Depends how well written the package is. Most of the FreeBSD ports install > with $PREFIX set to something other than /usr/local with no problems. > > Also, keep in mind that some of these packages are going to consist of > nothing but documentation. > > For example, *right now*, a FreeBSD user can do something like > > pkg_add -r -p /opt/share/doc \ > ftp://ftp.freebsd.org/pub/FreeBSD/doc/packages/handbook.en_US.ISO_8859-1.html.tgz > > This will download the HTML version of the English FreeBSD handbook, and > install it under /opt/share/doc (instead of the more usual /usr/share/doc). > > Now, pkg_add in FreeBSD has hooks to allow post-install scripts to be > run, that could call an sk command to update the index. But the sysadmin > should also be free to create /usr/local/etc/scrollkeeper.cf, and make sure > that "/opt/share/doc/" is listed as a directory to be indexed. This suggestion does work only if the doc is locally installed, what if I point to a page on the web, where the document is? Laszlo |
|
From: Nik C. <ni...@fr...> - 2000-11-14 16:01:08
|
On Tue, Nov 14, 2000 at 09:39:56AM +0000, Laszlo Kovacs wrote: > > > This would pose a significant problem. The original design installed each > > > document with something like: > > > > > > scrollkeeper-install <omffile> <doc> > > > > I think that's probably a bad idea. Each OS is going to have its own idea > > of what program to use to physically install the document, and set the > > ownership and permissions properly. I don't see much point in reinventing > > install(1) or cp(1). > > This is a misunderstanding. It is an addition to install and cp, not a > reinvention. It installs the doc into the Scrollkeeper database after it > was installed with install or cp to the right location. Ah, OK. [snip] > > Most package systems should provide a mechanism to call scrollkeeper-install > > after a document has been added to the system, ideally with the path in > > which the document was installed. For those that don't, the system can > > run something periodically that re-indexes the list of installed > > documentation, in the same way that the apropos database is built at the > > moment. > > The problem with this is that packagers will have to create large > postinstall scripts to get it working right and some of the people on > this list think they will not do it if the changes are not as simple as > possible. If we disregard the packagers possible reaction then most/all > of the Scrollkeeper related process should be launched from postinstall > scripts. But as I said some people strongly opposed that. How large? Installing the documentation and running a scrollkeeper command should be as trivial as installing a new library and having to run ldconfig after the install. N -- Internet connection, $19.95 a month. Computer, $799.95. Modem, $149.95. Telephone line, $24.95 a month. Software, free. USENET transmission, hundreds if not thousands of dollars. Thinking before posting, priceless. Somethings in life you can't buy. For everything else, there's MasterCard. -- Graham Reed, in the Scary Devil Monastery |
|
From: Laszlo K. <las...@su...> - 2000-11-14 16:29:35
|
> How large? > > Installing the documentation and running a scrollkeeper command should be > as trivial as installing a new library and having to run ldconfig after > the install. Each would be described by a separate metadata file (or it can be one only for the whole package). A script has to be run at postinstall that changes the url(s) in the metadata file to the final installed path of the doc. Then the scrollkeeper-update binary has to be run. Hopefully I did not forget anything. This can be from 2 lines to (the number of docs + 1) lines in the postinstall script, depending on whether one big metadata file is used for the package or a separate one for each doc. In the first case the url changing script will have a very long command line. I assume that the relocation path is available in the postinstall script in every packaging system. Laszlo |
|
From: Gregory L. <gle...@cu...> - 2000-11-14 16:55:49
|
I'm going to snip this CC: line as I assume everybody is on the list,
and that you don't really need two copies of this stuff.
> On Tue, Nov 14, 2000 at 09:39:56AM +0000, Laszlo Kovacs wrote:
> > > Most package systems should provide a mechanism to call scrollkeeper-install
> > > after a document has been added to the system, ideally with the path in
> > > which the document was installed. For those that don't, the system can
> > > run something periodically that re-indexes the list of installed
> > > documentation, in the same way that the apropos database is built at the
> > > moment.
> >
> > The problem with this is that packagers will have to create large
> > postinstall scripts to get it working right and some of the people on
> > this list think they will not do it if the changes are not as simple as
> > possible. If we disregard the packagers possible reaction then most/all
> > of the Scrollkeeper related process should be launched from postinstall
> > scripts. But as I said some people strongly opposed that.
>
> How large?
>
> Installing the documentation and running a scrollkeeper command should be
> as trivial as installing a new library and having to run ldconfig after
> the install.
This is how the current implementation works. The packager adds a line
that says 'scrollkeeper-update' in their post-install script, which
works in a similar manner to ldconfig. I'd recomend download from CVS
and building Scrollkeeper. It takes less than 5 minutes to download,
configure, build, and install here, and then I can take a look at the
source and the stuff that gets installed, so it's easy to answer
questions. Mind you, it changes a lot from day to day, but it's still a
tiny job to update it if I want to take a look.
Greg
|