I have been having some issues with darwinports, the open source package/port management system for Darwin/OS X. I am more familiar with the FreeBSD ports system and have worked out some coping strategies for when things don’t go well (thankfully, it doesn’t happen often).
So I had a port get stuck in such way that it built and was usable (the .so or .dylib files were installed) but the port wasn’t registered. That means that ports depending on it would break since they couldn’t install without it.
Here’s an example of what I was seeing:
—> Installing gettext 0.14.1_1
Error: Target com.apple.install returned: Registry error: gettext 0.14.1_1 already registered as installed. Please uninstall it first.
Warning: the following items did not execute (for gettext): com.apple.activate com.apple.install
white:/opt/local paul$ port -vf uninstall gettext
port uninstall failed: Registry error: gettext 0.14.1_0 not registered as installed.
white:/opt/local paul$ port -vf install gettext
—> Installing gettext 0.14.1_1
Error: Target com.apple.install returned: Registry error: gettext 0.14.1_1 already registered as installed. Please uninstall it first.
Warning: the following items did not execute (for gettext): com.apple.activate com.apple.install
white:/opt/local paul$ port -vf activate gettext
—> Activating gettext
port activate failed: Registry error: gettext 0.14.1_0 not registered as installed.
I had to find a little more about how the registration process works.
As it turns out, in /opt/local/var/db/dports is where all the action is.
(root@pink.local)-(08:02 PM / Thu Nov 11)
[/opt/local/var/db/dports]# ls
distfiles receipts_converted
receipts software
Distfiles is obvious, but receipts* and software are where we need to look.
(root@pink.local)-(08:02 PM / Thu Nov 11)
[/opt/local/var/db/dports]# ls receipts*
receipts:
MPlayer fontconfig libusb
MPlayer-1.0pre5.bz2 freetype libwmf
XFree86 gettext net-snmp
Xft2 gettext-0.14.1.bz2 pango
atk gimp2 pkgconfig
atk-1.6.0.bz2 glib2 render
bladeenc gtk2 tiff
cdrtools jpeg wget
dep_map.bz2 lcms xrender
expat libart_lgpl
file_map.db libpng
receipts_converted:
XFree86-4.3.0.bz2 gtk2-2.4.0.bz2 net-snmp-5.0.9.bz2
Xft2-2.1.6.bz2 jpeg-6b.bz2 pango-1.4.0.bz2
bladeenc-0.94.2.bz2 lcms-1.12.bz2 pkgconfig-0.15.0.bz2
cdrtools-2.00.3.bz2 libart_lgpl-2.3.16.bz2 render-0.8.bz2
expat-1.95.7.bz2 libpng-1.2.5.bz2 tiff-3.6.1.bz2
freetype-2.1.7.bz2 libusb-0.1.8.bz2 wget-1.9.1.bz2
gimp2-2.0.1.bz2 libwmf-0.2.8.2.bz2 xrender-0.8.4.bz2
These don’t match up: there was a change somewhere and ports installed after that date went into receipts_converted. And in software, we see the ports we have installed:
white:/opt/local/var/db/dports/software root# ls
fondu gettext gimp2 gtk2
fontconfig gimp glib2
What I ended up doing was ripping out any mention of the troubled ports (in my case gettext) and just re-invoking port -vf install gettext. There may be easier ways: there generally are, I find š
I’m sure the somewhat harsh cleaning I did has something to do with the fact I have so few ports in the software directory, but port installed shows quite a few:
white:/opt/local/var/db/dports/software root# port installed
The following ports are currently installed:
apache-ant 1.5.4_0 (active)
atk 1.4.1_0 (active)
bladeenc 0.94.2_0 (active)
bzip2 1.0.2_0 (active)
cadaver 0.21.0_0 (active)
DesktopManager 0.5.1_0 (active)
dlcompat 20030522_0 (active)
expat 1.95.7_0 (active)
fondu 030428_0 (active)
fontconfig 2.2.0_0 (active)
fontconfig 2.2.3_1
fortune-4.6.2 RELEASE_0 (active)
freetype 2.1.4_0 (active)
gd 1.8.4_0 (active)
gettext 0.14.1_1 (active)
glib 1.2.10_0 (active)
glib2 2.4.7_0 (active)
gtk 1.2.10_0 (active)
gtk2 2.4.0_0 (active)
gtk2 2.4.13_0
hymn 0.6.1_0 (active)
ImageMagick-6.0.2 7_0 (active)
intltool 0.30_0 (active)
jpeg 6b_0 (active)
lablgtk 1.2.6_0 (active)
lame 3.96_0 (active)
lcms 1.12_0 (active)
libart_lgpl 2.3.16_0 (active)
libbonobo 2.6.0_0 (active)
libcompat-4.6.2 RELEASE_0 (active)
libidl 0.8.3_0 (active)
libpng 1.2.5_0 (active)
libungif 4.1.0b1_0 (active)
libwmf 0.2.8.2_0 (active)
libxml2 2.6.7_0 (active)
lifelines 3.0.37_0 (active)
mldonkey 2.5.16_0 (active)
MPlayer 1.0pre5_0 (active)
mrtg 2.9.25_0 (active)
mysql4 4.0.16_0 (active)
net-snmp 5.0.9_0 (active)
ocaml 3.07pl2_0 (active)
orbit2 2.10.2_0 (active)
p5-xml-parser 2.34_0 (active)
pango 1.4.0_0 (active)
perl5.8 5.8.4_0 (active)
pkgconfig 0.15.0_0 (active)
popt 1.7_0 (active)
readline 4.3_0 (active)
render 0.8_0 (active)
tidy 20031101_0 (active)
tiff 3.5.7_0 (active)
wget 1.9.1_0 (active)
Xft2 2.1.6_0 (active)
xrender 0.8.4_0 (active)