free-distfiles-space

Description

The free-distfiles-space utility, usually located at /usr/bin/free-distfiles-space, is a helper application used by the update-buildspace application to maintain the Most Recently Used (MRU) distribution files repository.

Use

The free-distfiles-space utility has three modes of operation which can either be used individually or combined, in any order and combination. The first of these modes is activated using the -f or --display-free option, as shown below, and will display the current free space in the directory pointed to by the DISTDIR variable.

build free-distfiles-space -f
Free space available in DISTDIR (/mnt/portage/distfiles) : 88 MB (92454912 bytes) 

The second mode of operation, which is activated using the -r or --display-required option, displays the amount of free space which would be required in the directory pointed to by DISTDIR to download all the distribution files required to build the available updated packages.

build free-distfiles-space -r
Free space required in DISTDIR (/mnt/portage/distfiles) : 127 MB (133450170 bytes) 

The third and final mode of operation, activated using the -d or --free-delete option, will ensure that sufficient space is available in the directory pointed to by DISTDIR to download all the distribution files required to build the available updated packages by repeatedly deleting the least recently used (LRU) files.

build free-distfiles-space -d
Freeing space for distfiles.........done. 

As mentioned above the options can be supplied in any order or combination and the appropriate functions will be performed, always in the order shown in the output below. All three options, the most common use-case, is shown here as an example.

build free-distfiles-space -r -d -f
Free space available in DISTDIR (/mnt/portage/distfiles) : 88 MB (92454912 bytes) 
Free space required in DISTDIR (/mnt/portage/distfiles) : 127 MB (133450170 bytes) 
Freeing space for distfiles.........done.