[25681] trunk/dports/textproc/docbook-xsl/Portfile

source_changes at macosforge.org source_changes at macosforge.org
Mon May 28 00:27:39 PDT 2007


Revision: 25681
          http://trac.macosforge.org/projects/macports/changeset/25681
Author:   boeyms at macports.org
Date:     2007-05-28 00:27:38 -0700 (Mon, 28 May 2007)

Log Message:
-----------
textproc/docbook-xsl:
 * Add post-activate step to add docbook-xsl to local XML catalog so that it
   works, and depends_run on port:xmlcatmgr to ensure that the post-activate
   step works.
 * Also add a commented-out post-deactivate step to remove port from the XML
   catalog once such a hook has been implemented, and a user message on how to
   do this manually until that time.

Modified Paths:
--------------
    trunk/dports/textproc/docbook-xsl/Portfile

Modified: trunk/dports/textproc/docbook-xsl/Portfile
===================================================================
--- trunk/dports/textproc/docbook-xsl/Portfile	2007-05-28 07:07:03 UTC (rev 25680)
+++ trunk/dports/textproc/docbook-xsl/Portfile	2007-05-28 07:27:38 UTC (rev 25681)
@@ -15,6 +15,7 @@
 		rmd160 4df75842c4cda825ba5f36f5e5235e796e49b1bb
 use_configure 	no
 use_bzip2   yes
+depends_run port:xmlcatmgr
 build		{}
 
 set dirs_to_install	"catalog.xml common eclipse extensions fo highlighting \
@@ -33,3 +34,44 @@
 		file copy ${worksrcpath}/${dirname} ${destroot}/${prefix}/${instdir}
 	}
 }
+post-activate {
+    # xmlcatmgr as installed by MacPorts defaults to using
+    # ${prefix}/etc/xml/docbook (for XML) and ${prefix}/etc/xml/docbook (for
+    # SGML) if no catalog is specified, but we'll specify the path just in case
+    # users have another installation of xmlcatmgr and happen to have it before
+    # ${prefix}/bin in their PATH.
+    set catalog.xml ${prefix}/etc/xml/catalog
+
+    # Make the directory if it doesn't exist
+    if {![file exists ${prefix}/etc/xml]} {
+        xinstall -m 755 -d ${prefix}/etc/xml 
+    }
+
+    # Create the catalog file if it doesn't exist
+    if {![file exists ${catalog.xml}]} {
+        system "xmlcatmgr create -c ${catalog.xml}"
+    }
+
+    # Add the nextCatalog entry to the catalog if it doesn't exist
+    if {[catch {exec xmlcatmgr lookup ${prefix}/${instdir}/catalog.xml}]} {
+        system "xmlcatmgr add nextCatalog ${prefix}/${instdir}/catalog.xml"
+    }
+
+    # Once MacPorts does get a post-deactivate hook, this should change to
+    # auto-detect whether or not the user's installed version has the hook, and
+    # only print the message if it doesn't.
+    ui_msg \
+    "######################################################################"
+    ui_msg "# As MacPorts does not currently have a post-deactivate hook,\
+        \n# you will need to ensure that you manually remove the catalog\
+        \n# entry for this port when you uninstall it.  To do so, run\
+        \n# \"xmlcatmgr remove nextCatalog ${prefix}/${instdir}/catalog.xml\"."
+    ui_msg \
+    "######################################################################"
+}
+
+# This will remove the catalog entry for this port once a post-deactivate hook
+# has been implemented.
+#post-deactivate {
+#    system "xmlcatmgr remove nextCatalog ${prefix}/${instdir}/catalog.xml"
+#}

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20070528/305fe087/attachment.html


More information about the macports-changes mailing list