Gentoo Archives: gentoo-portage-dev

From: Zac Medico <zmedico@g.o>
To: gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] [PATCH] Portage to write a compressed copy of 'Packages' index file
Date: Wed, 08 Aug 2012 21:09:02
Message-Id: 5022CA97.5060407@gentoo.org
In Reply to: [gentoo-portage-dev] [PATCH] Portage to write a compressed copy of 'Packages' index file by W-Mark Kubacki
1 On 08/08/2012 11:35 AM, W-Mark Kubacki wrote:
2 > Hi Portage devs,
3 >
4 > Can I send patches by `git send-email` or do you prefer attachments?
5
6 Either way is fine.
7
8 > The patch applies to master/HEAD and can be backported to 2.1*. Its
9 > description is as follows:
10 >
11 > Portage writes a compressed copy of 'Packages' index file.
12 >
13 > This behaviour is enabled by FEATURES="compress-index". The
14 > resulting file is 'Packages.gz' and its modification time will
15 > match that of 'Packages'.
16 >
17 > Web-servers use that copy to avoid repeated on-the-fly compression.
18 >
19 > In order to re-use 'atomic_ofstream' usage of 'codecs.zlib_codec'
20 > has been considered and discarded, because 'GzipFile' yields
21 > smaller files. (According to Mark's tests 62% smaller.)
22 >
23 > Example usage, Nginx:
24 >
25 > location =/Packages {
26 > gzip_static on;
27 > default_type text/plain;
28 > }
29 >
30 > Apache httpd (use with caution):
31 >
32 > RewriteRule ^(.*)/Packages$ $1/Packages.gz
33 > [T=text/plain,E=GZIP:gzip,L]
34 > <FilesMatch "Packages\.gz$">
35 > Header set Content-Encoding gzip
36 > </FilesMatch>
37 >
38
39 Thanks, I've applied your patch:
40
41 http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=11c0619c63b54346ee5c67cd67ab1ccb24f5f947
42
43 --
44 Thanks,
45 Zac