diff options
author | Michael Vogt <egon@debian-devbox> | 2011-10-14 13:55:50 +0200 |
---|---|---|
committer | Michael Vogt <egon@debian-devbox> | 2011-10-14 13:55:50 +0200 |
commit | a1e68c33ac15be454984b00d62c7fc331bd0b32b (patch) | |
tree | abf59def54f9df6bbf9aa380b1314364482d8b1c /apt-inst | |
parent | 7be8c02360bdb9bd7f59b087da874f88af2a7206 (diff) | |
parent | 0e7c33134cd32410eb8b344c6b6577826238bbbc (diff) |
merged lp:~donkult/apt/experimental
Diffstat (limited to 'apt-inst')
-rw-r--r-- | apt-inst/contrib/arfile.cc | 3 | ||||
-rw-r--r-- | apt-inst/contrib/arfile.h | 5 | ||||
-rw-r--r-- | apt-inst/contrib/extracttar.cc | 1 | ||||
-rw-r--r-- | apt-inst/contrib/extracttar.h | 9 | ||||
-rw-r--r-- | apt-inst/database.cc | 9 | ||||
-rw-r--r-- | apt-inst/database.h | 14 | ||||
-rw-r--r-- | apt-inst/deb/debfile.cc | 7 | ||||
-rw-r--r-- | apt-inst/deb/debfile.h | 9 | ||||
-rw-r--r-- | apt-inst/deb/dpkgdb.cc | 2 | ||||
-rw-r--r-- | apt-inst/deb/dpkgdb.h | 13 | ||||
-rw-r--r-- | apt-inst/extract.cc | 1 | ||||
-rw-r--r-- | apt-inst/extract.h | 2 | ||||
-rw-r--r-- | apt-inst/filelist.h | 5 |
13 files changed, 53 insertions, 27 deletions
diff --git a/apt-inst/contrib/arfile.cc b/apt-inst/contrib/arfile.cc index 533c563f9..2dee1a40d 100644 --- a/apt-inst/contrib/arfile.cc +++ b/apt-inst/contrib/arfile.cc @@ -18,6 +18,7 @@ #include <apt-pkg/arfile.h> #include <apt-pkg/strutl.h> +#include <apt-pkg/fileutl.h> #include <apt-pkg/error.h> #include <stdlib.h> @@ -115,7 +116,7 @@ bool ARArchive::LoadHeaders() { unsigned int I = sizeof(Head.Name) - 1; for (; Head.Name[I] == ' ' || Head.Name[I] == '/'; I--); - Memb->Name = string(Head.Name,I+1); + Memb->Name = std::string(Head.Name,I+1); } // Account for the AR header alignment diff --git a/apt-inst/contrib/arfile.h b/apt-inst/contrib/arfile.h index e2063cd71..2be1323d1 100644 --- a/apt-inst/contrib/arfile.h +++ b/apt-inst/contrib/arfile.h @@ -17,7 +17,8 @@ #include <string> -#include <apt-pkg/fileutl.h> + +class FileFd; class ARArchive { @@ -49,7 +50,7 @@ class ARArchive struct ARArchive::Member { // Fields from the header - string Name; + std::string Name; unsigned long MTime; unsigned long UID; unsigned long GID; diff --git a/apt-inst/contrib/extracttar.cc b/apt-inst/contrib/extracttar.cc index 487027c3d..12919a7cd 100644 --- a/apt-inst/contrib/extracttar.cc +++ b/apt-inst/contrib/extracttar.cc @@ -18,6 +18,7 @@ // Include Files /*{{{*/ #include<config.h> +#include <apt-pkg/dirstream.h> #include <apt-pkg/extracttar.h> #include <apt-pkg/error.h> #include <apt-pkg/strutl.h> diff --git a/apt-inst/contrib/extracttar.h b/apt-inst/contrib/extracttar.h index 42f8ef534..8754e8dcc 100644 --- a/apt-inst/contrib/extracttar.h +++ b/apt-inst/contrib/extracttar.h @@ -15,11 +15,10 @@ #define PKGLIB_EXTRACTTAR_H #include <apt-pkg/fileutl.h> -#include <apt-pkg/dirstream.h> -#include <algorithm> +#include <string> -using std::min; +class pkgDirStream; class ExtractTar { @@ -38,7 +37,7 @@ class ExtractTar int GZPid; FileFd InFd; bool Eof; - string DecompressProg; + std::string DecompressProg; // Fork and reap gzip bool StartGzip(); @@ -48,7 +47,7 @@ class ExtractTar bool Go(pkgDirStream &Stream); - ExtractTar(FileFd &Fd,unsigned long Max,string DecompressionProgram); + ExtractTar(FileFd &Fd,unsigned long Max,std::string DecompressionProgram); virtual ~ExtractTar(); }; diff --git a/apt-inst/database.cc b/apt-inst/database.cc index 0647959a9..da7613491 100644 --- a/apt-inst/database.cc +++ b/apt-inst/database.cc @@ -11,13 +11,15 @@ #include<config.h> #include <apt-pkg/database.h> +#include <apt-pkg/filelist.h> +#include <apt-pkg/pkgcachegen.h> /*}}}*/ // DataBase::GetMetaTmp - Get the temp dir /*{{{*/ // --------------------------------------------------------------------- /* This re-initializes the meta temporary directory if it hasn't yet been inited for this cycle. The flag is the emptyness of MetaDir */ -bool pkgDataBase::GetMetaTmp(string &Dir) +bool pkgDataBase::GetMetaTmp(std::string &Dir) { if (MetaDir.empty() == true) if (InitMetaTmp(MetaDir) == false) @@ -26,3 +28,8 @@ bool pkgDataBase::GetMetaTmp(string &Dir) return true; } /*}}}*/ +pkgDataBase::~pkgDataBase() +{ + delete Cache; + delete FList; +} diff --git a/apt-inst/database.h b/apt-inst/database.h index ef45bc2d6..ccfee3797 100644 --- a/apt-inst/database.h +++ b/apt-inst/database.h @@ -21,17 +21,21 @@ #ifndef PKGLIB_DATABASE_H #define PKGLIB_DATABASE_H -#include <apt-pkg/filelist.h> #include <apt-pkg/pkgcachegen.h> +#include <string> + +class pkgFLCache; +class OpProgress; + class pkgDataBase { protected: pkgCacheGenerator *Cache; pkgFLCache *FList; - string MetaDir; - virtual bool InitMetaTmp(string &Dir) = 0; + std::string MetaDir; + virtual bool InitMetaTmp(std::string &Dir) = 0; public: @@ -40,13 +44,13 @@ class pkgDataBase inline pkgFLCache &GetFLCache() {return *FList;}; inline pkgCacheGenerator &GetGenerator() {return *Cache;}; - bool GetMetaTmp(string &Dir); + bool GetMetaTmp(std::string &Dir); virtual bool ReadyFileList(OpProgress &Progress) = 0; virtual bool ReadyPkgCache(OpProgress &Progress) = 0; virtual bool LoadChanges() = 0; pkgDataBase() : Cache(0), FList(0) {}; - virtual ~pkgDataBase() {delete Cache; delete FList;}; + virtual ~pkgDataBase(); }; #endif diff --git a/apt-inst/deb/debfile.cc b/apt-inst/deb/debfile.cc index e80d8c735..4bd065cf8 100644 --- a/apt-inst/deb/debfile.cc +++ b/apt-inst/deb/debfile.cc @@ -18,6 +18,7 @@ // Include Files /*{{{*/ #include<config.h> +#include <apt-pkg/database.h> #include <apt-pkg/debfile.h> #include <apt-pkg/extracttar.h> #include <apt-pkg/error.h> @@ -107,8 +108,8 @@ bool debDebFile::ExtractControl(pkgDataBase &DB) return false; // Get into the temporary directory - string Cwd = SafeGetCWD(); - string Tmp; + std::string Cwd = SafeGetCWD(); + std::string Tmp; if (DB.GetMetaTmp(Tmp) == false) return false; if (chdir(Tmp.c_str()) != 0) @@ -174,7 +175,7 @@ bool debDebFile::ExtractArchive(pkgDirStream &Stream) pkgCache::VerIterator debDebFile::MergeControl(pkgDataBase &DB) { // Open the control file - string Tmp; + std::string Tmp; if (DB.GetMetaTmp(Tmp) == false) return pkgCache::VerIterator(DB.GetCache()); FileFd Fd(Tmp + "control",FileFd::ReadOnly); diff --git a/apt-inst/deb/debfile.h b/apt-inst/deb/debfile.h index 6b9f8ffc8..2c4734f9e 100644 --- a/apt-inst/deb/debfile.h +++ b/apt-inst/deb/debfile.h @@ -25,9 +25,12 @@ #include <apt-pkg/arfile.h> -#include <apt-pkg/database.h> #include <apt-pkg/dirstream.h> #include <apt-pkg/tagfile.h> +#include <apt-pkg/pkgcache.h> + +class FileFd; +class pkgDataBase; class debDebFile { @@ -68,7 +71,7 @@ class debDebFile::MemControlExtract : public pkgDirStream char *Control; pkgTagSection Section; unsigned long Length; - string Member; + std::string Member; // Members from DirStream virtual bool DoItem(Item &Itm,int &Fd); @@ -81,7 +84,7 @@ class debDebFile::MemControlExtract : public pkgDirStream bool TakeControl(const void *Data,unsigned long Size); MemControlExtract() : IsControl(false), Control(0), Length(0), Member("control") {}; - MemControlExtract(string Member) : IsControl(false), Control(0), Length(0), Member(Member) {}; + MemControlExtract(std::string Member) : IsControl(false), Control(0), Length(0), Member(Member) {}; ~MemControlExtract() {delete [] Control;}; }; /*}}}*/ diff --git a/apt-inst/deb/dpkgdb.cc b/apt-inst/deb/dpkgdb.cc index 3112acdbd..819c123f6 100644 --- a/apt-inst/deb/dpkgdb.cc +++ b/apt-inst/deb/dpkgdb.cc @@ -21,6 +21,8 @@ #include <apt-pkg/progress.h> #include <apt-pkg/tagfile.h> #include <apt-pkg/strutl.h> +#include <apt-pkg/fileutl.h> +#include <apt-pkg/filelist.h> #include <stdio.h> #include <errno.h> diff --git a/apt-inst/deb/dpkgdb.h b/apt-inst/deb/dpkgdb.h index 125845f96..f28563a93 100644 --- a/apt-inst/deb/dpkgdb.h +++ b/apt-inst/deb/dpkgdb.h @@ -22,17 +22,22 @@ #include <apt-pkg/database.h> +#include <string> + +class DynamicMMap; +class OpProgress; + class debDpkgDB : public pkgDataBase { protected: - - string AdminDir; + + std::string AdminDir; DynamicMMap *CacheMap; DynamicMMap *FileMap; unsigned long DiverInode; signed long DiverTime; - - virtual bool InitMetaTmp(string &Dir); + + virtual bool InitMetaTmp(std::string &Dir); bool ReadFList(OpProgress &Progress); bool ReadDiversions(); bool ReadConfFiles(); diff --git a/apt-inst/extract.cc b/apt-inst/extract.cc index d48ff63ac..29e163028 100644 --- a/apt-inst/extract.cc +++ b/apt-inst/extract.cc @@ -49,6 +49,7 @@ #include <apt-pkg/extract.h> #include <apt-pkg/error.h> #include <apt-pkg/debversion.h> +#include <apt-pkg/fileutl.h> #include <sys/stat.h> #include <stdio.h> diff --git a/apt-inst/extract.h b/apt-inst/extract.h index 71222983c..7143fa409 100644 --- a/apt-inst/extract.h +++ b/apt-inst/extract.h @@ -33,7 +33,7 @@ class pkgExtract : public pkgDirStream bool HandleOverwrites(pkgFLCache::NodeIterator Nde, bool DiverCheck = false); - bool CheckDirReplace(string Dir,unsigned int Depth = 0); + bool CheckDirReplace(std::string Dir,unsigned int Depth = 0); public: diff --git a/apt-inst/filelist.h b/apt-inst/filelist.h index c74a310e4..0405d61df 100644 --- a/apt-inst/filelist.h +++ b/apt-inst/filelist.h @@ -28,9 +28,10 @@ #ifndef PKGLIB_FILELIST_H #define PKGLIB_FILELIST_H +#include <apt-pkg/mmap.h> #include <cstring> -#include <apt-pkg/mmap.h> +#include <string> class pkgFLCache { @@ -48,7 +49,7 @@ class pkgFLCache class DiverIterator; protected: - string CacheFile; + std::string CacheFile; DynamicMMap ⤅ map_ptrloc LastTreeLookup; unsigned long LastLookupSize; |