public
Description: Git mirror of the MacPorts svn repo
Homepage: http://www.macports.org
Clone URL: git://github.com/kballard/macports.git
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.


git-svn-id: http://svn.macports.org/repository/macports/trunk@25681 
d073be05-634f-4543-b044-5fe20cf6d1d6
Boey Maun Suang (author)
Mon May 28 00:27:38 -0700 2007
commit  1bb269868f0fef9a11d90d0f673bd4fe150752c9
tree    3f830ebb82d9ee6555bdd08bfce525f6e9da7c58
parent  4e9f35de7a7fd15a1dd6cef3cb4a8d8aa4ac82a1
...
15
16
17
 
18
19
20
...
33
34
35
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
...
15
16
17
18
19
20
21
...
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
0
@@ -15,6 +15,7 @@ checksums  md5 b38b895d47ef7058e4d42b52fdae23f4 \
0
     rmd160 4df75842c4cda825ba5f36f5e5235e796e49b1bb
0
 use_configure   no
0
 use_bzip2 yes
0
+depends_run port:xmlcatmgr
0
 build    {}
0
 
0
 set dirs_to_install  "catalog.xml common eclipse extensions fo highlighting \
0
@@ -33,3 +34,44 @@ destroot  {
0
     file copy ${worksrcpath}/${dirname} ${destroot}/${prefix}/${instdir}
0
   }
0
 }
0
+post-activate {
0
+ # xmlcatmgr as installed by MacPorts defaults to using
0
+ # ${prefix}/etc/xml/docbook (for XML) and ${prefix}/etc/xml/docbook (for
0
+ # SGML) if no catalog is specified, but we'll specify the path just in case
0
+ # users have another installation of xmlcatmgr and happen to have it before
0
+ # ${prefix}/bin in their PATH.
0
+ set catalog.xml ${prefix}/etc/xml/catalog
0
+
0
+ # Make the directory if it doesn't exist
0
+ if {![file exists ${prefix}/etc/xml]} {
0
+ xinstall -m 755 -d ${prefix}/etc/xml
0
+ }
0
+
0
+ # Create the catalog file if it doesn't exist
0
+ if {![file exists ${catalog.xml}]} {
0
+ system "xmlcatmgr create -c ${catalog.xml}"
0
+ }
0
+
0
+ # Add the nextCatalog entry to the catalog if it doesn't exist
0
+ if {[catch {exec xmlcatmgr lookup ${prefix}/${instdir}/catalog.xml}]} {
0
+ system "xmlcatmgr add nextCatalog ${prefix}/${instdir}/catalog.xml"
0
+ }
0
+
0
+ # Once MacPorts does get a post-deactivate hook, this should change to
0
+ # auto-detect whether or not the user's installed version has the hook, and
0
+ # only print the message if it doesn't.
0
+ ui_msg \
0
+ "######################################################################"
0
+ ui_msg "# As MacPorts does not currently have a post-deactivate hook,\
0
+ \n# you will need to ensure that you manually remove the catalog\
0
+ \n# entry for this port when you uninstall it. To do so, run\
0
+ \n# \"xmlcatmgr remove nextCatalog ${prefix}/${instdir}/catalog.xml\"."
0
+ ui_msg \
0
+ "######################################################################"
0
+}
0
+
0
+# This will remove the catalog entry for this port once a post-deactivate hook
0
+# has been implemented.
0
+#post-deactivate {
0
+# system "xmlcatmgr remove nextCatalog ${prefix}/${instdir}/catalog.xml"
0
+#}

Comments

    No one has commented yet.