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

port files layout

I want to bring up that the current port files layout simply sucks.  It
is wasteful of inode and directory entries and places an un-needed tax on
CVS.  This is a major concern when you have 3700 ports and growing.

The FreeBSD project has discussed this layout change:

    Old way

    New way

I would like for the effort to consider this.  I'll include a message by
Satoshi Asami (at only 3000 ports) giving some of the reasoning behind
this change.  The layout is slightly different in his email, but I
believe he changed it later (I just cannot find the email to that

Satoshi also preferred leaving patch-* in patch/, but I still *strongly*
believe that to be wrong, as most ports do not have more than 5 patches.
There is no port with so man patches that things get cluttered to the
point of a simple ``ls'' not fitting on one screen -- even an ls of the
`pm3-base' port (with patches in the main directory) fits in a single
standard 80x24 console.  Note the `pm3-base' port is a very extreme
anomaly for us.


Cc: FreeBSD Ports <ports@FreeBSD.org>
Subject: Re: multi-level categories
From: asami@FreeBSD.org (Satoshi - Ports Wraith - Asami)
Date: 14 Feb 2000 01:58:18 -0800
Message-ID: <vqcitzshzr9.fsf@silvia.hip.berkeley.edu>

Anyway, here are some stats from today's ports tree.  No distfiles,
packages or work directories of course.

(1) du /home/ncvs/ports                  -> 142MB
(2) du /usr/ports                        -> 105MB
(3) size of tar cf - /usr/ports          ->  99MB
(4) # of directories in /home/ncvs/ports -> 15267
(5) # of directories in /usr/ports       -> 11257
(6) # of pkg/ dirs                       ->  3081
(7) # of files/ dirs                     ->  2834
(8) # of files/ dirs with only md5       ->  2325
(9) # of patches/ dirs                   ->  1961
(a) # of scripts/ dirs                   ->   199
(b) # of files in /usr/ports (incl. CVS) -> 57038
(c) # of CVS files in /usr/ports         -> 33771

Each directory comes with a CVS directory.  The sizes above include
the CVS dirs but the directory counts do not.  (You can assume CVS
directories will simply double the directory count.)  (6) - (c) are
all for /usr/ports, not the repository.  There are about 3,100 ports

The difference between 2 and 3 should be block fragmentation.
(Filesystem and tar format experts, is that correct?)  If that is
true, having a lot of small files isn't hurting *that* much in terms
of total space required.

And here's my proposal, slightly revised.

          .../checksum            (<- files/md5)
          .../pkgCOMMENT         \
          .../pkgDESCR            \ these stuff moved
          .../pkgPLIST            /  from ${PKGDIR}
          .../pkgREQ             /

Basically it amounts to moving everything in pkg/ out to the main dir
by appending the prefix "pkg" in the filenames instead, and moving
"files/md5" to "checksum" in the main directory.

Of the 11,257 directories (5), this will get rid of 3,081 pkg/ dirs
(6) and 2,325 files/ dirs (8) for a revised total of 5,851, or a 48%
reduction in directory count.  The reduction of 5,406 directories also
means 5,406 CVS directories and 16,218 CVS files (3 files per dir)
will disappear, so there will be 40,820 files in the checked out ports
tree for a 28% reduction.

In total, the number of files and directories, which is at 79552 ((5)
x 2 + (b)) currently will be reduced by 21,624 (5,406 + 16,218), or a
27% reduction in inode count.

I don't want to move patches out to the main directory, some ports
have an enormous number of patches and the toplevel will look too
cluttered.  I am ambivalent about moving patches into files.  Since
most files/ directories will be gone with md5 moving out anyway (there
will only be 509 files/ dirs after md5 moves out), there aren't much
savings to be made there.  Also, there are some ports that put "extra"
patches in files/ for special treatment, which could create some

I'd like to keep scripts/ as it is.  It is perfectly legal to put a
file called "configure" in files/ now, and it will violate POLA to
change the meaning.  Also, only less than 10% of ports have scripts/
dirs anyway.

-- David    (obrien@NUXI.com)

To unsubscribe: send mail to <majordomo@unixathome.org>
with "unsubscribe bsdports" in the body of the message