# DocBook headache



## domanb (Feb 18, 2014)

Hi everyone,

I'm in the process up updating my system.  Now it seems I've bungled my docbook installs.  I believe it has something to do with the Catalogs that I read about on some other page, but it wasn't particularly helpful to my situation.  Here is what happens when I try to install on such docbook:

```
# portmaster textproc/docbook-420
 
===>>> Port directory: /usr/ports/textproc/docbook-420
 
===>>> Gathering distinfo list for installed ports
 
===>>> Launching 'make checksum' for textproc/docbook-420 in background
===>>> Gathering dependency list for textproc/docbook-420 from ports
===>>> Initial dependency check complete for textproc/docbook-420
 
===>>> Starting build for textproc/docbook-420 <<<===
 
===>>> All dependencies are up to date
 
===>  Cleaning for docbook420-4.2_1
 
===>>> Waiting on fetch & checksum for textproc/docbook-420 <<<===

===>  Found saved configuration for docbook420-4.2_1
===> Fetching all distfiles required by docbook420-4.2_1 for building
===>  Extracting for docbook420-4.2_1
=> SHA256 Checksum OK for docbook-4.2.zip.
===>  Patching for docbook420-4.2_1
===>  Configuring for docbook420-4.2_1
===>  Staging for docbook420-4.2_1
===>   Generating temporary packing list
cd /usr/ports/textproc/docbook-420/work/docbook-4.2 && /bin/sh -c '(/usr/bin/find -d $0 $2 | /usr/bin/cpio -dumpl $1 >/dev/null  2>&1) &&  /usr/sbin/chown -Rh root:wheel $1 &&  /usr/bin/find -d $0 $2 -type d -exec chmod 755 $1/{} \; &&  /usr/bin/find -d $0 $2 -type f -exec chmod 444 $1/{} \;' -- . /usr/ports/textproc/docbook-420/work/stage/usr/local/share/sgml/docbook/4.2/dtd
install  -o root -g wheel -m 444 /usr/ports/textproc/docbook-420/work/catalog /usr/ports/textproc/docbook-420/work/stage/usr/local/share/sgml/docbook/4.2/dtd
/bin/mv /usr/ports/textproc/docbook-420/work/stage/usr/local/share/sgml/docbook/4.2/dtd/ChangeLog /usr/ports/textproc/docbook-420/work/stage/usr/local/share/doc/docbook/4.2
====> Compressing man pages (compress-man)
===>  Building package for docbook420-4.2_1
Creating package /usr/ports/textproc/docbook-420/work/docbook420-4.2_1.tbz
Registering depends: iso8879-1986_3 xmlcatmgr-2.2.
pkg_create: read_plist: unknown command '@dirrmtry share/sgml/docbook' (package tools out of date?)
pkg_create: read_plist: unknown command '@dirrmtry share/doc/docbook' (package tools out of date?)
pkg_create: write_plist: unknown command type -1 (share/sgml/docbook)
*** [do-package] Error code 1
 
Stop in /usr/ports/textproc/docbook-420.
*** [install] Error code 1
 
Stop in /usr/ports/textproc/docbook-420.
 
===>>> Installation of docbook420-4.2_1 (textproc/docbook-420) failed
===>>> Aborting update
 
Terminated
 
===>>> You can restart from the point of failure with this command line:
       portmaster <flags> textproc/docbook-420
```

These lines seem to indicate the problem:


```
=> SHA256 Checksum OK for docbook-4.2.zip.
===>  Patching for docbook420-4.2_1
===>  Configuring for docbook420-4.2_1
===>  Staging for docbook420-4.2_1
===>   Generating temporary packing list
cd /usr/ports/textproc/docbook-420/work/docbook-4.2 && /bin/sh -c '(/usr/bin/find -d $0 $2 | /usr/bin/cpio -dumpl $1 >/dev/null  2>&1) &&  /usr/sbin/chown -Rh root:wheel $1 &&  /usr/bin/find -d $0 $2 -type d -exec chmod 755 $1/{} \; &&  /usr/bin/find -d $0 $2 -type f -exec chmod 444 $1/{} \;' -- . /usr/ports/textproc/docbook-420/work/stage/usr/local/share/sgml/docbook/4.2/dtd
install  -o root -g wheel -m 444 /usr/ports/textproc/docbook-420/work/catalog /usr/ports/textproc/docbook-420/work/stage/usr/local/share/sgml/docbook/4.2/dtd
/bin/mv /usr/ports/textproc/docbook-420/work/stage/usr/local/share/sgml/docbook/4.2/dtd/ChangeLog /usr/ports/textproc/docbook-420/work/stage/usr/local/share/doc/docbook/4.2
====> Compressing man pages (compress-man)
===>  Building package for docbook420-4.2_1
Creating package /usr/ports/textproc/docbook-420/work/docbook420-4.2_1.tbz
Registering depends: iso8879-1986_3 xmlcatmgr-2.2.
pkg_create: read_plist: unknown command '@dirrmtry share/sgml/docbook' (package tools out of date?)
pkg_create: read_plist: unknown command '@dirrmtry share/doc/docbook' (package tools out of date?)
pkg_create: write_plist: unknown command type -1 (share/sgml/docbook)
*** [do-package] Error code 1
```

Any ideas on how I can get this to work again?  Currently these packages/ports are not installed, as there are no entries in /var/db/pkg/ or var/db/ports/.


----------



## trh411 (Feb 18, 2014)

Is your version of ports-mgmt/pkg up to date? You might want to try updating that first.


----------



## domanb (Feb 18, 2014)

Might have been a false alarm.  I put 
	
	



```
WITH_PKGNG=yes
```
 into my /etc/make.conf and it worked.  But I've received this output during install:


```
====> Compressing man pages (compress-man)
===>  Installing for docbook-xml-430-4.3_1
===>  Checking if textproc/docbook-xml-430 already installed
===>   Registering installation for docbook-xml-430-4.3_1
xmlcatmgr: missing XML declaration; invalid document
xmlcatmgr: catalog does not look like an XML file; missing prolog
xmlcatmgr: errors while parsing catalog; aborting
pkg-static: POST-INSTALL script failed
Installing docbook-xml-430-4.3_1... done
 
pkg_info: can't find package 'docbook-xml-430-4.3_1' installed or in a file!
===>>> Installation of textproc/docbook-xml-430 (docbook-xml-430-4.3_1) succeeded
```

Should I be worried?


----------



## trh411 (Feb 18, 2014)

What version of ports-mgmt/pkg do you have installed. The current version is 1.2.6.


----------



## domanb (Feb 18, 2014)

That's what I'm using.  Luckily I'm using Freebsd 9 in a virtual environment, so I can just revert to an old snapshot and try this all again tomorrow.


----------



## wblock@ (Feb 18, 2014)

The first post shows errors because you were still using the old package system (pkg_create).  Adding the entry in /etc/make.conf does not convert your old database, which must also be done.  Please read the section in the Handbook: http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/pkgng-intro.html.


----------



## Anonymous (Feb 19, 2014)

But there's no solution, you can't install docbook-xml with the port , nor with the portmaster nor with portupgrade .. it tells conflicting with docbook500.


----------



## protocelt (Feb 19, 2014)

talsamon said:
			
		

> But there's no solution, you can't install docbook-xml with the port , nor with the portmaster nor with portupgrade .. it tells conflicting with docbook500.



The docbook* ports have had some restructuring done to them: 


> 20140219:
> AFFECTS: users of textproc/docbook*
> AUTHOR: mat@FreeBSD.org
> 
> ...



Make sure your ports tree is up to date, follow the instructions above, then update your ports. If you get an error while updating your installed ports after following the above instructions, post the error output.


----------



## wblock@ (Feb 19, 2014)

The UPDATING instructions have some problems on those, I sent an email off earlier about them.  If you can, wait for a bit.  If you have to upgrade them right now, escape the pattern-match characters in the commands to keep the shell from expanding and losing them: `pkg delete -f docbook-xml\* docbook-sk\* docbook\[2345\]\?\?-\* docbook-4\*`


----------



## protocelt (Feb 20, 2014)

wblock@ said:
			
		

> ...escape the pattern-match characters in the commands to keep the shell from expanding and losing them: `pkg delete -f docbook-xml\* docbook-sk\* docbook\[2345\]\?\?-\* docbook-4\*`



Thanks. I was not aware of that. I manually deleted/updated the installed docbook* ports before the UPDATING file was updated.


----------



## benmadin (Apr 17, 2014)

I've followed this forum, but although I seem to have wiped out all the references to docbook 4.x, I'm now getting:


```
xmlcatmgr: entry already exists for `/usr/local/share/xml/docbook/catalog' of type `CATALOG'
pkg-static: POST-INSTALL script failed
Installing docbook-xml-5.0_2...pkg-static: docbook-xml-5.0_2 conflicts with docbook-5.0_1 (installs files into the same place).  Problematic file: /usr/local/share/xml/docbook/5.0/catalog.xml
*** [fake-pkg] Error code 70
```

I'd be happy to be corrected I have tried:

`portmaster -f docbook`

`pkg delete -f docbook-xml\* docbook-sk\* docbook\[2345\]\?\?-\* docbook-4\*`

and for each port listed as docbook anything, `make deinstall`. I've also `rm -r /usr/local/share/xml`, `portsnap fetch`ed and `portsnap update`d. This is a production server that doesn't need any documentation on it at all, so it's doing my head in.

In desperation - is there a way in ports to generically disable any documentation building across all 197 installed ports?


----------



## wblock@ (Apr 17, 2014)

To make documents options default to off, add to /etc/make.conf:

```
OPTIONS_UNSET=DOCS
```
That may not remove the need for the DocBook ports, though.


----------

