From af9e40c9bfb353b8aea1e2621b3b5a8c1c1db4bd Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sun, 11 Oct 2015 13:58:23 +0200 Subject: 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 --- methods/copy.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'methods/copy.cc') 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); -- cgit v1.2.3