Opened 10 years ago

Closed 10 years ago

#28251 closed enhancement (fixed)

caml-findlib: add pre-deactivate code

Reported by: ryandesign (Ryan Schmidt) Owned by: mww@…
Priority: Normal Milestone:
Component: ports Version: 1.9.2
Keywords: Cc:
Port: caml-findlib

Description

caml-findlib prints this message during installation:

--->  Activating caml-findlib @1.2.6_0
## Adding line `/opt/local/lib/ocaml/site-lib/stublibs' to file /opt/local/lib/ocaml/ld.conf
## Be sure to remove this line if you uninstall caml-findlib
--->  Cleaning caml-findlib

And the portfile contains this commented-out block of code:

# pre-deactivate doesn't actually exist
# which annoys me, because it means I can't remove the line I added to ld.conf
#pre-deactivate {
#        # remove our stublibs dir path from ld.conf
#        set ocamlfind_destdir [file normalize ${prefix}/lib/ocaml/site-lib/stublibs]
#        set ldconfpath ${destroot}[exec ${destroot}${prefix}/bin/ocamlfind printconf ldconf]
#        set ldconfoutpath [file dirname $ldconfpath]/.[file tail $ldconfpath]~
#        if {[file exists $ldconfpath]} then {
#          set ldconf [open $ldconfpath r]
#          set ldconfout [open $ldconfoutpath w]
#          while {[gets $ldconf line] != -1} {
#            if {![string equal $line $ocamlfind_destdir]} {
#              puts $ldconfout $line
#            }
#          }
#          close $ldconfout
#          close $ldconf
#          file rename -force $ldconfoutpath $ldconfpath
#        }
#}

MacPorts does support pre-deactivate code blocks now, as long as the user is using the sqlite registry. So caml-findlib should not print this message, and should remove the line it added in post-activate, unless the user is still using the flat registry. See other existing ports having pre-deactivate blocks for suggestions of how this can be done.

Change History (1)

comment:1 Changed 10 years ago by jmroot (Joshua Root)

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.