Bug 179696 - [PATCH] textproc/docbook-xsl: Fix xmlcatmgr errors caused by duplicate installation
Summary: [PATCH] textproc/docbook-xsl: Fix xmlcatmgr errors caused by duplicate instal...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Gabor Kovesdan
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-19 00:20 UTC by John Marino
Modified: 2013-07-09 22:10 UTC (History)
0 users

See Also:


Attachments
file.diff (2.57 KB, patch)
2013-06-19 00:20 UTC, John Marino
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description John Marino 2013-06-19 00:20:00 UTC
each time docbook-xsl is installed from a package, errors such as these appear:

xmlcatmgr: entry already exists for `http://docbook.sourceforge.net/release/xsl/1.36' of type `rewriteSystem'
xmlcatmgr: entry already exists for `http://docbook.sourceforge.net/release/xsl/1.36' of type `rewriteURI'
xmlcatmgr: entry already exists for `http://docbook.sourceforge.net/release/xsl/1.37' of type `rewriteSystem'
xmlcatmgr: entry already exists for `http://docbook.sourceforge.net/release/xsl/1.37' of type `rewriteURI'
xmlcatmgr: entry already exists for `http://docbook.sourceforge.net/release/xsl/1.38' of type `rewriteSystem'
xmlcatmgr: entry already exists for `http://docbook.sourceforge.net/release/xsl/1.38' of type `rewriteURI'

The reason for this is that catalog.xml is created during the post-install target, then it's packaged, and when the package is installed, the post-install script is run again.  The xmlcatmgr code is run for a second time so ever command fails since the entry already exists.

The attached patch will fix this.
The catalog.xml creation code is moved to the Makefile where it's run during the install phase.  It's created in the $WRKSRC directory and then installed with the other files of the package list.  This allows the docbook-xml package to install without any errors.

Fix: Patch attached with submission follows:
Comment 1 Edwin Groothuis freebsd_committer 2013-06-19 00:20:13 UTC
Responsible Changed
From-To: freebsd-ports-bugs->gabor

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 John Marino 2013-07-05 18:43:56 UTC
ping?
This is a highly annoying bug and the provided fix works.
The "timeout" period has already passed.  If the maintainer doesn't 
respond really soon I think this and the other related PRs should be 
timed out so the ports can be fixed to install properly.

thanks,
John
Comment 3 dfilter service freebsd_committer 2013-07-09 22:04:54 UTC
Author: gabor
Date: Tue Jul  9 21:04:41 2013
New Revision: 322575
URL: http://svnweb.freebsd.org/changeset/ports/322575

Log:
  - Fix package installation
  - Bum PORTREVISION
  
  PR:		ports/179696
  Submitted by:	marino

Modified:
  head/textproc/docbook-xsl/Makefile
  head/textproc/docbook-xsl/files/pkg-install.in

Modified: head/textproc/docbook-xsl/Makefile
==============================================================================
--- head/textproc/docbook-xsl/Makefile	Tue Jul  9 20:58:17 2013	(r322574)
+++ head/textproc/docbook-xsl/Makefile	Tue Jul  9 21:04:41 2013	(r322575)
@@ -2,6 +2,7 @@
 
 PORTNAME=	docbook-xsl
 PORTVERSION=	1.76.1
+PORTREVISION=	1
 CATEGORIES=	textproc
 MASTER_SITES=	SF/docbook/${PORTNAME}/${PORTVERSION}:src \
 		SF/docbook/${PORTNAME}-doc/${PORTVERSION}:doc
@@ -27,6 +28,7 @@ SUB_LIST+=	INSTDIR="${INSTDIR}" \
 		CATALOG_PORTS="${LOCALBASE}/share/xml/catalog.ports"
 
 XMLCATMGR=	${LOCALBASE}/bin/xmlcatmgr
+CATALOG_XSL=	${WRKSRC}/catalog
 
 MODULES=	common fo html images lib manpages params xhtml
 
@@ -52,6 +54,14 @@ TOOLS_DESC=		Tools
 WEBSITE_DESC=		Website modules
 XHTML11_DESC=		XHTML 1.1 modules
 
+DXVERSIONS=	1.36 1.37 1.38 1.39 1.40 1.41 1.42 1.43 1.44 1.45 1.46 1.47 \
+		1.48 1.49 1.50.0 1.51.0 1.51.1 1.52.0 1.52.1 1.52.2 1.53.0 \
+		1.54.0 1.54.1 1.55.0 1.56.0 1.56.1 1.57.0 1.58.0 1.58.1 \
+		1.59.0 1.59.1 1.59.2 1.60.0 1.60.1 1.61.0 1.61.1 1.61.2 \
+		1.61.3 1.62.0 1.62.1 1.62.2 1.62.3 1.62.4 1.63.0 1.64.0 \
+		1.64.1 1.65.0 1.65.1 1.66.0 1.66.1 1.67.0 1.67.2 1.68.0 \
+		1.68.1 1.69.0 1.69.1 1.70.0 1.70.1 1.71.0 1.71.1 current
+
 .include <bsd.port.options.mk>
 
 .if ${PORT_OPTIONS:MDOCS}
@@ -169,6 +179,15 @@ do-install:
 			${INSTALL_DATA} $${i} ${PREFIX}/${INSTDIR}/${m}; \
 		done
 .endfor
+		${XMLCATMGR} -c ${CATALOG_XSL} create
+.for dxversion in ${DXVERSIONS}
+	${XMLCATMGR} -c "${CATALOG_XSL}" add rewriteSystem \
+		http://docbook.sourceforge.net/release/xsl/${dxversion} \
+		"file://${PREFIX}/${INSTDIR}"
+	${XMLCATMGR} -c "${CATALOG_XSL}" add rewriteURI \
+		http://docbook.sourceforge.net/release/xsl/${dxversion} \
+		"file://${PREFIX}/${INSTDIR}"
+.endfor
 		files=$$(${FIND} ${WRKSRC} -type f -depth 1); \
 		for i in $${files}; do \
 			${INSTALL_DATA} $${i} ${PREFIX}/${INSTDIR}; \

Modified: head/textproc/docbook-xsl/files/pkg-install.in
==============================================================================
--- head/textproc/docbook-xsl/files/pkg-install.in	Tue Jul  9 20:58:17 2013	(r322574)
+++ head/textproc/docbook-xsl/files/pkg-install.in	Tue Jul  9 21:04:41 2013	(r322575)
@@ -17,22 +17,6 @@ if [ "$2" != "POST-INSTALL" ]; then
 	exit 0
 fi
 
-VERSIONS='1.36 1.37 1.38 1.39 1.40 1.41 1.42 1.43 1.44 1.45 1.46 1.47 1.48 1.49 1.50.0 1.51.0 1.51.1 1.52.0 1.52.1 1.52.2 1.53.0 1.54.0 1.54.1 1.55.0 1.56.0 1.56.1 1.57.0 1.58.0 1.58.1 1.59.0 1.59.1 1.59.2 1.60.0 1.60.1 1.61.0 1.61.1 1.61.2 1.61.3 1.62.0 1.62.1 1.62.2 1.62.3 1.62.4 1.63.0 1.64.0 1.64.1 1.65.0 1.65.1 1.66.0 1.66.1 1.67.0 1.67.2 1.68.0 1.68.1 1.69.0 1.69.1 1.70.0 1.70.1 1.71.0 1.71.1 current'
-
-if [ ! -f ${CATALOG_XSL} ]; then
-	 %%XMLCATMGR%% -c "${CATALOG_XSL}" create
-fi
-
-for version in ${VERSIONS}
-do
-	%%XMLCATMGR%% -c "${CATALOG_XSL}" add rewriteSystem \
-		http://docbook.sourceforge.net/release/xsl/$version \
-		"file://${XSL_DIR}"
-	%%XMLCATMGR%% -c "${CATALOG_XSL}" add rewriteURI \
-		http://docbook.sourceforge.net/release/xsl/$version \
-		"file://${XSL_DIR}"
-done
-
 %%XMLCATMGR%% -c %%CATALOG_PORTS%% add delegateSystem \
 	http://docbook.sourceforge.net/release/xsl/ \
 	"file://${CATALOG_XSL}"
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 4 Gabor Kovesdan freebsd_committer 2013-07-09 22:06:39 UTC
State Changed
From-To: open->closed

Committed, thanks!