Subject: WRKOBJDIR and stale links
To: None <tech-pkg@netbsd.org>
From: Arto Huusko <arto.huusko@utu.fi>
List: tech-pkg
Date: 06/03/2003 19:15:45
Ended up in a fine mess a couple of days ago when I installed a
new machine and started building pkgsrc from scratch.

The situation was this: I have pkgsrc NFS mounted, but I use
WRKOBJDIR in order to do the actual build on a local disk. I had
been using the same NFS mounted tree on another machine, which
I now replaced.

When I installed the new machine, I decided to organize my files
a bit differently, so I changed WRKOBJDIR in mk.conf to point
somewhere else entirely. The value WRKOBJDIR had had earlier
pointed to void: such directory does not exist on the new machine.

I had not cleaned up the pkgsrc tree, so it contained a lot of
directories named "work.i386", which were symlinks to the previous
WRKOBJDIR that now no longer exists.

I started a build of some package, by doing "make clean", and then
"make install". The system proceeded to build the dependencies.

After some time, I started to bring GNOME up, and then I just realised
that the whole system was more or less unusable. I'm not sure what
had happened, but apparently pkgsrc thought it had installed a lot
of pacakges which it really had not.

For example, I most certainly have not deleted any directories from
under "/usr/pkg/share" on the new system, but as I just started figuring
out why vim doesn't work, I realised I don't have "/usr/pkg/share/vim".
So I go build "vim-share". At this point, pkgsrc tells I already have
it installed. And, so I do. But no files...

So, any ideas what happened? Is this possible at all?