summaryrefslogtreecommitdiff
path: root/net-proxy/http-replicator/files/http-replicator-3-unique-cache-name.patch
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /net-proxy/http-replicator/files/http-replicator-3-unique-cache-name.patch
reinit the tree, so we can have metadata
Diffstat (limited to 'net-proxy/http-replicator/files/http-replicator-3-unique-cache-name.patch')
-rw-r--r--net-proxy/http-replicator/files/http-replicator-3-unique-cache-name.patch31
1 files changed, 31 insertions, 0 deletions
diff --git a/net-proxy/http-replicator/files/http-replicator-3-unique-cache-name.patch b/net-proxy/http-replicator/files/http-replicator-3-unique-cache-name.patch
new file mode 100644
index 000000000000..3ad0529ed16a
--- /dev/null
+++ b/net-proxy/http-replicator/files/http-replicator-3-unique-cache-name.patch
@@ -0,0 +1,31 @@
+Author: Matthew Ogilvie
+Date: Sun Dec 28 20:14:15 2014 -0700
+
+ honor x-unique-cache-name header in flat mode, if present
+
+ This allows things like different versions of the adobe-flash
+ downloader that are given different names in a flat download
+ directory (like in gentoo) to work in an http-replicator cache
+ as well. As long as the fetcher passes the custom name through
+ the experimental header...
+
+ See gentoo bug # 442874
+
+diff --git a/http-replicator b/http-replicator
+index 19ae427..befe9f2 100755
+--- a/http-replicator
++++ b/http-replicator
+@@ -311,7 +311,12 @@ class HttpClient (Http):
+ self.log.info('requested range: bytes %s to %s' % self.range) # log request
+
+ head = ''
+- for tail in self.path.split('/'): # iterate over items in path
++ adjUrlPath = self.path
++ if not self.direct and self.flat:
++ uniqueCacheName = body.get('x-unique-cache-name')
++ if uniqueCacheName:
++ adjUrlPath = uniqueCacheName
++ for tail in adjUrlPath.split('/'): # iterate over items in path
+ head = os.path.join(head, tail) # build target path
+ if head in self.alias: # path up till now hos an alias
+ head = self.alias[head] # replace by alias