Deactivating the installed version before trying to install the update

Adam Mercer ram at macports.org
Sun Jan 19 20:03:53 PST 2014


Hi

In a port that I maintain there's a bug in the current version that
causes the build to fail if the old version is active. I'm involved in
the upstream project and we are working on resolving this but it's
going to take a while to fix. In the meantime I am trying to add a
check to the Portfile to see if a previous version of the port is
active and deactivate it in the pre-configure stage.

Looking through the FAQ I found the deavtivate hack:

<http://trac.macports.org/wiki/PortfileRecipes#deactivatehack>

So I've been trying to use something like this, namely:

pre-configure {
  # bug in swig bindings that causes build to fail if previous version is active
  if {![catch {set installed [lindex [registry_active lal] 0]}]} {
    registry_deactivate_composite lal "" [list ports_nodepcheck 1]
  }
}

But this is failing with the following:

--->  Configuring lal
--->  Deactivating lal @6.11.0_2+swig_python
Error: org.macports.configure for port lal returned: sqlite error:
unable to open database file (14) while executing query: UPDATE
registry.files SET active=0 WHERE actual_path=? AND id=?
Please see the log file for port lal for details:
    /opt/local/var/macports/logs/_Users_ram_git_mp_testing_science_lal/lal/main.log
To report a bug, follow the instructions in the guide:
    http://guide.macports.org/#project.tickets
Error: Processing of port lal failed

With nothing extra in main.log, clearly I'm doing something wrong here
but can't see it.

Has anyone got any pointers or any recommendations on how to
deactivate the installed version of the port before trying to build?

Cheers

Adam


More information about the macports-dev mailing list