summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg')
-rw-r--r--apt-pkg/algorithms.cc9
-rw-r--r--apt-pkg/algorithms.h4
-rw-r--r--apt-pkg/deb/dpkgpm.cc18
-rw-r--r--apt-pkg/deb/dpkgpm.h6
-rw-r--r--apt-pkg/depcache.h4
-rw-r--r--apt-pkg/packagemanager.cc4
-rw-r--r--apt-pkg/packagemanager.h4
7 files changed, 32 insertions, 17 deletions
diff --git a/apt-pkg/algorithms.cc b/apt-pkg/algorithms.cc
index 21db98941..9ca6ca590 100644
--- a/apt-pkg/algorithms.cc
+++ b/apt-pkg/algorithms.cc
@@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: algorithms.cc,v 1.20 1999/07/03 03:10:35 jgg Exp $
+// $Id: algorithms.cc,v 1.21 1999/07/09 04:11:33 jgg Exp $
/* ######################################################################
Algorithms - A set of misc algorithms
@@ -125,14 +125,17 @@ bool pkgSimulate::Configure(PkgIterator iPkg)
// Simulate::Remove - Simulate the removal of a package /*{{{*/
// ---------------------------------------------------------------------
/* */
-bool pkgSimulate::Remove(PkgIterator iPkg)
+bool pkgSimulate::Remove(PkgIterator iPkg,bool Purge)
{
// Adapt the iterator
PkgIterator Pkg = Sim.FindPkg(iPkg.Name());
Flags[Pkg->ID] = 3;
Sim.MarkDelete(Pkg);
- cout << "Remv " << Pkg.Name();
+ if (Purge == true)
+ cout << "Purg " << Pkg.Name();
+ else
+ cout << "Remv " << Pkg.Name();
if (Sim.BrokenCount() != 0)
ShortBreaks();
diff --git a/apt-pkg/algorithms.h b/apt-pkg/algorithms.h
index 0553b3eec..1603377f4 100644
--- a/apt-pkg/algorithms.h
+++ b/apt-pkg/algorithms.h
@@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: algorithms.h,v 1.6 1998/10/20 02:39:18 jgg Exp $
+// $Id: algorithms.h,v 1.7 1999/07/09 04:11:34 jgg Exp $
/* ######################################################################
Algorithms - A set of misc algorithms
@@ -49,7 +49,7 @@ class pkgSimulate : public pkgPackageManager
// The Actuall installation implementation
virtual bool Install(PkgIterator Pkg,string File);
virtual bool Configure(PkgIterator Pkg);
- virtual bool Remove(PkgIterator Pkg);
+ virtual bool Remove(PkgIterator Pkg,bool Purge);
void ShortBreaks();
public:
diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc
index 998750b3b..4e108c419 100644
--- a/apt-pkg/deb/dpkgpm.cc
+++ b/apt-pkg/deb/dpkgpm.cc
@@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: dpkgpm.cc,v 1.10 1999/07/03 03:10:35 jgg Exp $
+// $Id: dpkgpm.cc,v 1.11 1999/07/09 04:11:34 jgg Exp $
/* ######################################################################
DPKG Package Manager - Provide an interface to dpkg
@@ -65,12 +65,15 @@ bool pkgDPkgPM::Configure(PkgIterator Pkg)
// DPkgPM::Remove - Remove a package /*{{{*/
// ---------------------------------------------------------------------
/* Add a remove operation to the sequence list */
-bool pkgDPkgPM::Remove(PkgIterator Pkg)
+bool pkgDPkgPM::Remove(PkgIterator Pkg,bool Purge)
{
if (Pkg.end() == true)
return false;
- List.push_back(Item(Item::Remove,Pkg));
+ if (Purge == true)
+ List.push_back(Item(Item::Purge,Pkg));
+ else
+ List.push_back(Item(Item::Remove,Pkg));
return true;
}
/*}}}*/
@@ -184,6 +187,15 @@ bool pkgDPkgPM::Go()
Size += strlen(Args[n-1]);
break;
+ case Item::Purge:
+ Args[n++] = "--force-depends";
+ Size += strlen(Args[n-1]);
+ Args[n++] = "--force-remove-essential";
+ Size += strlen(Args[n-1]);
+ Args[n++] = "--purge";
+ Size += strlen(Args[n-1]);
+ break;
+
case Item::Configure:
Args[n++] = "--configure";
Size += strlen(Args[n-1]);
diff --git a/apt-pkg/deb/dpkgpm.h b/apt-pkg/deb/dpkgpm.h
index d7898daf1..e8ffe7bb4 100644
--- a/apt-pkg/deb/dpkgpm.h
+++ b/apt-pkg/deb/dpkgpm.h
@@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: dpkgpm.h,v 1.4 1999/07/03 03:10:35 jgg Exp $
+// $Id: dpkgpm.h,v 1.5 1999/07/09 04:11:34 jgg Exp $
/* ######################################################################
DPKG Package Manager - Provide an interface to dpkg
@@ -23,7 +23,7 @@ class pkgDPkgPM : public pkgPackageManager
struct Item
{
- enum Ops {Install, Configure, Remove} Op;
+ enum Ops {Install, Configure, Remove, Purge} Op;
string File;
PkgIterator Pkg;
Item(Ops Op,PkgIterator Pkg,string File = "") : Op(Op),
@@ -39,7 +39,7 @@ class pkgDPkgPM : public pkgPackageManager
// The Actuall installation implementation
virtual bool Install(PkgIterator Pkg,string File);
virtual bool Configure(PkgIterator Pkg);
- virtual bool Remove(PkgIterator Pkg);
+ virtual bool Remove(PkgIterator Pkg,bool Purge = false);
virtual bool Go();
virtual void Reset();
diff --git a/apt-pkg/depcache.h b/apt-pkg/depcache.h
index 29db800c2..dd56464bd 100644
--- a/apt-pkg/depcache.h
+++ b/apt-pkg/depcache.h
@@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: depcache.h,v 1.9 1999/04/12 04:21:20 jgg Exp $
+// $Id: depcache.h,v 1.10 1999/07/09 04:11:34 jgg Exp $
/* ######################################################################
DepCache - Dependency Extension data for the cache
@@ -60,7 +60,7 @@ class pkgDepCache : public pkgCache
DepCandPolicy = (1 << 4), DepCandMin = (1 << 5)};
// These flags are used in StateCache::iFlags
- enum InternalFlags {AutoKept = (1 << 0)};
+ enum InternalFlags {AutoKept = (1 << 0), Purge = (1 << 1)};
enum VersionTypes {NowVersion, InstallVersion, CandidateVersion};
enum ModeList {ModeDelete = 0, ModeKeep = 1, ModeInstall = 2};
diff --git a/apt-pkg/packagemanager.cc b/apt-pkg/packagemanager.cc
index 9e2eee969..95192c9f0 100644
--- a/apt-pkg/packagemanager.cc
+++ b/apt-pkg/packagemanager.cc
@@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: packagemanager.cc,v 1.16 1999/07/04 23:22:53 jgg Exp $
+// $Id: packagemanager.cc,v 1.17 1999/07/09 04:11:34 jgg Exp $
/* ######################################################################
Package Manager - Abstacts the package manager
@@ -375,7 +375,7 @@ bool pkgPackageManager::SmartRemove(PkgIterator Pkg)
return true;
List->Flag(Pkg,pkgOrderList::Configured,pkgOrderList::States);
- return Remove(Pkg);
+ return Remove(Pkg,(Cache[Pkg].iFlags & pkgDepCache::Purge) == pkgDepCache::Purge);
}
/*}}}*/
// PM::SmartUnPack - Install helper /*{{{*/
diff --git a/apt-pkg/packagemanager.h b/apt-pkg/packagemanager.h
index 6dbf94def..88039ba5a 100644
--- a/apt-pkg/packagemanager.h
+++ b/apt-pkg/packagemanager.h
@@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: packagemanager.h,v 1.8 1999/07/03 03:10:35 jgg Exp $
+// $Id: packagemanager.h,v 1.9 1999/07/09 04:11:34 jgg Exp $
/* ######################################################################
Package Manager - Abstacts the package manager
@@ -74,7 +74,7 @@ class pkgPackageManager
// The Actuall installation implementation
virtual bool Install(PkgIterator /*Pkg*/,string /*File*/) {return false;};
virtual bool Configure(PkgIterator /*Pkg*/) {return false;};
- virtual bool Remove(PkgIterator /*Pkg*/) {return false;};
+ virtual bool Remove(PkgIterator /*Pkg*/,bool Purge=false) {return false;};
virtual bool Go() {return true;};
virtual void Reset() {};