Author: jgg
Date: 1999-07-09 04:11:33 GMT
g++- works
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
// -*- 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
/* ######################################################################
Algorithms - A set of misc algorithms
// Simulate::Remove - Simulate the removal of a package /*{{{*/
// ---------------------------------------------------------------------
/* */
// 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);
{
// 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();
if (Sim.BrokenCount() != 0)
ShortBreaks();
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
// -*- 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
/* ######################################################################
Algorithms - A set of misc algorithms
// The Actuall installation implementation
virtual bool Install(PkgIterator Pkg,string File);
virtual bool Configure(PkgIterator Pkg);
// 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:
void ShortBreaks();
public:
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
// -*- 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
/* ######################################################################
DPKG Package Manager - Provide an interface to dpkg
// DPkgPM::Remove - Remove a package /*{{{*/
// ---------------------------------------------------------------------
/* Add a remove operation to the sequence list */
// 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;
{
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));
Size += strlen(Args[n-1]);
break;
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]);
case Item::Configure:
Args[n++] = "--configure";
Size += strlen(Args[n-1]);
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
// -*- 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
/* ######################################################################
DPKG Package Manager - Provide an interface to dpkg
- 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),
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);
// 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();
virtual bool Go();
virtual void Reset();
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
// -*- 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
/* ######################################################################
DepCache - Dependency Extension data for the cache
DepCandPolicy = (1 << 4), DepCandMin = (1 << 5)};
// These flags are used in StateCache::iFlags
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};
enum VersionTypes {NowVersion, InstallVersion, CandidateVersion};
enum ModeList {ModeDelete = 0, ModeKeep = 1, ModeInstall = 2};
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
// -*- 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
/* ######################################################################
Package Manager - Abstacts the package manager
return true;
List->Flag(Pkg,pkgOrderList::Configured,pkgOrderList::States);
return true;
List->Flag(Pkg,pkgOrderList::Configured,pkgOrderList::States);
+ return Remove(Pkg,(Cache[Pkg].iFlags & pkgDepCache::Purge) == pkgDepCache::Purge);
}
/*}}}*/
// PM::SmartUnPack - Install helper /*{{{*/
}
/*}}}*/
// PM::SmartUnPack - Install helper /*{{{*/
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
// -*- 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
/* ######################################################################
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;};
// 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() {};
virtual bool Go() {return true;};
virtual void Reset() {};
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
// -*- 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
/* ######################################################################
apt-get - Cover for dpkg
pkgCache::PkgIterator I = Dep.PkgBegin();
string List;
for (;I.end() != true; I++)
pkgCache::PkgIterator I = Dep.PkgBegin();
string List;
for (;I.end() != true; I++)
if (Dep[I].Delete() == true)
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);
}
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)
{
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;
bool Fail = false;
bool Essential = false;
// See if we are removing the package
bool Remove = DefRemove;
// 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;
{
// Handle an optional end tag indicating what to do
if (S[Length - 1] == '-')
{
Remove = true;
S[--Length] = 0;
if (S[Length - 1] == '+')
{
Remove = false;
S[--Length] = 0;
if (S[Length - 1] == '+')
{
Remove = false;
S[--Length] = 0;
if (I->SelectedState == pkgCache::State::DeInstall ||
I->SelectedState == pkgCache::State::Purge)
Cache->MarkDelete(I);
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
}
/* 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 << " -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;
{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,"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}};
{'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
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
-- 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).
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
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