From: Andrea Riciputi <ariciputi@pi...> - 2004-11-16 16:22:21
I was working on a package that I maintain when I noticed that a file
was installed in /etc instead of /sw/etc. The problem was related to my
poor understanding of python distutils, nevertheless when I tried to
remove the package to fix my error fink removed the /etc that in fact
is sym-link to /private/etc.
Runnning Disk Utility recreated /etc sym-link, but I was wondering why
fink removed the link and not only the file that my package put there.
Here there is the wrong package content:
drwxr-xr-x root/admin 0 2004-11-16 11:17:37 ./etc/
-rw-r--r-- root/admin 1666 2004-01-18 16:29:44 ./etc/pyxrc
drwxr-xr-x root/admin 0 2004-11-16 11:17:37 ./sw/
Now that I've fixed it those line read:
drwxr-xr-x root/admin 0 2004-11-16 14:40:12 ./sw/
drwxr-xr-x root/admin 0 2004-11-16 14:40:06 ./sw/etc/
-rw-r--r-- root/admin 1666 2004-01-18 16:29:44 ./sw/etc/pyxrc
Could you explain me why this happens?
Thanks in advance,
From: Andrea Riciputi <ariciputi@pi...> - 2004-11-16 18:16:00
Uhm... I see, so I'm supposed to have been very very lucky... Anyway,
could you explain this a little further? You say "according to its
database", but which database? Do you mean the .deb file or dpkg keeps
track of all the files it has installed since ever, and since
/etc/pyxrc was the first file in that directory it removed it?
On 16 Nov 2004, at 19:03, David R. Morrison wrote:
> It's actually dpkg which is doing the work here, rather than fink.
> When dpkg discovers that a directory is empty (according to its
> database), it removes that directory.
> if the directory is not really a directory, but is instead a symlink,
> the symlink gets removed.
> This is actually fortunate in this case, since your /etc was *not*
> erased as a result of this accident!
> -- Dave
From: David R. Morrison <drm@ma...> - 2004-11-16 21:17:04
On Nov 16, 2004, at 1:15 PM, Andrea Riciputi wrote:
> Uhm... I see, so I'm supposed to have been very very lucky... Anyway,
> could you explain this a little further? You say "according to its
> database", but which database? Do you mean the .deb file or dpkg keeps
> track of all the files it has installed since ever, and since
> /etc/pyxrc was the first file in that directory it removed it?
Yes. dpkg maintains a complete database of the files it has installed.
This is how it knows, for example, that a package is attempting to
overwrite a file that was already installed by dpkg. It's also one of
the reasons why we try to completely isolate fink's /sw tree from the
rest of the system, since any changes to files there other than by
using dpkg will mess up the dpkg database.