[http-replicator-users] Fwd: [PATCH] http-replicator - set "flat mode" only for some file
Brought to you by:
g3rtjan
From: Goffredo B. <kre...@al...> - 2008-02-22 12:22:41
|
Hello Gertjan, what about the enclosed patch ? Is there any reason, which blocks this patch ? If you like the idea, a possible improvement is to specify the depth of the directory for the "flat" file. For example: the *.rpm files don't need to record the path. If the file names differ, the contents too. Instead for the "primary.xml.gz" files, I need to record almost 7 level of directory (... 7/Fedora/i386/os/repodata/primary.xml.gz) in order to differentiate it between the different distros. Please give me a feedback. I will provide an enanched patch. BR Goffredo ---------- Forwarded Message ---------- Subject: [PATCH] http-replicator - set "flat mode" only for some file Date: Thursday 31 January 2008 From: Goffredo Baroncelli <kre...@al...> To: htt...@li... Hello Gertjan, Enclose you can find a patch to http-replicator. This patch permit to select the "flat" mode only for some file. The selction is done by a regular expression. This behaviour is asked by a my friends (in cc). He want to cache the request for rpm packages. For Fedora, if two *rpm* packages have different names, then the packages are differents. But for other files (notabily the indices, which have same name but different path) this is not true. So I added the option --flat-pattern <PATTERN>. When a requested file matches a pattern, this is stored only by its name. Otherwise not. So if I start http-replicator as: export http_proxy=localhost:8888 http-replicator -r /tmp/cache \ -p 8888 \ --flat-pattern "rpm$" \ --daemon /tmp/replicator.log and then I download wget 'http://site1/fedora/8/Fedora/i386/os/Packages/akode-pulseaudio-2.0.1-9.fc8.i386.rpm wget 'http://site2/fedora/8/Fedora/i386/os/Packages/akode-pulseaudio-2.0.1-9.fc8.i386.rpm wget 'http://site3/fedora/8/Fedora/i386/os/Packages/akode-pulseaudio-2.0.1-9.fc8.i386.rpm The 2nd and 3rd requests are satisfied by the cache, because the filenames are the same AND the extension is "rpm" Instead if I do: wget 'http://site1/fedora/8/Fedora/i386/os/repodata/primary.xml.gz wget 'http://site1/fedora/7/Fedora/i386/os/repodata/primary.xml.gz The 2nd request is not satisfied by the cache, because even tough the filenames are the same, the extension not are "rpm". BR Goffredo -- gpg key@ keyserver.linux.it: Goffredo Baroncelli (ghigo) <kre...@in...> Key fingerprint = CE3C 7E01 6782 30A3 5B87 87C0 BB86 505C 6B2A CFF9 ------------------------------------------------------- -- gpg key@ keyserver.linux.it: Goffredo Baroncelli (ghigo) <kre...@in...> Key fingerprint = CE3C 7E01 6782 30A3 5B87 87C0 BB86 505C 6B2A CFF9 |