From 803fafcbaa2fe4e1c49249e589d50f892b1b2424 Mon Sep 17 00:00:00 2001 From: Arch Librarian Date: Mon, 20 Sep 2004 16:53:36 +0000 Subject: Made apt-cache regenerate its cache in memory Author: jgg Date: 1999-04-19 02:35:38 GMT Made apt-cache regenerate its cache in memory --- apt-pkg/cachefile.cc | 5 ++--- apt-pkg/pkgcachegen.cc | 7 +++++-- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/cachefile.cc b/apt-pkg/cachefile.cc index 285eb310f..88c3fa81a 100644 --- a/apt-pkg/cachefile.cc +++ b/apt-pkg/cachefile.cc @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: cachefile.cc,v 1.1 1999/04/18 06:36:36 jgg Exp $ +// $Id: cachefile.cc,v 1.2 1999/04/19 02:35:38 jgg Exp $ /* ###################################################################### CacheFile - Simple wrapper class for opening, generating and whatnot @@ -86,10 +86,9 @@ bool pkgCacheFile::Open(OpProgress &Progress,bool WithLock) // Create the dependency cache Cache = new pkgDepCache(*Map,Progress); + Progress.Done(); if (_error->PendingError() == true) return false; - - Progress.Done(); return true; } diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc index 1e31ff300..fd4f8965b 100644 --- a/apt-pkg/pkgcachegen.cc +++ b/apt-pkg/pkgcachegen.cc @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: pkgcachegen.cc,v 1.36 1999/04/18 07:25:32 jgg Exp $ +// $Id: pkgcachegen.cc,v 1.37 1999/04/19 02:35:38 jgg Exp $ /* ###################################################################### Package Cache Generator - Generator for the cache structure. @@ -26,6 +26,7 @@ #include #include +#include /*}}}*/ // CacheGenerator::pkgCacheGenerator - Constructor /*{{{*/ @@ -761,7 +762,9 @@ MMap *pkgMakeStatusCacheMem(pkgSourceList &List,OpProgress &Progress) /* If the cache file is writeable this is just a wrapper for MakeStatusCache */ string CacheFile = _config->FindFile("Dir::Cache::pkgcache"); - bool Writeable = access(CacheFile.c_str(),W_OK) == 0; + bool Writeable = (access(CacheFile.c_str(),W_OK) == 0) || + (errno == ENOENT); + if (Writeable == true) { if (pkgMakeStatusCache(List,Progress) == false) -- cgit v1.2.3