summaryrefslogtreecommitdiff
path: root/cmdline
diff options
context:
space:
mode:
authorArch Librarian <arch@canonical.com>2004-09-20 16:51:27 +0000
committerArch Librarian <arch@canonical.com>2004-09-20 16:51:27 +0000
commit03e39e592311fd327ea516d31567557830634c86 (patch)
tree6fc4479836bf5df004ecc5b387854d95a54a7b05 /cmdline
parentd7827acababa05db7e901d2dfeb27538ef6a6142 (diff)
Archive acquire code
Author: jgg Date: 1998-11-13 04:23:26 GMT Archive acquire code
Diffstat (limited to 'cmdline')
-rw-r--r--cmdline/apt-cache.cc11
-rw-r--r--cmdline/apt-get.cc40
2 files changed, 45 insertions, 6 deletions
diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc
index 531744546..c62999151 100644
--- a/cmdline/apt-cache.cc
+++ b/cmdline/apt-cache.cc
@@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: apt-cache.cc,v 1.10 1998/10/19 23:45:35 jgg Exp $
+// $Id: apt-cache.cc,v 1.11 1998/11/13 04:24:01 jgg Exp $
/* ######################################################################
apt-cache - Manages the cache files
@@ -44,7 +44,13 @@ bool DumpPackage(pkgCache &Cache,CommandLine &CmdL)
cout << "Package: " << Pkg.Name() << endl;
cout << "Versions: ";
for (pkgCache::VerIterator Cur = Pkg.VersionList(); Cur.end() != true; Cur++)
- cout << Cur.VerStr() << ',';
+ {
+ cout << Cur.VerStr();
+ for (pkgCache::VerFileIterator Vf = Cur.FileList(); Vf.end() == false; Vf++)
+ cout << "(" << Vf.File().FileName() << ")";
+ cout << ',';
+ }
+
cout << endl;
cout << "Reverse Depends: " << endl;
@@ -72,6 +78,7 @@ bool DumpPackage(pkgCache &Cache,CommandLine &CmdL)
for (pkgCache::PrvIterator Prv = Pkg.ProvidesList(); Prv.end() != true; Prv++)
cout << Prv.OwnerPkg().Name() << " " << Prv.OwnerVer().VerStr();
cout << endl;
+
}
return true;
diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc
index 8daaf05f4..85373d874 100644
--- a/cmdline/apt-get.cc
+++ b/cmdline/apt-get.cc
@@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: apt-get.cc,v 1.8 1998/11/12 05:30:10 jgg Exp $
+// $Id: apt-get.cc,v 1.9 1998/11/13 04:24:03 jgg Exp $
/* ######################################################################
apt-get - Cover for dpkg
@@ -33,6 +33,7 @@
#include <apt-pkg/pkgcachegen.h>
#include <apt-pkg/algorithms.h>
#include <apt-pkg/acquire-item.h>
+#include <apt-pkg/dpkgpm.h>
#include <config.h>
@@ -421,7 +422,7 @@ bool CacheFile::Open()
// ---------------------------------------------------------------------
/* This displays the informative messages describing what is going to
happen and then calls the download routines */
-bool InstallPackages(pkgDepCache &Cache,bool ShwKept)
+bool InstallPackages(pkgDepCache &Cache,bool ShwKept,bool Ask = true)
{
ShowDel(c1out,Cache);
ShowNew(c1out,Cache);
@@ -443,7 +444,35 @@ bool InstallPackages(pkgDepCache &Cache,bool ShwKept)
if (Cache.DelCount() == 0 && Cache.InstCount() == 0 &&
Cache.BadCount() == 0)
return true;
-
+
+ // Run the simulator ..
+ if (_config->FindB("APT::Get::Simulate") == true)
+ {
+ pkgSimulate PM(Cache);
+ return PM.DoInstall();
+ }
+
+ // Create the text record parser
+ pkgRecords Recs(Cache);
+
+ // Create the download object
+ AcqTextStatus Stat(ScreenWidth,_config->FindI("quiet",0));
+ pkgAcquire Fetcher(&Stat);
+
+ // Read the source list
+ pkgSourceList List;
+ if (List.ReadMainList() == false)
+ return _error->Error("The list of sources could not be read.");
+
+ // Create the package manager and prepare to download
+ pkgPackageManager PM(Cache);
+ if (PM.GetArchives(&Fetcher,&List,&Recs) == false)
+ return false;
+
+ // Run it
+ if (Fetcher.Run() == false)
+ return false;
+
return true;
}
/*}}}*/
@@ -654,7 +683,10 @@ bool DoInstall(CommandLine &CmdL)
ShowList(c1out,"The following extra packages will be installed:",List);
}
- return InstallPackages(Cache,false);
+ // See if we need to prompt
+ if (Cache->InstCount() != ExpectedInst || Cache->DelCount() != 0)
+ return InstallPackages(Cache,false,true);
+ return InstallPackages(Cache,false);
}
/*}}}*/
// DoDistUpgrade - Automatic smart upgrader /*{{{*/