X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/dc738e7ae6a9c14992279dc2c52f71b14ced53aa..9d3cce03f50b6a2d361d3e5c9f1475bccb13775e:/methods/file.cc diff --git a/methods/file.cc b/methods/file.cc index bf7d380c5..9cdd5bc2d 100644 --- a/methods/file.cc +++ b/methods/file.cc @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: file.cc,v 1.9 2003/02/10 07:34:41 doogie Exp $ +// $Id: file.cc,v 1.9.2.1 2004/01/16 18:58:50 mdz Exp $ /* ###################################################################### File URI method for APT @@ -13,12 +13,14 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ -#include #include #include +#include +#include #include #include +#include /*}}}*/ class FileMethod : public pkgAcqMethod @@ -75,7 +77,11 @@ bool FileMethod::Fetch(FetchItem *Itm) if (Res.Filename.empty() == true) return _error->Error(_("File not found")); - + + Hashes Hash; + FileFd Fd(Res.Filename, FileFd::ReadOnly); + Hash.AddFD(Fd.Fd(), Fd.Size()); + Res.TakeHashes(Hash); URIDone(Res); return true; } @@ -83,6 +89,8 @@ bool FileMethod::Fetch(FetchItem *Itm) int main() { + setlocale(LC_ALL, ""); + FileMethod Mth; return Mth.Run(); }