Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 3 Dec 1995 05:21:43 -0800
From:      asami@cs.berkeley.edu (Satoshi Asami)
To:        ports@freebsd.org
Subject:   Proposal 7: Remove recursion from PLIST processing
Message-ID:  <199512031321.FAA01051@silvia.HIP.Berkeley.EDU>

next in thread | raw e-mail | index | archive | help
People who have made their own port knows that pkg/PLIST can be a real 
pain to maintain for large packages, especially with all those
directories and stuff.

Now, here's an easy way to fix that -- use the --norecurse option to
tar when we call it from pkg_create.  That way, we can just do a "cd
/usr/local; find share/emacs" kind of thing ("kind of" because it can
still be in multiple directories, like "share/emacs" and
"libexec/emacs", which will require multiple passes) to generate most
of the list.

The way it stands now, we either list the directory name, or all the
filenames.  The former is not recommended, as some files might get
added later, and the latter is pretty inconvenient, as

(1) The "find" output includes directory names as well, which will
    result in that subtree being included twice if you leave them in.
    Yes you can hand-delete them, but when there are hundreds of
    files, you can easily miss something.

(2) There can be an empty directory, or a directory which may or may
    not be empty (think of site-lisp in emacs -- if you install ispell
    first, that won't be empty when emacs comes in), and you will need
    to play some tricks with @exec mkdir and such.

(3) You can't set the modes/ownerships of directories correctly,
    unless you specify them with @mode etc.  The extracting tar will
    create them automatically, with whatever ownership/modes that it
    chooses to, if we don't have the directories in the tarfile.

The downside of this is that we can no longer be "lazy" and just
specify the directory name in the PLIST, I'm not sure how many of them 
are like this but if this is approved, I'll go over all of them for
once, and it will be easier from there on.

This will also (more or less) solve the problem of deleting only what
we are supposed to from pkg_delete, as we can just do unlink()/rmdir()
of everything in PLIST in reverse order.

This should DTRT most of the time.  Yes, I can see some extra
directories deleted now and then, but that's not too serious -- as
long as we be careful to only put things that pretty much belong to
that port, there won't be much danger.

What do you think?  (Yes, I know about the PLIST discussion between
Jordan and Michael, but that went too far. :)

Satoshi



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199512031321.FAA01051>