apt/apt-0.5.15cnc6-alt-pkgcachegen.patch
Dmitry V. Levin 68f3ce87c1 0.5.15cnc6-alt3
- apt-pkg/pkgcachegen.cc:
  Remove old sources cache file before creating new one.
- More fixes reported by compiler, patch by Anton V. Denisov.
2004-05-16 17:22:03 +00:00

34 lines
1.1 KiB
Diff

2004-05-15 Dmitry V. Levin <ldv@altlinux.org>
* apt-pkg/pkgcachegen.cc(pkgMakeStatusCache):
Remove old sources cache file before creating new one.
Fix error handling.
--- apt-0.5.15cnc6/apt-pkg/pkgcachegen.cc.orig 2003-11-24 19:55:37 +0300
+++ apt-0.5.15cnc6/apt-pkg/pkgcachegen.cc 2004-05-15 19:10:23 +0400
@@ -805,10 +805,10 @@ bool pkgMakeStatusCache(pkgSourceList &L
{
unlink(CacheFile.c_str());
CacheF = new FileFd(CacheFile,FileFd::WriteEmpty);
- fchmod(CacheF->Fd(),0644);
- Map = new DynamicMMap(*CacheF,MMap::Public,MapSize);
if (_error->PendingError() == true)
return false;
+ fchmod(CacheF->Fd(),0644);
+ Map = new DynamicMMap(*CacheF,MMap::Public,MapSize);
}
else
{
@@ -902,10 +902,10 @@ bool pkgMakeStatusCache(pkgSourceList &L
// even if using the sources cache (above).
if (Writeable == true && SrcCacheFile.empty() == false)
{
+ unlink(SrcCacheFile.c_str());
FileFd SCacheF(SrcCacheFile,FileFd::WriteEmpty);
if (_error->PendingError() == true)
return false;
-
fchmod(SCacheF.Fd(),0644);
// Write out the main data