[PATCH] make configure and generated main.xml's more "spec-valid"
According to the W3C XML specification, and to the DocBook guide at http://www.docbook.org/tdg/en/html/docbook.html , the system identifier of the DTD should be URI. Now the XML spec shows simple "hello.dtd" as example, so this is quite valid, but the DocBook suggests file://path URIs which are correct local file URIs. The attached patch makes configure use file:// when appropriate, and also fall back to internet-available DTD if no local was found, which didn't cause problem on my box (except for a bit slower testing) and is IMHO better than hard-coding already tested and non-existent path. OK to apply? Torinthiel -- Waclaw "Torinthiel" Schiller GG#: 3073512 torinthiel(at)megapolis(dot)pl gpg: 0906A2CE fpr: EE3E DFB4 C4D6 E22E 8999 D714 7CEB CDDC 0906 A2CE "No classmates may be used during this examination"
Hi, On 4 Jan 2007 12:13 Torinthiel wrote:
According to the W3C XML specification, and to the DocBook guide at http://www.docbook.org/tdg/en/html/docbook.html , the system identifier of the DTD should be URI. Now the XML spec shows simple "hello.dtd" as example, so this is quite valid, but the DocBook suggests file://path URIs which are correct local file URIs. The attached patch makes configure use file:// when appropriate, and also fall back to internet-available DTD if no local was found, which didn't cause problem on my box (except for a bit slower testing) and is IMHO better than hard-coding already tested and non-existent path.
And what if I have no access to internet at compile time or if I don't want to waste my traffic? Imho it is bad idea to access internet for compilation purposes without expilcit user permission to do this. Programs shouldn't surf the internet on their own. This can be optional but _not_ default behaviour.
On Thu, Jan 04, 2007 at 12:40:45PM +0300, Andrew Savchenko wrote:
Hi,
On 4 Jan 2007 12:13 Torinthiel wrote:
According to the W3C XML specification, and to the DocBook guide at http://www.docbook.org/tdg/en/html/docbook.html , the system identifier of the DTD should be URI. Now the XML spec shows simple "hello.dtd" as example, so this is quite valid, but the DocBook suggests file://path URIs which are correct local file URIs. The attached patch makes configure use file:// when appropriate, and also fall back to internet-available DTD if no local was found, which didn't cause problem on my box (except for a bit slower testing) and is IMHO better than hard-coding already tested and non-existent path.
And what if I have no access to internet at compile time or if I don't want to waste my traffic?
Than you install proper local DTDs in some more or less standard location and if that won't work you add that path to configure and send patch. You should do so anyway.
Imho it is bad idea to access internet for compilation purposes without expilcit user permission to do this. Programs shouldn't surf the internet on their own. This can be optional but _not_ default behaviour.
It's not default. It's fallback if everything else fails. Current behaviour guarantees failure, as it sets the _required_ DTD path to a path that already was checked and didn't contain the DTD. A fallback to internet at least gives some chances of success. If it's really an issue I can modify patch to use http only if --use-http was passed to configure, but there are some problems with it: 1) It'll be the first command-line argument to configure. More will likely follow, so some proper general parsing is to be done. 2) what if user passed --use-http and proper DTD exists? Which one should be used? Maybe two different options --fallback-to-http and --force-http? Even more ugly. And it makes configure more complicated, like the main one is. Torinthiel -- Waclaw "Torinthiel" Schiller GG#: 3073512 torinthiel(at)megapolis(dot)pl gpg: 0906A2CE fpr: EE3E DFB4 C4D6 E22E 8999 D714 7CEB CDDC 0906 A2CE "No classmates may be used during this examination"
On 4 Jan 2007 14:03 Torinthiel wrote:
On Thu, Jan 04, 2007 at 12:40:45PM +0300, Andrew Savchenko wrote:
Hi,
On 4 Jan 2007 12:13 Torinthiel wrote:
According to the W3C XML specification, and to the DocBook guide at http://www.docbook.org/tdg/en/html/docbook.html , the system identifier of the DTD should be URI. Now the XML spec shows simple "hello.dtd" as example, so this is quite valid, but the DocBook suggests file://path URIs which are correct local file URIs. The attached patch makes configure use file:// when appropriate, and also fall back to internet-available DTD if no local was found, which didn't cause problem on my box (except for a bit slower testing) and is IMHO better than hard-coding already tested and non-existent path.
And what if I have no access to internet at compile time or if I don't want to waste my traffic?
Than you install proper local DTDs in some more or less standard location and if that won't work you add that path to configure and send patch. You should do so anyway.
Local DTD is currently detected in my system. But if it will not for some reason? Of if there are some people with no DTDs in default path? Interesting, there are my locations of dtd's: --- $ locate docbookx.dtd /usr/share/apps/ksgmltools2/docbook/xml-dtd-4.1.2/docbookx.dtd /usr/share/apps/ksgmltools2/docbook/xml-dtd-4.2/docbookx.dtd /usr/share/sgml/docbook/sgml-dtd-4.4-1.0-26/docbookx.dtd /usr/share/sgml/docbook/sgml-dtd-4.3-1.0-26/docbookx.dtd /usr/share/sgml/docbook/sgml-dtd-4.2-1.0-26/docbookx.dtd /usr/share/sgml/docbook/xml-dtd-4.3-1.0-26/docbookx.dtd /usr/share/sgml/docbook/xml-dtd-4.2-1.0-26/docbookx.dtd /usr/share/sgml/docbook/xml-dtd-4.4-1.0-26/docbookx.dtd /usr/share/sgml/docbook/xml-dtd-4.1.2-1.0-26/docbookx.dtd --- However, only the last location could be detected with current configure script.
Imho it is bad idea to access internet for compilation purposes without expilcit user permission to do this. Programs shouldn't surf the internet on their own. This can be optional but _not_ default behaviour.
It's not default. It's fallback if everything else fails. Current behaviour guarantees failure, as it sets the _required_ DTD path to a path that already was checked and didn't contain the DTD. A fallback to internet at least gives some chances of success.
Yes it is usefull in such case, but I don't want to allow any progams to access internet beyond my eyes and without my permission.
If it's really an issue I can modify patch to use http only if --use-http was passed to configure, but there are some problems with it: 1) It'll be the first command-line argument to configure. More will likely follow, so some proper general parsing is to be done.
Maybe bash builtin getopt will help? If you don't want rely on bash, you may use external getopt program.
2) what if user passed --use-http and proper DTD exists? Which one should be used? Maybe two different options --fallback-to-http and --force-http? Even more ugly. And it makes configure more complicated, like the main one is.
Perhaps, another solution exists: issue an error message about missing DTD, and print help message with link to the address from which DTD must be downloaded?
On Thu, Jan 04, 2007 at 04:38:32PM +0300, Andrew Savchenko wrote:
Local DTD is currently detected in my system. But if it will not for some reason? Of if there are some people with no DTDs in default path?
For what reason? Either the file exists, and it is detected, or not. If there are some people without DTDs, then right now they're doomed. With this patch and an active internet connection they can build the docs.
Interesting, there are my locations of dtd's: --- $ locate docbookx.dtd /usr/share/apps/ksgmltools2/docbook/xml-dtd-4.1.2/docbookx.dtd /usr/share/apps/ksgmltools2/docbook/xml-dtd-4.2/docbookx.dtd /usr/share/sgml/docbook/sgml-dtd-4.4-1.0-26/docbookx.dtd /usr/share/sgml/docbook/sgml-dtd-4.3-1.0-26/docbookx.dtd /usr/share/sgml/docbook/sgml-dtd-4.2-1.0-26/docbookx.dtd /usr/share/sgml/docbook/xml-dtd-4.3-1.0-26/docbookx.dtd /usr/share/sgml/docbook/xml-dtd-4.2-1.0-26/docbookx.dtd /usr/share/sgml/docbook/xml-dtd-4.4-1.0-26/docbookx.dtd /usr/share/sgml/docbook/xml-dtd-4.1.2-1.0-26/docbookx.dtd --- However, only the last location could be detected with current configure script.
See the attached patch, it should detect some more paths ;) Diego, should I?
Imho it is bad idea to access internet for compilation purposes without expilcit user permission to do this. Programs shouldn't surf the internet on their own. This can be optional but _not_ default behaviour.
It's not default. It's fallback if everything else fails. Current behaviour guarantees failure, as it sets the _required_ DTD path to a path that already was checked and didn't contain the DTD. A fallback to internet at least gives some chances of success.
Yes it is usefull in such case, but I don't want to allow any progams to access internet beyond my eyes and without my permission.
OK, that's your POV. Mine is 'Don't provide as default something that is guaranteed not to work'. And each one has some logic behind it. Let's delay this for some time. And how about the first part of patch (file:// URIs)?
If it's really an issue I can modify patch to use http only if --use-http was passed to configure, but there are some problems with it: 1) It'll be the first command-line argument to configure. More will likely follow, so some proper general parsing is to be done.
Maybe bash builtin getopt will help? If you don't want rely on bash, you may use external getopt program.
I think something along what's now in trunk/configure is better. getopt is good, but for short options, which I don't find attractive in a run once in a loong while script.
2) what if user passed --use-http and proper DTD exists? Which one should be used? Maybe two different options --fallback-to-http and --force-http? Even more ugly. And it makes configure more complicated, like the main one is.
Perhaps, another solution exists: issue an error message about missing DTD, and print help message with link to the address from which DTD must be downloaded?
Not good enough IMHO. The DocBook DTD consists of several files, downloading just one is not enough. And anyone is better of installing them in some standard location and in one piece, and this is distro-specific. And just thought of another issue with adding options to configure: 3) the script absolutely has to remember the options with which it was run, as it is sometimes re-run automatically. This has caused some problems in trunk/configure. Torinthiel -- Waclaw "Torinthiel" Schiller GG#: 3073512 torinthiel(at)megapolis(dot)pl gpg: 0906A2CE fpr: EE3E DFB4 C4D6 E22E 8999 D714 7CEB CDDC 0906 A2CE "No classmates may be used during this examination"
Hi, On 1/4/07, Torinthiel <torinthiel@megapolis.pl> wrote:
On Thu, Jan 04, 2007 at 04:38:32PM +0300, Andrew Savchenko wrote:
Local DTD is currently detected in my system. But if it will not for some reason? Of if there are some people with no DTDs in default path?
For what reason? Either the file exists, and it is detected, or not. If there are some people without DTDs, then right now they're doomed. With this patch and an active internet connection they can build the docs.
Interesting, there are my locations of dtd's: --- $ locate docbookx.dtd /usr/share/apps/ksgmltools2/docbook/xml-dtd-4.1.2/docbookx.dtd /usr/share/apps/ksgmltools2/docbook/xml-dtd-4.2/docbookx.dtd /usr/share/sgml/docbook/sgml-dtd-4.4-1.0-26/docbookx.dtd /usr/share/sgml/docbook/sgml-dtd-4.3-1.0-26/docbookx.dtd /usr/share/sgml/docbook/sgml-dtd-4.2-1.0-26/docbookx.dtd /usr/share/sgml/docbook/xml-dtd-4.3-1.0-26/docbookx.dtd /usr/share/sgml/docbook/xml-dtd-4.2-1.0-26/docbookx.dtd /usr/share/sgml/docbook/xml-dtd-4.4-1.0-26/docbookx.dtd /usr/share/sgml/docbook/xml-dtd-4.1.2-1.0-26/docbookx.dtd --- However, only the last location could be detected with current configure script.
See the attached patch, it should detect some more paths ;) Diego, should I?
Looks like it got lost in cyberspace... Guillaume
On Thu, Jan 04, 2007 at 10:08:13PM +0100, Torinthiel wrote:
On Thu, Jan 04, 2007 at 04:38:32PM +0300, Andrew Savchenko wrote:
Local DTD is currently detected in my system. But if it will not for some reason? Of if there are some people with no DTDs in default path?
For what reason? Either the file exists, and it is detected, or not. If there are some people without DTDs, then right now they're doomed. With this patch and an active internet connection they can build the docs.
Interesting, there are my locations of dtd's: --- $ locate docbookx.dtd /usr/share/apps/ksgmltools2/docbook/xml-dtd-4.1.2/docbookx.dtd /usr/share/apps/ksgmltools2/docbook/xml-dtd-4.2/docbookx.dtd /usr/share/sgml/docbook/sgml-dtd-4.4-1.0-26/docbookx.dtd /usr/share/sgml/docbook/sgml-dtd-4.3-1.0-26/docbookx.dtd /usr/share/sgml/docbook/sgml-dtd-4.2-1.0-26/docbookx.dtd /usr/share/sgml/docbook/xml-dtd-4.3-1.0-26/docbookx.dtd /usr/share/sgml/docbook/xml-dtd-4.2-1.0-26/docbookx.dtd /usr/share/sgml/docbook/xml-dtd-4.4-1.0-26/docbookx.dtd /usr/share/sgml/docbook/xml-dtd-4.1.2-1.0-26/docbookx.dtd --- However, only the last location could be detected with current configure script.
See the attached patch, it should detect some more paths ;) Diego, should I?
This patch. Torinthiel -- Waclaw "Torinthiel" Schiller GG#: 3073512 torinthiel(at)megapolis(dot)pl gpg: 0906A2CE fpr: EE3E DFB4 C4D6 E22E 8999 D714 7CEB CDDC 0906 A2CE "No classmates may be used during this examination"
On Thu, Jan 04, 2007 at 10:16:00PM +0100, Torinthiel wrote:
On Thu, Jan 04, 2007 at 10:08:13PM +0100, Torinthiel wrote:
On Thu, Jan 04, 2007 at 04:38:32PM +0300, Andrew Savchenko wrote:
Local DTD is currently detected in my system. But if it will not for some reason? Of if there are some people with no DTDs in default path?
For what reason? Either the file exists, and it is detected, or not. If there are some people without DTDs, then right now they're doomed. With this patch and an active internet connection they can build the docs.
Interesting, there are my locations of dtd's: --- $ locate docbookx.dtd /usr/share/apps/ksgmltools2/docbook/xml-dtd-4.1.2/docbookx.dtd /usr/share/apps/ksgmltools2/docbook/xml-dtd-4.2/docbookx.dtd /usr/share/sgml/docbook/sgml-dtd-4.4-1.0-26/docbookx.dtd /usr/share/sgml/docbook/sgml-dtd-4.3-1.0-26/docbookx.dtd /usr/share/sgml/docbook/sgml-dtd-4.2-1.0-26/docbookx.dtd /usr/share/sgml/docbook/xml-dtd-4.3-1.0-26/docbookx.dtd /usr/share/sgml/docbook/xml-dtd-4.2-1.0-26/docbookx.dtd /usr/share/sgml/docbook/xml-dtd-4.4-1.0-26/docbookx.dtd /usr/share/sgml/docbook/xml-dtd-4.1.2-1.0-26/docbookx.dtd --- However, only the last location could be detected with current configure script.
See the attached patch, it should detect some more paths ;) Diego, should I?
This patch.
Apply. Diego
On Wed, Jan 17, 2007 at 12:25:38AM +0100, Diego Biurrun wrote:
On Thu, Jan 04, 2007 at 10:16:00PM +0100, Torinthiel wrote:
On Thu, Jan 04, 2007 at 10:08:13PM +0100, Torinthiel wrote:
On Thu, Jan 04, 2007 at 04:38:32PM +0300, Andrew Savchenko wrote:
Local DTD is currently detected in my system. But if it will not for some reason? Of if there are some people with no DTDs in default path?
For what reason? Either the file exists, and it is detected, or not. If there are some people without DTDs, then right now they're doomed. With this patch and an active internet connection they can build the docs.
Interesting, there are my locations of dtd's: --- $ locate docbookx.dtd /usr/share/apps/ksgmltools2/docbook/xml-dtd-4.1.2/docbookx.dtd /usr/share/apps/ksgmltools2/docbook/xml-dtd-4.2/docbookx.dtd /usr/share/sgml/docbook/sgml-dtd-4.4-1.0-26/docbookx.dtd /usr/share/sgml/docbook/sgml-dtd-4.3-1.0-26/docbookx.dtd /usr/share/sgml/docbook/sgml-dtd-4.2-1.0-26/docbookx.dtd /usr/share/sgml/docbook/xml-dtd-4.3-1.0-26/docbookx.dtd /usr/share/sgml/docbook/xml-dtd-4.2-1.0-26/docbookx.dtd /usr/share/sgml/docbook/xml-dtd-4.4-1.0-26/docbookx.dtd /usr/share/sgml/docbook/xml-dtd-4.1.2-1.0-26/docbookx.dtd --- However, only the last location could be detected with current configure script.
See the attached patch, it should detect some more paths ;) Diego, should I?
This patch.
Apply.
Why don't you apply? Diego
On Mon, Jan 29, 2007 at 01:01:15PM +0100, Diego Biurrun wrote:
On Wed, Jan 17, 2007 at 12:25:38AM +0100, Diego Biurrun wrote:
On Thu, Jan 04, 2007 at 10:16:00PM +0100, Torinthiel wrote:
On Thu, Jan 04, 2007 at 10:08:13PM +0100, Torinthiel wrote:
On Thu, Jan 04, 2007 at 04:38:32PM +0300, Andrew Savchenko wrote:
Local DTD is currently detected in my system. But if it will not for some reason? Of if there are some people with no DTDs in default path?
For what reason? Either the file exists, and it is detected, or not. If there are some people without DTDs, then right now they're doomed. With this patch and an active internet connection they can build the docs.
Interesting, there are my locations of dtd's: --- $ locate docbookx.dtd /usr/share/apps/ksgmltools2/docbook/xml-dtd-4.1.2/docbookx.dtd /usr/share/apps/ksgmltools2/docbook/xml-dtd-4.2/docbookx.dtd /usr/share/sgml/docbook/sgml-dtd-4.4-1.0-26/docbookx.dtd /usr/share/sgml/docbook/sgml-dtd-4.3-1.0-26/docbookx.dtd /usr/share/sgml/docbook/sgml-dtd-4.2-1.0-26/docbookx.dtd /usr/share/sgml/docbook/xml-dtd-4.3-1.0-26/docbookx.dtd /usr/share/sgml/docbook/xml-dtd-4.2-1.0-26/docbookx.dtd /usr/share/sgml/docbook/xml-dtd-4.4-1.0-26/docbookx.dtd /usr/share/sgml/docbook/xml-dtd-4.1.2-1.0-26/docbookx.dtd --- However, only the last location could be detected with current configure script.
See the attached patch, it should detect some more paths ;) Diego, should I?
This patch.
Apply.
Why don't you apply?
Applied. Diego
On Mon, Jan 29, 2007 at 01:01:15PM +0100, Diego Biurrun wrote:
Apply.
Why don't you apply?
Because before I've red your reply my computer crashed. Thanks for doing it. Torinthiel -- Waclaw "Torinthiel" Schiller GG#: 3073512 torinthiel(at)data(dot)pl gpg: 0906A2CE fpr: EE3E DFB4 C4D6 E22E 8999 D714 7CEB CDDC 0906 A2CE "No classmates may be used during this examination"
participants (5)
-
Andrew Savchenko -
Diego Biurrun -
Guillaume POIRIER -
Torinthiel -
Torinthiel