Page MenuHomeFreeBSD

mtree replacement package for ports
AbandonedPublic

Authored by matthew on Sep 28 2014, 10:53 AM.
Tags
None
Referenced Files
Unknown Object (File)
Apr 7 2024, 6:59 AM
Unknown Object (File)
Apr 7 2024, 6:58 AM
Unknown Object (File)
Mar 2 2024, 2:01 PM
Unknown Object (File)
Mar 2 2024, 2:00 PM
Unknown Object (File)
Jan 17 2024, 2:50 AM
Unknown Object (File)
Jan 13 2024, 10:50 AM
Unknown Object (File)
Dec 19 2023, 9:30 PM
Unknown Object (File)
Dec 2 2023, 11:50 PM
Subscribers

Details

Reviewers
bapt
Group Reviewers
portmgr
Summary

I seem to remember some talk about having a package like this, so I thought I'd try putting something together.

Essentially this uses mtree to generate the default filesystem layout under ${LOCALBASE} and then generates the corresponding pkg-plist. Recent changes to the ports infrastructure mean that when the last file in eg. /usr/local/bin is removed, that directory would be removed. Now, this should really not make a gread deal of difference in normal usage, but the fact that some well know directories may come and go arbitrarily seems to cause some alarm and despondency amongst developers and package building tools that have certain engrained expectations about the way ports works. There's also an argument that pkg(8) ignores any changes to ownership or modes of mtree files and will delete them willy-nilly, but that seems counter to the idea of what mtree(8) does in any case.

Test Plan

To regenerate the pkg-plist (only needed if BSD.local.dist is changed)

rm pkg-plist
sudo make pkg-plist clean

... and then fix the ownership of pkg-plist

To test:

make stage

make install

Diff Detail

Repository
rP FreeBSD ports repository
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

matthew retitled this revision from to mtree replacement package for ports.
matthew updated this object.
matthew edited the test plan for this revision. (Show Details)

Of course, this doesn't work at all, because the ports machinery strips out all of the mtree-owned directory structure...

matthew edited the test plan for this revision. (Show Details)
matthew added a reviewer: bapt.
antoine added inline comments.
ports-mgmt/ports-mtree/Makefile
21

obviously this fails to stage as a regular user...

ports-mgmt/ports-mtree/Makefile
21

oops this is pkg-plist, not do-install..

I'd have to see the full plan and Mk changes, but I would think this would become a run dependency on all ports? If so then it would cause all packages to be rebuilt once committed. That's not ok to me. If it were only a dependency on ports-mgmt/pkg then it's OK.

In D870#10, @bdrewery wrote:

I'd have to see the full plan and Mk changes, but I would think this would become a run dependency on all ports? If so then it would cause all packages to be rebuilt once committed. That's not ok to me. If it were only a dependency on ports-mgmt/pkg then it's OK.

If it's a dependency of ports-mgmt/pkg, there is a dependency loop?
Can't this be in the same package as pkg?

I wasn't necessarily intending to make this be a dependnecy on, or itself depend on anything. Ports will create any directories they actually need when they are installed: this is mostly about having a way to make the ports behave similarly to the way they did before we dropped mtree support from pkg(8).

Think of it like this: with pkg(8) a file or symlink can only belong to one package, but a directory can effectively belong to many different packages. Directories only get deleted when their last owner is removed, so the idea here is to make sure there's always this package around to own (if only in a shared way) the common directory heirarchy. It prevents surprising things like /usr/local/bin disappearing -- although if there's nothing in /usr/local/bin, then what use is it, and why shouldn't it be removed?

The more I think about the less I find it worth it :)

In D870#15, @bapt wrote:

Do we really need it?

No, it seems not.