Bug 179729 - [PATCH]: textproc/website: Fix xmlcatmgr errors caused by duplicate installation + pkg-plist
Summary: [PATCH]: textproc/website: Fix xmlcatmgr errors caused by duplicate installat...
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: John Marino
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-19 19:30 UTC by John Marino
Modified: 2013-07-21 19:47 UTC (History)
0 users

See Also:


Attachments
file.diff (4.29 KB, patch)
2013-06-19 19:30 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 19:30:00 UTC
This PR is related to ports/179696 and ports/179725

Again, xmlcatmgr is run twice and stored in pkg-plist, the fix is similar. There were two tweaks to the pkg-plist:
1) The catalog is a regular file, remove special unexec handling
2) The ${LOCALBASE}/share/xsl is not guaranteed to be empty after package removal as the port shares the directory with the docbook ports.  Convert this to dirrmtry instead of absolute removal.

Fix: Patch attached with submission follows:
Comment 1 Martin Wilke freebsd_committer freebsd_triage 2013-06-22 16:21:24 UTC
Responsible Changed
From-To: freebsd-ports-bugs->miwi

I'll take it.
Comment 2 Martin Wilke freebsd_committer freebsd_triage 2013-07-18 08:31:11 UTC
Responsible Changed
From-To: miwi->marino

submitter is now committer :)
Comment 3 dfilter service freebsd_committer freebsd_triage 2013-07-21 19:20:33 UTC
Author: marino
Date: Sun Jul 21 18:20:24 2013
New Revision: 323408
URL: http://svnweb.freebsd.org/changeset/ports/323408

Log:
  textproc/website: Fix xmlcatmgr duplicate errors during package installation
  
  PR:		ports/179729
  Submitted by:	marino
  Approved by:	bapt (mentor)

Modified:
  head/textproc/website/Makefile
  head/textproc/website/files/pkg-install.in
  head/textproc/website/pkg-plist

Modified: head/textproc/website/Makefile
==============================================================================
--- head/textproc/website/Makefile	Sun Jul 21 18:07:29 2013	(r323407)
+++ head/textproc/website/Makefile	Sun Jul 21 18:20:24 2013	(r323408)
@@ -1,14 +1,9 @@
-# New ports collection makefile for:   website
-# Date Created:        2003-11-10 10:13:49
-# Whom:                Jean-Baptiste Quenot <jb.quenot@caraldi.com>
-#
-# Based on the docbook-xsl port
-#
+# Created by: Jean-Baptiste Quenot <jb.quenot@caraldi.com>
 # $FreeBSD$
-#
 
 PORTNAME=	website
 PORTVERSION=	2.5.0
+PORTREVISION=	1
 CATEGORIES=	textproc www
 MASTER_SITES=	SF/docbook/OldFiles
 
@@ -28,6 +23,9 @@ PKGDEINSTALL=	${WRKSRC}/pkg-deinstall
 NO_BUILD=	yes
 XMLCATMGR=	${LOCALBASE}/bin/xmlcatmgr
 CATALOG_PORTS=	${XMLDIR}/catalog.ports
+CATALOG_XSL=	${WRKSRC}/catalog
+
+DXVERSIONS=	current 2.2 2.3 2.4.0 2.4.1 2.5.0
 
 post-extract:
 	${FIND} ${WRKSRC} -name '.#*' -delete
@@ -38,8 +36,29 @@ do-install:
 	(cd ${WRKSRC}/example && ${TAR} -cf - . |\
 		${TAR} -xf - -C${EXAMPLESDIR})
 .endif
+	${XMLCATMGR} -c "${CATALOG_XSL}" create
+.for dxversion in ${DXVERSIONS}
+	${XMLCATMGR} -c "${CATALOG_XSL}" add rewriteSystem \
+		http://docbook.sourceforge.net/release/website/${dxversion}/xsl \
+		"file://${PREFIX}/${INSTDIR}/xsl"
+	${XMLCATMGR} -c "${CATALOG_XSL}" add rewriteURI \
+		http://docbook.sourceforge.net/release/website/${dxversion}/xsl \
+		"file://${PREFIX}/${INSTDIR}/xsl"
+	${XMLCATMGR} -c "${CATALOG_XSL}" add rewriteSystem \
+		http://docbook.sourceforge.net/release/website/${dxversion}/schema/dtd \
+		"file://${PREFIX}/${INSTDIR}/schema/dtd"
+	${XMLCATMGR} -c "${CATALOG_XSL}" add rewriteURI \
+		http://docbook.sourceforge.net/release/website/${dxversion}/schema/dtd \
+		"file://${PREFIX}/${INSTDIR}/schema/dtd"
+	${XMLCATMGR} -c "${CATALOG_XSL}" add rewriteSystem \
+		http://docbook.sourceforge.net/release/website/${dxversion} \
+		"file://${PREFIX}/${INSTDIR}/schema/dtd"
+	${XMLCATMGR} -c "${CATALOG_XSL}" add rewriteURI \
+		http://docbook.sourceforge.net/release/website/${dxversion} \
+		"file://${PREFIX}/${INSTDIR}/schema/dtd"
+.endfor
 	${MKDIR} ${PINSTDIR}
-	(cd ${WRKSRC} && ${TAR} -cf - VERSION ${COPYDIRS} |\
+	(cd ${WRKSRC} && ${TAR} -cf - VERSION catalog ${COPYDIRS} |\
 		${TAR} -xf - -C${PINSTDIR})
 
 post-install:

Modified: head/textproc/website/files/pkg-install.in
==============================================================================
--- head/textproc/website/files/pkg-install.in	Sun Jul 21 18:07:29 2013	(r323407)
+++ head/textproc/website/files/pkg-install.in	Sun Jul 21 18:20:24 2013	(r323408)
@@ -18,34 +18,6 @@ if [ "$2" != "POST-INSTALL" ]; then
 	exit 0
 fi
 
-VERSIONS='current 2.2 2.3 2.4.0 2.4.1 2.5.0'
-
-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/website/$version/xsl \
-		"file://${XSL_DIR}/xsl"
-	${XMLCATMGR} -c "${CATALOG_XSL}" add rewriteURI \
-		http://docbook.sourceforge.net/release/website/$version/xsl \
-		"file://${XSL_DIR}/xsl"
-	${XMLCATMGR} -c "${CATALOG_XSL}" add rewriteSystem \
-		http://docbook.sourceforge.net/release/website/$version/schema/dtd \
-		"file://${XSL_DIR}/schema/dtd"
-	${XMLCATMGR} -c "${CATALOG_XSL}" add rewriteURI \
-		http://docbook.sourceforge.net/release/website/$version/schema/dtd \
-		"file://${XSL_DIR}/schema/dtd"
-	${XMLCATMGR} -c "${CATALOG_XSL}" add rewriteSystem \
-		http://docbook.sourceforge.net/release/website/$version \
-		"file://${XSL_DIR}/schema/dtd"
-	${XMLCATMGR} -c "${CATALOG_XSL}" add rewriteURI \
-		http://docbook.sourceforge.net/release/website/$version \
-		"file://${XSL_DIR}/schema/dtd"
-done
-
 ${XMLCATMGR} -c "${CATALOG_PORTS_XML}" add delegateSystem \
 	http://docbook.sourceforge.net/release/website/ \
 	"file://${CATALOG_XSL}"

Modified: head/textproc/website/pkg-plist
==============================================================================
--- head/textproc/website/pkg-plist	Sun Jul 21 18:07:29 2013	(r323407)
+++ head/textproc/website/pkg-plist	Sun Jul 21 18:20:24 2013	(r323408)
@@ -177,7 +177,6 @@ share/xsl/website/xsl/website-common.xsl
 share/xsl/website/xsl/website-targets.xsl
 share/xsl/website/xsl/website.xsl
 share/xsl/website/xsl/xbel.xsl
-@unexec rm -f %D/share/xsl/website/catalog 2>&1 >/dev/null || true
 @dirrm share/xsl/website/xsl
 @dirrm share/xsl/website/tests
 @dirrm share/xsl/website/schema/relaxng
@@ -193,7 +192,7 @@ share/xsl/website/xsl/xbel.xsl
 @dirrm share/xsl/website/extensions/saxon64
 @dirrm share/xsl/website/extensions
 @dirrm share/xsl/website
-@dirrm share/xsl
+@dirrmtry share/xsl
 %%PORTDOCS%%@dirrm %%EXAMPLESDIR%%/subdir
 %%PORTDOCS%%@dirrm %%EXAMPLESDIR%%/graphics/navicons/triangle/other
 %%PORTDOCS%%@dirrm %%EXAMPLESDIR%%/graphics/navicons/triangle/current
_______________________________________________
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 John Marino freebsd_committer freebsd_triage 2013-07-21 19:47:05 UTC
State Changed
From-To: open->closed

Committed. Thanks!