Pruning the Ports Tree
Matthew Seaman
m.seaman at infracaninophile.co.uk
Sun Jun 13 02:09:38 PDT 2004
Lose 10 karma points for not keeping your line lengths reasonably
short.
On Sat, Jun 12, 2004 at 11:41:47PM -0700, Graham North wrote:
> Is it alright to prune the Ports tree - and still do updates later.
You're on your own if you do this. All of the infrastructure that
supports the use of the prots tree assumes that you will have a
complete tree in place. People telling cvsup to refuse chunks of the
ports tree (usually the language specific stuff) and then finding that
building the INDEX no longer works are a perennial sight on the
freebsd-ports at ... mailing list.
Having said that, now that you can just grab a freshly build INDEX
from the FreeBSD servers and there's no huge necessity to build your
own, refusing stuff should be less of a trap for the unwary. Use
# cd /usr/ports
# make fetchindex
to grab a fresh index (about 5MiB).
> I am running 4.8 stable and recently did a full Ports tree update using CVSUP. This generates several questions.
> 1) I took the advice of Michael Urban's book and upgraded from the "Head" of the source tree rather than from that for 4.8 - did I really want to do that? Does it matter for a Ports only updating?
That is correct. You as an individual user should only ever want to
grab the HEAD of the ports tree. All those RELEASE_4_10_0 labels just
mark the state of the tree at the point that the various release CDs
or DVDs were compiled. You'll note the difference compared to the
system sources, which use RELENG_4_10 and similar: such labels simply
do not exist within the ports tree, and if you try and cvsup ports
specifying one of them, cvsup will simply delete everything under
/usr/ports.
> 2) The tree is getting pretty big - result, lots of files. My hard drive is not very big - it is down to a few hundred inodes (file handles) within the usr directory. Can I prune the tree on my hard drive without compromising future updates? If it helps, my machine is not using X only command mode so there are lots of Ports that will never be made.
The ports tree isn't actually that big, considering that there are now
about 11,000 ports. However, as you use the ports, you will tend to
generate all sorts of other files and directories within the tree that
take up lots of space. Such as:
i) Distfiles -- the source code for the ports you have installed.
Use 'portsclean -D' to get rid of any out of date distfiles, or
'portsclean -DD' to get rid of any distfiles that don't
correspond to ports you have installed.
ii) README.html files. These appear if you run "make readmes" --
they're not necessary for day to day use of the ports tree, and
can just be deleted. Plus not having 'README.html' files
around keeps them out of the way of cvsup(1). To kill them all
off:
# cd /usr/ports
# find . -name README.html -print0 | xargs -0 rm
iii) work directories -- the directories where each port is actually
built. Once the port has been installed there's not much use
for hanging onto those. If you use portupgrade it will usually
clean them up as it goes along. Otherwise you can do:
# portsclean -C
or alternatively:
# cd /usr/ports
# make clean -DNOCLEANDEPENDS
If you don't use '-DNOCLEANDEPENDS' the clean-up will take a
great deal longer to eventually produce exactly the same
result.
It's true that the ports tree does consist of a large number of quite
small files, and that will tend to use up inodes quite rapidly.
However, you can't increase the number of inodes on a filesystem
without wiping it out completely and rebuilding from scratch.
Cheers,
Matthew
--
Dr Matthew J Seaman MA, D.Phil. 26 The Paddocks
Savill Way
PGP: http://www.infracaninophile.co.uk/pgpkey Marlow
Tel: +44 1628 476614 Bucks., SL7 1TH UK
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20040613/a58035a5/attachment.bin
More information about the freebsd-questions
mailing list