summaryrefslogtreecommitdiff
path: root/apt-inst
diff options
context:
space:
mode:
Diffstat (limited to 'apt-inst')
-rw-r--r--apt-inst/contrib/arfile.cc8
-rw-r--r--apt-inst/contrib/arfile.h7
-rw-r--r--apt-inst/contrib/extracttar.cc5
-rw-r--r--apt-inst/contrib/extracttar.h9
-rw-r--r--apt-inst/database.cc11
-rw-r--r--apt-inst/database.h14
-rw-r--r--apt-inst/deb/debfile.cc9
-rw-r--r--apt-inst/deb/debfile.h9
-rw-r--r--apt-inst/deb/dpkgdb.cc4
-rw-r--r--apt-inst/deb/dpkgdb.h13
-rw-r--r--apt-inst/dirstream.cc2
-rw-r--r--apt-inst/extract.cc3
-rw-r--r--apt-inst/extract.h2
-rw-r--r--apt-inst/filelist.cc2
-rw-r--r--apt-inst/filelist.h5
-rw-r--r--apt-inst/makefile2
16 files changed, 74 insertions, 31 deletions
diff --git a/apt-inst/contrib/arfile.cc b/apt-inst/contrib/arfile.cc
index 8018f4d30..2dee1a40d 100644
--- a/apt-inst/contrib/arfile.cc
+++ b/apt-inst/contrib/arfile.cc
@@ -14,13 +14,17 @@
##################################################################### */
/*}}}*/
// Include Files /*{{{*/
+#include<config.h>
+
#include <apt-pkg/arfile.h>
#include <apt-pkg/strutl.h>
+#include <apt-pkg/fileutl.h>
#include <apt-pkg/error.h>
#include <stdlib.h>
- /*}}}*/
+
#include <apti18n.h>
+ /*}}}*/
struct ARArchive::MemberHeader
{
@@ -112,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 7f6c68302..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,12 +50,12 @@ class ARArchive
struct ARArchive::Member
{
// Fields from the header
- string Name;
+ std::string Name;
unsigned long MTime;
unsigned long UID;
unsigned long GID;
unsigned long Mode;
- unsigned long Size;
+ unsigned long long Size;
// Location of the data.
unsigned long Start;
diff --git a/apt-inst/contrib/extracttar.cc b/apt-inst/contrib/extracttar.cc
index 01b6b3836..12919a7cd 100644
--- a/apt-inst/contrib/extracttar.cc
+++ b/apt-inst/contrib/extracttar.cc
@@ -16,8 +16,10 @@
##################################################################### */
/*}}}*/
// Include Files /*{{{*/
-#include <apt-pkg/extracttar.h>
+#include<config.h>
+#include <apt-pkg/dirstream.h>
+#include <apt-pkg/extracttar.h>
#include <apt-pkg/error.h>
#include <apt-pkg/strutl.h>
#include <apt-pkg/configuration.h>
@@ -28,6 +30,7 @@
#include <signal.h>
#include <fcntl.h>
#include <iostream>
+
#include <apti18n.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 a5020f3d7..da7613491 100644
--- a/apt-inst/database.cc
+++ b/apt-inst/database.cc
@@ -8,14 +8,18 @@
##################################################################### */
/*}}}*/
// Include Files /*{{{*/
+#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)
@@ -24,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 a40cd1ae8..4bd065cf8 100644
--- a/apt-inst/deb/debfile.cc
+++ b/apt-inst/deb/debfile.cc
@@ -16,6 +16,9 @@
##################################################################### */
/*}}}*/
// 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>
@@ -105,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)
@@ -172,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 a75cf59ca..819c123f6 100644
--- a/apt-inst/deb/dpkgdb.cc
+++ b/apt-inst/deb/dpkgdb.cc
@@ -13,12 +13,16 @@
##################################################################### */
/*}}}*/
// Include Files /*{{{*/
+#include<config.h>
+
#include <apt-pkg/dpkgdb.h>
#include <apt-pkg/configuration.h>
#include <apt-pkg/error.h>
#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/dirstream.cc b/apt-inst/dirstream.cc
index 9b6a56848..bb0bf96c1 100644
--- a/apt-inst/dirstream.cc
+++ b/apt-inst/dirstream.cc
@@ -11,6 +11,8 @@
##################################################################### */
/*}}}*/
// Include Files /*{{{*/
+#include<config.h>
+
#include <apt-pkg/dirstream.h>
#include <apt-pkg/error.h>
diff --git a/apt-inst/extract.cc b/apt-inst/extract.cc
index cd8edb27a..29e163028 100644
--- a/apt-inst/extract.cc
+++ b/apt-inst/extract.cc
@@ -44,9 +44,12 @@
##################################################################### */
/*}}}*/
// Include Files /*{{{*/
+#include<config.h>
+
#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.cc b/apt-inst/filelist.cc
index 060aa53d7..879c07855 100644
--- a/apt-inst/filelist.cc
+++ b/apt-inst/filelist.cc
@@ -32,6 +32,8 @@
##################################################################### */
/*}}}*/
// Include Files /*{{{*/
+#include<config.h>
+
#include <apt-pkg/filelist.h>
#include <apt-pkg/mmap.h>
#include <apt-pkg/error.h>
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;
map_ptrloc LastTreeLookup;
unsigned long LastLookupSize;
diff --git a/apt-inst/makefile b/apt-inst/makefile
index 785dc62ba..1b9cc2676 100644
--- a/apt-inst/makefile
+++ b/apt-inst/makefile
@@ -14,7 +14,7 @@ include ../buildlib/libversion.mak
# The library name
LIBRARY=apt-inst
-MAJOR=1.2
+MAJOR=1.4
MINOR=0
SLIBS=$(PTHREADLIB) -lapt-pkg
APT_DOMAIN:=libapt-inst$(MAJOR)