Browse Source

Free space check, fixed parser jump bug, added importat

Author: jgg
Date: 1999-02-21 08:38:53 GMT
Free space check, fixed parser jump bug, added importat
debian/1.8.y
Arch Librarian 18 years ago
parent
commit
138d4b3d84
  1. 8
      apt-pkg/deb/deblistparser.cc
  2. 12
      apt-pkg/packagemanager.cc
  3. 5
      apt-pkg/pkgcache.h
  4. 17
      apt-pkg/tagfile.cc
  5. 15
      cmdline/apt-get.cc
  6. 2
      debian/control

8
apt-pkg/deb/deblistparser.cc

@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
// $Id: deblistparser.cc,v 1.16 1999/02/08 07:30:50 jgg Exp $
// $Id: deblistparser.cc,v 1.17 1999/02/21 08:38:53 jgg Exp $
/* ######################################################################
Package Cache Generator - Generator for the cache structure.
@ -119,8 +119,12 @@ bool debListParser::UsePackage(pkgCache::PkgIterator Pkg,
Pkg->Section = UniqFindTagWrite("Section");
if (Section.FindFlag("Essential",Pkg->Flags,pkgCache::Flag::Essential) == false)
return false;
if (Section.FindFlag("Immediate-Configure",Pkg->Flags,pkgCache::Flag::ImmediateConf) == false)
if (Section.FindFlag("Important",Pkg->Flags,pkgCache::Flag::Important) == false)
return false;
if (strcmp(Pkg.Name(),"apt") == 0)
Pkg->Flags |= pkgCache::Flag::Important;
if (ParseStatus(Pkg,Ver) == false)
return false;
return true;

12
apt-pkg/packagemanager.cc

@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
// $Id: packagemanager.cc,v 1.13 1999/02/19 07:56:07 jgg Exp $
// $Id: packagemanager.cc,v 1.14 1999/02/21 08:38:53 jgg Exp $
/* ######################################################################
Package Manager - Abstacts the package manager
@ -130,8 +130,9 @@ bool pkgPackageManager::CreateOrderList()
// Generate the list of affected packages and sort it
for (PkgIterator I = Cache.PkgBegin(); I.end() == false; I++)
{
// Mark the package for immediate configuration
if ((I->Flags & pkgCache::Flag::Essential) == pkgCache::Flag::Essential &&
// Mark the package and its dependends for immediate configuration
if (((I->Flags & pkgCache::Flag::Essential) == pkgCache::Flag::Essential ||
(I->Flags & pkgCache::Flag::Important) == pkgCache::Flag::Important) &&
NoImmConfigure == false)
{
List->Flag(I,pkgOrderList::Immediate);
@ -158,10 +159,7 @@ bool pkgPackageManager::CreateOrderList()
continue;
// Append it to the list
List->push_back(I);
if ((I->Flags & pkgCache::Flag::ImmediateConf) == pkgCache::Flag::ImmediateConf)
List->Flag(I,pkgOrderList::Immediate);
List->push_back(I);
}
return true;

5
apt-pkg/pkgcache.h

@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
// $Id: pkgcache.h,v 1.16 1999/02/01 02:22:11 jgg Exp $
// $Id: pkgcache.h,v 1.17 1999/02/21 08:38:53 jgg Exp $
/* ######################################################################
Cache - Structure definitions for the cache file
@ -80,8 +80,7 @@ class pkgCache
struct Flag
{
enum PkgFlags {Auto=(1<<0),New=(1<<1),Obsolete=(1<<2),Essential=(1<<3),
ImmediateConf=(1<<4)};
enum PkgFlags {Auto=(1<<0),Essential=(1<<3),Important=(1<<4)};
enum PkgFFlags {NotSource=(1<<0),NotAutomatic=(1<<1)};
};

17
apt-pkg/tagfile.cc

@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
// $Id: tagfile.cc,v 1.22 1999/01/31 21:52:27 jgg Exp $
// $Id: tagfile.cc,v 1.23 1999/02/21 08:38:53 jgg Exp $
/* ######################################################################
Fast scanner for RFC-822 type header information
@ -46,7 +46,7 @@ bool pkgTagFile::Step(pkgTagSection &Tag)
return false;
if (Tag.Scan(Start,End - Start) == false)
return _error->Error("Unable to parse package file %s",Fd.Name().c_str());
return _error->Error("Unable to parse package file %s (1)",Fd.Name().c_str());
}
Start += Tag.size();
iOffset += Tag.size();
@ -116,11 +116,19 @@ bool pkgTagFile::Jump(pkgTagSection &Tag,unsigned long Offset)
return false;
End = Start = Buffer;
if (Fill() == false)
return false;
if (Tag.Scan(Start,End - Start) == true)
return true;
// This appends a double new line (for the real eof handling)
if (Fill() == false)
return false;
if (Tag.Scan(Start,End - Start) == false)
return _error->Error("Unable to parse package file");
return _error->Error("Unable to parse package file %s (2)",Fd.Name().c_str());
return true;
}
/*}}}*/
@ -155,6 +163,7 @@ bool pkgTagSection::Scan(const char *Start,unsigned long MaxLength)
if (Stop == 0)
return false;
for (; Stop[1] == '\r' && Stop+1 < End; Stop++);
// Double newline marks the end of the record
@ -167,7 +176,7 @@ bool pkgTagSection::Scan(const char *Start,unsigned long MaxLength)
Stop++;
}
return false;
}
/*}}}*/

15
cmdline/apt-get.cc

@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
// $Id: apt-get.cc,v 1.42 1999/02/15 08:23:10 jgg Exp $
// $Id: apt-get.cc,v 1.43 1999/02/21 08:38:53 jgg Exp $
/* ######################################################################
apt-get - Cover for dpkg
@ -46,6 +46,7 @@
#include <termios.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <sys/vfs.h>
#include <signal.h>
#include <unistd.h>
#include <stdio.h>
@ -534,7 +535,17 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask = true)
c0out << DebBytes << ',' << Cache->DebSize() << endl;
c0out << "How odd.. The sizes didn't match, email apt@packages.debian.org" << endl;
}
// Check for enough free space
struct statfs Buf;
string OutputDir = _config->FindDir("Dir::Cache::Archives");
if (statfs(OutputDir.c_str(),&Buf) != 0)
return _error->Errno("statfs","Couldn't determine free space in %s",
OutputDir.c_str());
if (unsigned(Buf.f_bfree) < FetchBytes/Buf.f_bsize)
return _error->Error("Sorry, you don't have enough free space in %s",
OutputDir.c_str());
// Number of bytes
c1out << "Need to get ";
if (DebBytes != FetchBytes)

2
debian/control

@ -1,6 +1,6 @@
Source: apt
Section: admin
Priority: optional
Priority: standard
Maintainer: APT Development Team <deity@lists.debian.org>
Standards-Version: 2.4.1

Loading…
Cancel
Save