diff options
author | David Kalnischkies <kalnischkies@gmail.com> | 2011-12-10 20:03:49 +0100 |
---|---|---|
committer | David Kalnischkies <kalnischkies@gmail.com> | 2011-12-10 20:03:49 +0100 |
commit | 76a763e1f842543a53bc28db681d963d0fc4ae12 (patch) | |
tree | 9e61f14bdfbce67ea001fe293497c6d9205f380e /apt-pkg/deb | |
parent | 468720c59fcf48b20332cdb7b601b2b0d7cbbfbb (diff) |
* apt-pkg/contrib/fileutl.{h,cc}:
- implement a ModificationTime method for FileFd
Diffstat (limited to 'apt-pkg/deb')
-rw-r--r-- | apt-pkg/deb/debindexfile.cc | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/apt-pkg/deb/debindexfile.cc b/apt-pkg/deb/debindexfile.cc index d9c448598..2635d52c8 100644 --- a/apt-pkg/deb/debindexfile.cc +++ b/apt-pkg/deb/debindexfile.cc @@ -319,12 +319,8 @@ bool debPackagesIndex::Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const // Store the IMS information pkgCache::PkgFileIterator File = Gen.GetCurFile(); pkgCacheGenerator::Dynamic<pkgCache::PkgFileIterator> DynFile(File); - // FIXME: Get this info from FileFd instead - struct stat St; - if (fstat(Pkg.Fd(),&St) != 0) - return _error->Errno("fstat","Failed to stat"); - File->Size = St.st_size; - File->mtime = St.st_mtime; + File->Size = Pkg.FileSize(); + File->mtime = Pkg.ModificationTime(); if (Gen.MergeList(Parser) == false) return _error->Error("Problem with MergeList %s",PackageFile.c_str()); @@ -522,11 +518,8 @@ bool debTranslationsIndex::Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const // Store the IMS information pkgCache::PkgFileIterator TransFile = Gen.GetCurFile(); - struct stat TransSt; - if (fstat(Trans.Fd(),&TransSt) != 0) - return _error->Errno("fstat","Failed to stat"); - TransFile->Size = TransSt.st_size; - TransFile->mtime = TransSt.st_mtime; + TransFile->Size = Trans.FileSize(); + TransFile->mtime = Trans.ModificationTime(); if (Gen.MergeList(TransParser) == false) return _error->Error("Problem with MergeList %s",TranslationFile.c_str()); @@ -608,8 +601,8 @@ bool debStatusIndex::Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const struct stat St; if (fstat(Pkg.Fd(),&St) != 0) return _error->Errno("fstat","Failed to stat"); - CFile->Size = St.st_size; - CFile->mtime = St.st_mtime; + CFile->Size = Pkg.FileSize(); + CFile->mtime = Pkg.ModificationTime(); CFile->Archive = Gen.WriteUniqString("now"); if (Gen.MergeList(Parser) == false) |