Gentoo Archives: gentoo-portage-dev

From: W-Mark Kubacki <wmark@×××××××××.de>
To: gentoo-portage-dev@l.g.o
Subject: [gentoo-portage-dev] [PATCH] Portage to write a compressed copy of 'Packages' index file
Date: Wed, 08 Aug 2012 21:08:28
Message-Id: 20120808183515.GA21605@3-0.hurrikane.de
1 Hi Portage devs,
2
3 Can I send patches by `git send-email` or do you prefer attachments?
4
5 The patch applies to master/HEAD and can be backported to 2.1*. Its
6 description is as follows:
7
8 Portage writes a compressed copy of 'Packages' index file.
9
10 This behaviour is enabled by FEATURES="compress-index". The
11 resulting file is 'Packages.gz' and its modification time will
12 match that of 'Packages'.
13
14 Web-servers use that copy to avoid repeated on-the-fly compression.
15
16 In order to re-use 'atomic_ofstream' usage of 'codecs.zlib_codec'
17 has been considered and discarded, because 'GzipFile' yields
18 smaller files. (According to Mark's tests 62% smaller.)
19
20 Example usage, Nginx:
21
22 location =/Packages {
23 gzip_static on;
24 default_type text/plain;
25 }
26
27 Apache httpd (use with caution):
28
29 RewriteRule ^(.*)/Packages$ $1/Packages.gz
30 [T=text/plain,E=GZIP:gzip,L]
31 <FilesMatch "Packages\.gz$">
32 Header set Content-Encoding gzip
33 </FilesMatch>

Attachments

File name MIME type
0001-Portage-writes-a-compressed-copy-of-Packages-index-f.patch text/plain

Replies