#39376 closed defect (invalid)
gnome-keyring @2.30.3_6 can not be installed
Reported by: | mkae (Marko Käning) | Owned by: | dbevans (David B. Evans) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 2.1.3 |
Keywords: | Cc: | cooljeanius (Eric Gallager) | |
Port: | gnome-keyring |
Description
---> Activating gnome-keyring @2.30.3_6 Error: org.macports.activate for port gnome-keyring returned: Image error: /usr/lib/pam/pam_gnome_keyring.so already exists and does not belong to a registered port. Unable to activate port gnome-keyring. Use 'port -f activate gnome-keyring' to force the activation. Error: Failed to install gnome-keyring
I am baffled by the path here: /usr/lib/pam !!! This is outside MacPorts' file system!!!
Attachments (1)
Change History (8)
comment:1 Changed 11 years ago by cooljeanius (Eric Gallager)
Cc: | egall@… added |
---|
Changed 11 years ago by davidfavor (David Favor)
Attachment: | gnome-keyring.main.log added |
---|
comment:2 Changed 11 years ago by davidfavor (David Favor)
This is a bit odd, since the error is thrown about a system file (/usr/lib outside macports /opt) so what to do...
This command outputs what I'd expect...
David-Favor-iMac# port provides /usr/lib/pam/pam_gnome_keyring.so /usr/lib/pam/pam_gnome_keyring.so is not provided by a MacPorts port.
Ah... that's right, PAM has to have files placed where it expects to ensure no exploit/malware is attempting a machine hijack... so... this is set...
destroot.violate_mtree yes
Searching for all occurrences of pam_gnome_keyring shows only one Portfile.
David-Favor-iMac# ack -i -r -l pam_gnome_keyring /opt/local/var/macports /opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/gnome/gnome-keyring/Portfile
So the problem must be in the Portfile...
Ah... now I get it.
Here's the problem.
1) Install MacPorts + some port that requires gnome-keyring
2) Completely remove MacPorts via brute force rm -rf ... (per the MacPorts Guide)
3) Reinstall MacPorts + some port that requires gnome-keyring
At this point the install done in #1 has left /usr/lib/pam/pam_gnome_keyring.so as residue (wasn't removed in #2)
So a simple fix might be something like...
pre-destroot { file delete -force ${destroot}/usr/lib/pam/pam_gnome_keyring.la }
This way a -force delete is done (which should do a rm -f and ignore errors) prior to install. Thus if the residue of a previous install exists, it's just quietly removed.
I'll try this + if it works provide a patch file.
Whew... this was driving me crazy...
comment:3 Changed 11 years ago by davidfavor (David Favor)
I'm unable to figure out the correct phase where to insert the delete, so someone smarter than me will have to generate the patch.
comment:4 Changed 11 years ago by mkae (Marko Käning)
I can't figure out why the file landed not below /opt/local in the first place and therefore wasn't removed properly.
Did you check whether the previous port revision did truly install it below /usr/lib/?
comment:5 Changed 11 years ago by dbevans (David B. Evans)
Status: | new → assigned |
---|
Here's the deal. The file is installed outside the MacPorts tree because it has to be to work properly. It is a PAM binary module and it needs to reside in the system PAM module directory for it properly interface with the system PAM implementation.
There really is nothing wrong with this port. If you deactivate or uninstall the port using Mac Ports, the file is removed during the deactivate phase. If you reinstall it is installed in the activate phase. This works whether the file is in the MacPorts tree or not (try it).
The problem is in step 2 above. By using the brute force remove, you don't remove the file in question (because you didn't use a brute force remove on it too) and you destroy the MacPorts registry so it "forgets" after the new install that it had previously been installed.
If you really want to nuke the MacPorts installation and reinstall a new one, you really should uninstall the existing ports and then use the brute force remove.
sudo port echo installed > ~/installed_ports (so you can remember what to reinstall) sudo port uninstall installed (remove all installed ports) rm -rf ${prefix) (now nuke what's left)
Do whatever you were going to do such as (upgrade to a newer major OS version) then reinstall MacPorts as usual (say the one that goes with the new OS version) then:
sudo port install `cat ~/installed_ports`
If you have done it the way you describe, to recover, you just need to do what the error message says and remove the offending file or force the activation of the new version. The old file will be moved aside with distictive tag that can be removed later.
sudo port -f activate gnome-keyring
I hope this clarifies the situation.
comment:6 Changed 11 years ago by dbevans (David B. Evans)
Resolution: | → invalid |
---|---|
Status: | assigned → closed |
Closing as invalid because there is really nothing to fix.
Cc Me!