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 5/17/2012 18:33, Joerg Sonnenberger wrote:
On Thu, May 17, 2012 at 04:22:40PM +0200, John Marino wrote:
On 11/17/2011 17:36, John Marino wrote:
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.


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.


To revisit an old topic, I'd like to start fixing packages with the
possibility of missing directories.

An example (assuming php5 isn't already installed):
1) install lang/php5
2) install databases/php-sqlite
3) uninstall databases/php-sqlite
4) Notice that lib/php/20040412 directory is missing.  This
directory is the content of lang/php5's OWN_DIRS variable.

Can we put a dummy file such as ".keep" in directories like these to
prevent them from getting removed by pkgsrc's garbage collector?
Maybe it's not elegant, but it will work.

As I said, use @pkgdir in lang/php5. That will work reliable to keep the
directory around.


Okay, I'll test that.

Home | Main Index | Thread Index | Old Index