FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo Portage Developer

 
 
LinkBack Thread Tools
 
Old 08-08-2012, 06:35 PM
W-Mark Kubacki
 
Default Portage to write a compressed copy of 'Packages' index file

Hi Portage devs,

Can I send patches by `git send-email` or do you prefer attachments?

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>
 
Old 08-08-2012, 08:22 PM
Zac Medico
 
Default 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
 
Old 08-08-2012, 09:00 PM
Zac Medico
 
Default Portage to write a compressed copy of 'Packages' index file

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=e95a07267c7f642fdca2aca346a b4c12f46748bb
--
Thanks,
Zac
 

Thread Tools




All times are GMT. The time now is 05:00 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org