projects
/
apt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Deprecate SPtrArray<T> and convert everyone to unique_ptr<T[]>
[apt.git]
/
methods
/
file.cc
diff --git
a/methods/file.cc
b/methods/file.cc
index 5d5fffa67b289399165b53207a2575b98e263a37..40e85bce5a464d7fafa1014bfeba8a242cc3aa47 100644
(file)
--- a/
methods/file.cc
+++ b/
methods/file.cc
@@
-30,7
+30,7
@@
class FileMethod : public pkgAcqMethod
{
class FileMethod : public pkgAcqMethod
{
- virtual bool Fetch(FetchItem *Itm);
+ virtual bool Fetch(FetchItem *Itm)
APT_OVERRIDE
;
public:
public:
@@
-58,7
+58,10
@@
bool FileMethod::Fetch(FetchItem *Itm)
{
HashStringList const hsl = Itm->ExpectedHashes;
if (Itm->ExpectedHashes.VerifyFile(File))
{
HashStringList const hsl = Itm->ExpectedHashes;
if (Itm->ExpectedHashes.VerifyFile(File))
+ {
+ Res.Filename = Itm->DestFile;
Res.IMSHit = true;
Res.IMSHit = true;
+ }
}
}
}
}
}
}
@@
-78,7
+81,14
@@
bool FileMethod::Fetch(FetchItem *Itm)
if (filesize != 0 && filesize == Res.Size)
Res.IMSHit = true;
}
if (filesize != 0 && filesize == Res.Size)
Res.IMSHit = true;
}
+
+ Hashes Hash(Itm->ExpectedHashes);
+ FileFd Fd(File, FileFd::ReadOnly);
+ Hash.AddFD(Fd);
+ Res.TakeHashes(Hash);
}
}
+ if (Res.IMSHit == false)
+ URIStart(Res);
// See if the uncompressed file exists and reuse it
FetchResult AltRes;
// See if the uncompressed file exists and reuse it
FetchResult AltRes;
@@
-103,14
+113,6
@@
bool FileMethod::Fetch(FetchItem *Itm)
}
}
}
}
- if (Res.Filename.empty() == false)
- {
- Hashes Hash(Itm->ExpectedHashes);
- FileFd Fd(Res.Filename, FileFd::ReadOnly);
- Hash.AddFD(Fd);
- Res.TakeHashes(Hash);
- }
-
if (AltRes.Filename.empty() == false)
URIDone(Res,&AltRes);
else if (Res.Filename.empty() == false)
if (AltRes.Filename.empty() == false)
URIDone(Res,&AltRes);
else if (Res.Filename.empty() == false)