* Re: [gentoo-portage-dev] [PATCH] Portage to write a compressed copy of 'Packages' index file
@ 2012-08-08 21:56 99% ` W-Mark Kubacki
0 siblings, 0 replies; 1+ results
From: W-Mark Kubacki @ 2012-08-08 21:56 UTC (permalink / raw
To: gentoo-portage-dev
On Wed, Aug 08, 2012 at 02:00:23PM -0700, Zac Medico wrote:
> On 08/08/2012 11:35 AM, W-Mark Kubacki wrote:
> > 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.)
>
> I've fixed it to use an atomic_ofstream as GzipFile's fileobj argument:
>
> http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e95a07267c7f642fdca2aca346ab4c12f46748bb
I've noticed the differences between my initial patch and your commit.
Thank you!
Indeed, GzipFile not closing the underlying 'fileobj' makes things ugly.
Your previous and now detached commit (where 'os.pid' has been appended
to the file name and, after having been closed, the file was renamed)
made me wonder whether modification times would be preserved. Well,
that's an obsolete though now.
The example usage with Apache httpd is not complete. Some conditions are
missing. I have no Apache httpd at hand, but that's what I gather from
the documentation:
RewriteCond %{HTTP:Accept-encoding} gzip
RewriteCond %{REQUEST_FILENAME}\.gz -s
RewriteRule ^(.*)/Packages$ $1/Packages.gz
[QSA,T=text/plain,E=no-gzip:1,L]
<FilesMatch "Packages\.gz$">
Header set Content-Encoding gzip
</FilesMatch>
'Packages' served as 'text/plain' will prevent browsers from downloading
that file like, say, zip files. And, one of my next patches will
introduce the 'Accept' HTTP header which could come in handy in future
extensions – and content-negotiation on server-side; 'text/plain+diff'
anyone? ;-)
--
Grüße, Mark
^ permalink raw reply [relevance 99%]
Results 1-1 of 1 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2012-08-08 18:35 [gentoo-portage-dev] [PATCH] Portage to write a compressed copy of 'Packages' index file W-Mark Kubacki
2012-08-08 21:00 ` Zac Medico
2012-08-08 21:56 99% ` W-Mark Kubacki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox