tech-pkg archive

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

PR 35340 (empty ancestors of OWN_DIRS get removed by pkg_delete)



In the interest of cleaning up old baggage:

There is a problem with the OWN_DIRS support, which is that it creates
directories with mkdir -p and then removes them again afterwards with
rmdir -p. This causes any now-empty ancestors of the directories in
OWN_DIRS to disappear, regardless of whether pkgsrc created them,
which isn't right and is occasionally problematic (in the original
report, it lead to /var/tmp disappearing).

ISTM that the proper solution is to stop using either mkdir -p or
rmdir -p, and fix any packages that break because they weren't
explicitly listing their own intermediate dirs.

When I wrote that in the PR in 2015 I pointed out that this creates
problems (if package foo puts /var/db/foo in OWN_DIRS, does it need to
also list /var/db?) but looking at it again I think this is
straightforward: anything underneath $(PREFIX) or $(VARBASE) should be
listed explicitly, because no matter how standard it is it might not
actually exist at any given time. (Imagine for example a fresh
installation with VARBASE=/var/pkg; /var/pkg will be empty...)

So, at this point I don't see any barrier to this fix other than just
doing it and fixing whatever breaks. There's a reasonable number of
packages that use OWN_DIRS, but not a huge number, and doing a pass on
them by hand should anticipate most of the breakage.

Consequently I'm inclined to go ahead; there's still ~a month before
the next freeze, and that seems like plenty of time to sort out any
failures.

Thoughts?

-- 
David A. Holland
dholland%netbsd.org@localhost


Home | Main Index | Thread Index | Old Index