Teach cache-url to handle file:// URIs.

We can now support file:// URIs in source-repositories files and other
places, by ignoring curl's inability to determine an HTTP status code
for them.

Change-Id: Ie226ce05ecb912b23cedc73fd7ba53c0b9c0fe35
This commit is contained in:
Chris Jones 2014-02-12 15:11:03 +00:00
parent a3f2836625
commit fde4572764

View File

@ -35,7 +35,7 @@ else
fi
rcode=$(curl -L -o $tmp -w '%{http_code}' $url $time_cond)
if [ "$rcode" = "200" ] ; then
if [ "$rcode" == "200" -o "${url:0:7}" == "file://" ] ; then
# In cases where servers ignore the Modified time,
# curl cancels the download, outputs a 200 and leaves
# the output file untouched, we don't want this empty file.