Portage to write a compressed copy of 'Packages' index file
On 08/08/2012 11:35 AM, W-Mark Kubacki wrote:
> Hi Portage devs,
>
> Can I send patches by `git send-email` or do you prefer attachments?
Either way is fine.
> The patch applies to master/HEAD and can be backported to 2.1*. Its
> description is as follows:
>
> Portage writes a compressed copy of 'Packages' index file.
>
> This behaviour is enabled by FEATURES="compress-index". The
> resulting file is 'Packages.gz' and its modification time will
> match that of 'Packages'.
>
> Web-servers use that copy to avoid repeated on-the-fly compression.
>
> In order to re-use 'atomic_ofstream' usage of 'codecs.zlib_codec'
> has been considered and discarded, because 'GzipFile' yields
> smaller files. (According to Mark's tests 62% smaller.)
>
> Example usage, Nginx:
>
> location =/Packages {
> gzip_static on;
> default_type text/plain;
> }
>
> Apache httpd (use with caution):
>
> RewriteRule ^(.*)/Packages$ $1/Packages.gz
> [T=text/plain,E=GZIP:gzip,L]
> <FilesMatch "Packages.gz$">
> Header set Content-Encoding gzip
> </FilesMatch>
>
Thanks, I've applied your patch:
http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=11c0619c63b54346ee5c67cd67a b1ccb24f5f947
--
Thanks,
Zac
|