summaryrefslogtreecommitdiff
path: root/methods/copy.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2015-10-11 13:58:23 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2015-11-04 18:04:00 +0100
commitaf9e40c9bfb353b8aea1e2621b3b5a8c1c1db4bd (patch)
tree45c52718410a77b27ac7ae6745b52d3ec03e9fda /methods/copy.cc
parent3685f84d8c0abfbddd12e034561e5f3fe8cbf2eb (diff)
unbreak the copy-method claiming hashsum mismatch since ~exp9
Commit 653ef26c70dc9c0e2cbfdd4e79117876bb63e87d broke the camels back in sofar that everything works in terms of our internal use of copy:/, but external use is completely destroyed. This is kinda the reverse of what happened in "parallel" in the sid branch, where external use was mostly fine, internal and external exploded on the GzipIndexes option. We fix this now by rewriting our internal use by letting copy:/ only do what the name suggests it does: Copy files and not uncompress them on-the-fly. Then we teach copy and the uncompressors how to deal with /dev/null and use it as destination file in case we don't want to store the uncompressed files on disk. Closes: 799158
Diffstat (limited to 'methods/copy.cc')
-rw-r--r--methods/copy.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/methods/copy.cc b/methods/copy.cc
index 0c9f322e6..373ad3604 100644
--- a/methods/copy.cc
+++ b/methods/copy.cc
@@ -38,7 +38,7 @@ class CopyMethod : public pkgAcqMethod
void CopyMethod::CalculateHashes(FetchItem const * const Itm, FetchResult &Res)
{
Hashes Hash(Itm->ExpectedHashes);
- FileFd Fd(Res.Filename, FileFd::ReadOnly, FileFd::Extension);
+ FileFd Fd(Res.Filename, FileFd::ReadOnly);
Hash.AddFD(Fd);
Res.TakeHashes(Hash);
}
@@ -65,7 +65,7 @@ bool CopyMethod::Fetch(FetchItem *Itm)
URIStart(Res);
// just calc the hashes if the source and destination are identical
- if (File == Itm->DestFile)
+ if (File == Itm->DestFile || Itm->DestFile == "/dev/null")
{
CalculateHashes(Itm, Res);
URIDone(Res);