diff options
author | Arch Librarian <arch@canonical.com> | 2004-09-20 16:53:36 +0000 |
---|---|---|
committer | Arch Librarian <arch@canonical.com> | 2004-09-20 16:53:36 +0000 |
commit | 803fafcbaa2fe4e1c49249e589d50f892b1b2424 (patch) | |
tree | 5daec4a662bddc88a2e5410ee7b8a7839495a2b4 /apt-pkg/pkgcachegen.cc | |
parent | b80d5b89446d8d4818a07690c395d1d20b82ba7f (diff) |
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
Diffstat (limited to 'apt-pkg/pkgcachegen.cc')
-rw-r--r-- | apt-pkg/pkgcachegen.cc | 7 |
1 files changed, 5 insertions, 2 deletions
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 <sys/stat.h> #include <unistd.h> +#include <errno.h> /*}}}*/ // 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) |