[http-replicator-users] [PATCH] http-replicator - set "flat mode" only for some file
Brought to you by:
g3rtjan
From: Goffredo B. <kre...@al...> - 2008-01-31 21:16:14
|
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 |