Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 42291 - sgml2html doesn't work
Summary: sgml2html doesn't work
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All All
: High normal
Assignee: Text-Markup Team (OBSOLETE)
URL:
Whiteboard:
Keywords: Bug
Depends on:
Blocks:
 
Reported: 2004-02-20 12:37 UTC by David Grant
Modified: 2004-11-15 05:47 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Grant 2004-02-20 12:37:28 UTC
I can't get sgml2html to work.  I've been emerging and unemerging stuff like crazy trying to get things to work, and now it's even worse than when I started.  I have no /etc/sgml/catalog.d directory, I'm not sure why.  

bash-2.05b$ sgml2html user-manual.sgml
Traceback (most recent call last):
  File "/usr/bin/sgmltools", line 93, in ?
    tool.processFile(curfile)
  File "/usr/share/sgml/misc/sgmltools/python/SGMLtools.py", line 230, in processFile
    dssslfile = utils.findStylesheet(stylesheet, self._aliases)
  File "/usr/share/sgml/misc/sgmltools/python/utils.py", line 317, in findStylesheet
    raise IOError, "Couldn't resolve pubid [%s]" % id
IOError: Couldn't resolve pubid [sgmltools-html]


bash-2.05b# emerge info
Portage 2.0.50-r1 (default-x86-1.4, gcc-3.3.2, glibc-2.3.2-r9, 2.6.1-gentoo)
=================================================================
System uname: 2.6.1-gentoo i686 AMD Athlon(tm) Processor
Gentoo Base System version 1.4.3.13
Autoconf: sys-devel/autoconf-2.58-r1
Automake: sys-devel/automake-1.7.7
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-march=athlon-tbird -O3 -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.2/share/config /usr/kde/3/share/config /usr/share/config /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
CXXFLAGS="-march=athlon-tbird -O3 -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache sandbox"
GENTOO_MIRRORS="ftp://ftp.ussg.iu.edu/pub/linux/gentoo http://mirrors.tds.net/gentoo http://gentoo.mirrors.pair.com/ http://gentoo.chem.wisc.edu/gentoo/ http://128.213.5.34/gentoo/"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="3dnow X Xaw3d aalib acpi alsa apache2 apm arts artswrappersuid atlas avi berkdb bonobo cdr crypt cups curl dedicated directfb emacs encode fbcon flac foomaticdb gd gdbm geoip gif gimpprint gphoto2 gpm gtk gtk2 gtkhtml guile imap imlib java javascript joystick jpeg kde libg++ libwww mad mbox mcal mmx motif mozcalendar mozilla mozp3p mozsvg mpeg mpi mysql nas ncurses nls offensive ofx oggvorbis opengl oss pam pda pdflib perl pic plotutils png postgres ppds python qt quicktime readline samba sasl sdl slang spell ssl svga tcltk tcpd tetex tiff truetype type1 usb v4l wxwindows x86 xml2 xmms xv xvid zlib"
Comment 1 David Grant 2004-02-20 12:43:01 UTC
I looked into that utils.py file and decided to check out this SGML_CATALOG_FILES variable.

bash-2.05b# echo $SGML_CATALOG_FILES
/etc/sgml/sgml-ent.cat:/etc/sgml/sgml-docbook.cat:/etc/sgml/sgml-docbook-3.1.cat:/etc/sgml/sgml-docbook-3.0.cat:/etc/sgml/sgml-lite.cat:/etc/sgml/sgml-docbook-4.1.cat:/etc/sgml/dsssl-docbook-stylesheets.cat:/etc/sgml/sgml-docbook-4.0.cat:/etc/sgml/openjade-1.3.2.cat
Comment 2 David Grant 2004-02-20 17:30:10 UTC
Ok, now I've got everything emerged better now I think and I am back to getting the error message which I had originally, before it got the message which you see above.

bash-2.05b$ sgml2html user-manual.sgml 
Traceback (most recent call last):
  File "/usr/bin/sgmltools", line 93, in ?
    tool.processFile(curfile)
  File "/usr/share/sgml/misc/sgmltools/python/SGMLtools.py", line 230, in processFile
    dssslfile = utils.findStylesheet(stylesheet, self._aliases)
  File "/usr/share/sgml/misc/sgmltools/python/utils.py", line 307, in findStylesheet
    return findStylesheet(name, aliases)
  File "/usr/share/sgml/misc/sgmltools/python/utils.py", line 317, in findStylesheet
    raise IOError, "Couldn't resolve pubid [%s]" % id
IOError: Couldn't resolve pubid ["-//SGMLtools//DOCUMENT Docbook Style Sheet for HTML//EN"]
Comment 3 Mike Gardiner (RETIRED) gentoo-dev 2004-02-22 01:36:43 UTC
Why did you reassign this back to wranglers? Playing with bugs makes them harder for us to find.. and then fix.
Comment 4 Mike Gardiner (RETIRED) gentoo-dev 2004-02-22 01:44:26 UTC
The problem has nothing to do with sgml2html itself, and everything to do with your local catalogs. /etc/sgml/catalog.d is cruft and needs to be removed asap, it's hangover from the previous packager.

This here is a hint to your problem:

Couldn't resolve pubid ["-//SGMLtools//DOCUMENT Docbook Style Sheet for HTML//EN"

So it can't find the stylesheets, which are referenced by the catalog:
/usr/share/sgml/stylesheets/sgmltools/sgmltools.cat

Try something like this
export SGML_CATALOGS_FILES=$SGML_CATALOG_FILES:/usr/share/sgml/stylesheets/sgmltools/sgmltools.cat
sgml2html <your file>

If that doesnt work, please attach user-manual.sgml for me to have a look at.

Thankyou.
Comment 5 David Grant 2004-02-22 11:04:41 UTC
First of all sorry for re-assigning to wranglers.  I had originally assinged it to text-markup but I didn't hear anything, so I thought maybe I assinged it to the wrong herd.

Ok, if I export the SGML_CATALOG_FILES like you suggested, it works.  Are users supposed to set this themselves or should this be set somehow in gentoo by the ebuild.
Comment 6 Mike Gardiner (RETIRED) gentoo-dev 2004-02-23 01:21:12 UTC
It's included in the default catalog installation, so please check:

/etc/sgml/catalog references /etc/sgml/sgml-lite.cat with:
CATALOG "/etc/sgml/sgml-lite.cat"

/etc/sgml/sgml-lite.cat references the real catalog under /usr/share/sgml... with:
CATALOG "/usr/share/sgml/stylesheets/sgmltools/sgmltools.cat"

If one of the above entries doesnt exist please say so.

Either way, please try remerging sgmltools-lite, to recreate the catalog entries/hopefully fix things up.
Comment 7 David Grant 2004-02-23 01:50:53 UTC
The things you told me to look for exist.

I reemerged sgmltools-lite, but no change.
Comment 8 David Grant 2004-02-23 01:55:42 UTC
This is mysterious.

david@sidicpc22 user-manual $ echo $SGML_CATALOG_FILES
/etc/sgml/sgml-docbook-4.2.cat:/etc/sgml/sgml-docbook-3.1.cat:
/etc/sgml/openjade-1.3.2.cat:/etc/sgml/sgml-docbook-3.0.cat:
/etc/sgml/sgml-ent.cat:/etc/sgml/sgml-docbook-4.0.cat:
/etc/sgml/sgml-docbook.cat:/etc/sgml/dsssl-docbook-stylesheets.cat:
/etc/sgml/sgml-lite.cat:/etc/sgml/sgml-docbook-4.1.cat

That looks right, and the contents of sgml-lite.cat look alright.  And the stylesheet /usr/share/sgml/stylesheets/sgmltools/sgmltools.cat exists.  So does html.dsl.
Comment 9 Chris Dawes 2004-05-12 07:17:54 UTC
I've found a fix for this issue. included at the end of this is a patch for /usr/share/sgml/misc/sgmltools/python/utils.py
I think a change should probably made upstream; here's a copy of an email i just sent to the one of the developers:

I was getting an error when trying to run sgmltools when it tried to find the stylesheet.
I had a look at utils.py and the _searchInCat routine seems fine except for the fact that it is looking for catalog filenames which are in double quotes so it would match
CATALOG "/usr/share/blahblah"
but not
CATALOG /usr/share/blahblah
On my gentoo system all of my catalog files use unquoted filenames so I changed the regular expression to fix this.
I've seen a couple of debian bug reports which look like the same problem. You may think a neater way to solve this is to generate the catalog files with the quote marks in the first place.

i'm using sgmltools-lite 3.0.3 by the way.

Chris Dawes


--- utils.py    2004-05-12 15:03:58.551999765 +0100
+++ /usr/share/sgml/misc/sgmltools/python/utils.py      2004-05-12 15:04:25.706671905 +0100
@@ -245,7 +245,9 @@
        #
        #  Check for nested catalogs, recurse if yes.
        #
-       mo = re.compile(r'CATALOG\s*"([^"]+)"').match(line)
+       #    optionally match double quotes, but when quotes are
+       #    not present we also have to exclude the \n character.
+       mo = re.compile(r'CATALOG\s*"?([^\n"]+)"?').match(line)
        if mo != None:
            retval = _searchInCat(mo.group(1), id, section)
            if retval != None:
Comment 10 Mamoru KOMACHI (RETIRED) gentoo-dev 2004-11-15 05:47:03 UTC
All the catalog files are using quoted strings
now, so it shouldn't be a problem anymore.