// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: pkgcachegen.cc,v 1.35 1999/04/18 06:36:36 jgg Exp $
+// $Id: pkgcachegen.cc,v 1.37 1999/04/19 02:35:38 jgg Exp $
/* ######################################################################
Package Cache Generator - Generator for the cache structure.
#include <sys/stat.h>
#include <unistd.h>
+#include <errno.h>
/*}}}*/
// CacheGenerator::pkgCacheGenerator - Constructor /*{{{*/
/* This puts the source package cache into the given generator. */
bool pkgGenerateSrcCache(pkgSourceList &List,OpProgress &Progress,
pkgCacheGenerator &Gen,
- unsigned long &CurrentSize,unsigned long TotalSize)
+ unsigned long &CurrentSize,unsigned long &TotalSize)
{
string ListDir = _config->FindDir("Dir::State::lists");
/* 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)