tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: OWN_DIRS doesn't protect directories as advertised



On 11/17/2011 3:31 PM, Joerg Sonnenberger wrote:
> On Thu, Nov 17, 2011 at 06:17:19PM +0900, OBATA Akio wrote:
>> I feel that pkg_delete(1) should be fixed.
>> Before removal of directory, check not only empty, but also refcount db.
> 
> I disagree. This instances should be properly using @pkgdir.
> 
> Joerg


For OBATA's suggestion, it has two problems:
1) It only works for new bootstraps or if the pkg_delete is updated
(which would be never for most cases I would think)
2) If the refcount db gets corrupted, the whole thing could be broken
forever?  I don't know the tech behind it or if one can rebuild the
database, but I've never been a fan of refcounts.

I also disagree with Joerg that these packages were done wrong.  If you
read the pkgsrc guide for OWN_DIRS and MAKE_DIRS, it was a legitimate
decision to choose this method of creating directories.

The whole thing is kind of a mess.  There are too many ways to do the
same thing, each with their own idiosyncrasies.  And according to
section 13.8 of the pkgsrc guide, it does not indicate that this will
successfully protect the directory from inadvertent deletion any more
than OWN_DIRS does.  In fact, some of this packages where I modified the
DEINSTALL were using the @pkgdir technique, and the missing directory
errors were there.  So count me skeptical that @pkgdir will actually
solve this problem.

John


Home | Main Index | Thread Index | Old Index