// -*- 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
// 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();
// -*- 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
// 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:
// -*- 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
// 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;
}
/*}}}*/
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]);
// -*- 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
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),
// 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();
// -*- 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
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};
// -*- 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
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 /*{{{*/
// -*- 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
// 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() {};
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: apt-get.cc,v 1.67 1999/07/03 03:10:36 jgg Exp $
+// $Id: apt-get.cc,v 1.68 1999/07/09 04:11:34 jgg Exp $
/* ######################################################################
apt-get - Cover for dpkg
pkgCache::PkgIterator I = Dep.PkgBegin();
string List;
for (;I.end() != true; I++)
+ {
if (Dep[I].Delete() == true)
- List += string(I.Name()) + " ";
+ {
+ if ((Dep[I].iFlags & pkgDepCache::Purge) == pkgDepCache::Purge)
+ List += string(I.Name()) + "* ";
+ else
+ List += string(I.Name()) + " ";
+ }
+ }
ShowList(out,"The following packages will be REMOVED:",List);
}
happen and then calls the download routines */
bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask = true,bool Saftey = true)
{
+ if (_config->FindB("APT::Get::Purge",false) == true)
+ {
+ pkgCache::PkgIterator I = Cache->PkgBegin();
+ for (; I.end() == false; I++)
+ Cache[I].iFlags |= pkgDepCache::Purge;
+ }
+
bool Fail = false;
bool Essential = false;
// See if we are removing the package
bool Remove = DefRemove;
- if (Cache->FindPkg(S).end() == true)
+ while (Cache->FindPkg(S).end() == true)
{
// Handle an optional end tag indicating what to do
if (S[Length - 1] == '-')
{
Remove = true;
S[--Length] = 0;
+ continue;
}
+
if (S[Length - 1] == '+')
{
Remove = false;
S[--Length] = 0;
+ continue;
}
+ break;
}
// Locate the package
if (I->SelectedState == pkgCache::State::DeInstall ||
I->SelectedState == pkgCache::State::Purge)
Cache->MarkDelete(I);
+ if (I->SelectedState == pkgCache::State::Purge)
+ Cache[I].iFlags |= pkgDepCache::Purge;
}
/* Resolve any problems that dselect created, allupgrade cannot handle
cout << " -c=? Read this configuration file" << endl;
cout << " -o=? Set an arbitary configuration option, eg -o dir::cache=/tmp" << endl;
cout << "See the apt-get(8), sources.list(5) and apt.conf(5) manual" << endl;
- cout << "pages for more information." << endl;
+ cout << "pages for more information and options." << endl;
return 100;
}
/*}}}*/
{0,"no-upgrade","APT::Get::no-upgrade",0},
{0,"force-yes","APT::Get::force-yes",0},
{0,"print-uris","APT::Get::Print-URIs",0},
+ {0,"purge","APT::Get::Purge",0},
{'c',"config-file",0,CommandLine::ConfigFile},
{'o',"option",0,CommandLine::ArbItem},
{0,0,0,0}};
apt (0.3.11.1) unstable; urgency=low
* Fix for typo in the dhelp index. Closes: #40377
+ * Multiple media swap support
+ * Purge support. Closes: #33291, #40694
+ * Better handling of - remove notation. Closes: #41024
-- Jason Gunthorpe <jgg@debian.org> Mon, 28 Jun 1999 21:06:44 -0700
the file name on the remote site! This also works with the bf(source)
command See bf(APT::Get::Print-URIs).
+dit(bf(--purge))
+Use purge instead of remove for anything that would be removed.
+
dit(bf(-c, --config-file))
Configuration File; Specify a configuration file to use. bf(apt-get) will
read the default configuration file and then this configuration file. See