diff options
author | Arch Librarian <arch@canonical.com> | 2004-09-20 16:52:20 +0000 |
---|---|---|
committer | Arch Librarian <arch@canonical.com> | 2004-09-20 16:52:20 +0000 |
commit | b7d9b68ecea1fb31744f42929192e04e56c53d44 (patch) | |
tree | 1cde11f82decef91a8d9735503e123285b90ce69 | |
parent | 958fac63f4464391260bb35573d56874424f273f (diff) |
Few more bugs
Author: jgg
Date: 1998-12-22 08:20:55 GMT
Few more bugs
-rw-r--r-- | methods/cdrom.cc | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/methods/cdrom.cc b/methods/cdrom.cc index 35a9b044d..3049e5ba8 100644 --- a/methods/cdrom.cc +++ b/methods/cdrom.cc @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: cdrom.cc,v 1.6 1998/12/22 07:52:05 jgg Exp $ +// $Id: cdrom.cc,v 1.7 1998/12/22 08:20:55 jgg Exp $ /* ###################################################################### CDROM URI method for APT @@ -63,6 +63,9 @@ string CDROMMethod::GetID(string Name) } const Configuration::Item *Top = Database.Tree("CD"); + if (Top != 0) + Top = Top->Child; + for (; Top != 0;) { if (Top->Value == Name) @@ -140,12 +143,14 @@ bool CDROMMethod::Fetch(FetchItem *Itm) if (NewID == ID) { Res.Filename = CDROM + File; - if (FileExists(Res.Filename) == false) + struct stat Buf; + if (stat(Res.Filename.c_str(),&Buf) != 0) return _error->Error("File not found"); CurrentID = ID; - Res.LastModified = Itm->LastModified; + Res.LastModified = Buf.st_mtime; Res.IMSHit = true; + Res.Size = Buf.st_size; URIDone(Res); return true; } |