How useful is %%DATADIR%%, anyway?

Chris Rees utisoft at gmail.com
Fri Mar 23 20:15:22 UTC 2012


Hi all,

(tl;dr at the bottom)

Just as a thought, I decided to try stripping out all mentions of
%%DATADIR%%, %%DOCSDIR%% etc from pkg-plist, and replacing them with
PORTDOCS=*, PORTDATA=* in the Makefiles etc.

[crees at pegasus]/tmp/portss% df -h /tmp/ports*
Filesystem                               Size    Used   Avail Capacity
 Mounted on
dumpster/tmp/ports                        20G    478M     19G     2%
 /tmp/ports
dumpster/tmp/portss                       20G    444M     19G     2%
 /tmp/portss
[crees at pegasus]/tmp/portss% expr 444 - 478
-34
[crees at pegasus]/tmp/portss% expr 3400 / 478 # Calculate percentage
space reduction
7

The main rationale for having files in static plists, as far as I can
see is that one can grep the plists for files they've found lying
around if pkg which doesn't come up with anything.... which is clearly
useful for files in /usr/local/bin or similar.

However, if a file is in DATADIR, it'll be in a directory called
/usr/local/share/${PORTNAME}, so it's pointless keeping these files in
plists for that reason alone.

=======

tl;dr it saves about 34M, or 7% of the ports tree checkout if we use
the PORTDOCS/DATA/EXAMPLES macros, which is definitely noticeable.

I propose modifying the Porter's Handbook to discourage use of
%%PORTDOCS%% etc in static plists, and encourage the use of PORTDOCS
etc macros instead.  No need to actually convert existing ports (large
amount of churn), but as far as I can see, these lines are a waste of
space and bandwidth.

Anyone disagree?

Chris


More information about the freebsd-ports mailing list