[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#82738: patch



I've got a patch for this feature request; it's attached here.
I have created it with 'cvs diff -u > <filename>', from the aliencode branch in
the cvs of apt on 12 feb. 2001.

If you have any questions, please do contact me.

sincerely
Admar Schoonen

? apt/aclocal.m4
? apt/configure
? apt/build
? apt/config.log
? apt/include
? apt/config.cache
? apt/config.status
? apt/bin
? apt/obj
? apt/environment.mak
? apt/makefile
? apt/scripts
? apt/docs
Index: apt/cmdline/apt-get.cc
===================================================================
RCS file: /cvs/deity/apt/cmdline/apt-get.cc,v
retrieving revision 1.97.2.34
diff -u -r1.97.2.34 apt-get.cc
--- apt/cmdline/apt-get.cc	2001/02/10 23:46:52	1.97.2.34
+++ apt/cmdline/apt-get.cc	2001/02/12 10:27:56
@@ -595,12 +595,13 @@
    Fail |= Essential;
    Stats(c1out,Cache);
    
-   // Sanity check
-   if (Cache->BrokenCount() != 0)
-   {
-      ShowBroken(c1out,Cache,false);
-      return _error->Error("Internal Error, InstallPackages was called with broken packages!");
-   }
+   if (_config->FindB("APT::Get::download-without-deps",false) == false) 
+      // Sanity check
+      if (Cache->BrokenCount() != 0)
+      {
+	 ShowBroken(c1out,Cache,false);
+	 return _error->Error("Internal Error, InstallPackages was called with broken packages!");
+      }
 
    if (Cache->DelCount() == 0 && Cache->InstCount() == 0 &&
        Cache->BadCount() == 0)
@@ -978,8 +979,9 @@
       ExpectedInst++;
    
    // Install it with autoinstalling enabled.
-   if (State.InstBroken() == true && BrokenFix == false)
-      Cache.MarkInstall(Pkg,true);
+   if (_config->FindB("APT::Get::download-without-deps",false) == false)
+      if (State.InstBroken() == true && BrokenFix == false)
+         Cache.MarkInstall(Pkg,true);
    return true;
 }
 									/*}}}*/
@@ -1333,32 +1335,35 @@
    }
    
    // Call the scored problem resolver
-   Fix.InstallProtect();
-   if (Fix.Resolve(true) == false)
-      _error->Discard();
+   if (_config->FindB("APT::Get::download-without-deps",false) == false) {
+      Fix.InstallProtect();
+      if (Fix.Resolve(true) == false)
+         _error->Discard();
+   }
 
-   // Now we check the state of the packages,
-   if (Cache->BrokenCount() != 0)
-   {
-      c1out << 
-       _("Some packages could not be installed. This may mean that you have\n" 
-	 "requested an impossible situation or if you are using the unstable\n" 
-	 "distribution that some required packages have not yet been created\n"
-	 "or been moved out of Incoming.") << endl;
-      if (Packages == 1)
+   if (_config->FindB("APT::Get::download-without-deps",false) == false)
+      // Now we check the state of the packages,
+      if (Cache->BrokenCount() != 0)
       {
-	 c1out << endl;
 	 c1out << 
-	  _("Since you only requested a single operation it is extremely likely that\n"
-	    "the package is simply not installable and a bug report against\n" 
-	    "that package should be filed.") << endl;
-      }
+	 _("Some packages could not be installed. This may mean that you have\n" 
+	   "requested an impossible situation or if you are using the unstable\n" 
+	   "distribution that some required packages have not yet been created\n"
+	   "or been moved out of Incoming.") << endl;
+	 if (Packages == 1)
+	 {
+	    c1out << endl;
+	    c1out << 
+	    _("Since you only requested a single operation it is extremely likely that\n"
+	      "the package is simply not installable and a bug report against\n" 
+	      "that package should be filed.") << endl;
+	 }
 
-      c1out << _("The following information may help to resolve the situation:") << endl;
-      c1out << endl;
-      ShowBroken(c1out,Cache,false);
-      return _error->Error(_("Sorry, broken packages"));
-   }   
+	 c1out << _("The following information may help to resolve the situation:") << endl;
+	 c1out << endl;
+	 ShowBroken(c1out,Cache,false);
+	 return _error->Error(_("Sorry, broken packages"));
+      }   
    
    /* Print out a list of packages that are going to be installed extra
       to what the user asked */
@@ -1981,6 +1986,7 @@
       "  -b  Build the source package after fetching it\n"
       "  -c=? Read this configuration file\n"
       "  -o=? Set an arbitary configuration option, eg -o dir::cache=/tmp\n"
+      "  --download-without-deps Download only the specified packages, not their dependencies - no unpack or install\n"
       "See the apt-get(8), sources.list(5) and apt.conf(5) manual\n"
       "pages for more information and options.\n"
       "                       This APT has Super Cow Powers.\n");
@@ -2051,6 +2057,7 @@
       {0,"list-cleanup","APT::Get::List-Cleanup",0},
       {0,"reinstall","APT::Get::ReInstall",0},
       {0,"trivial-only","APT::Get::Trivial-Only",0},
+      {0,"download-without-deps","APT::Get::download-without-deps",0},
       {0,"remove","APT::Get::Remove",0},
       {0,"only-source","APT::Get::Only-Source",0},
       {'c',"config-file",0,CommandLine::ConfigFile},
@@ -2111,6 +2118,9 @@
    signal(SIGWINCH,SigWinch);
    SigWinch(0);
 
+   if (_config->FindB("APT::Get::download-without-deps",false) == true) 
+      if (_config->FindB("APT::Get::Download-Only",false) == false)
+         _config->Set("APT::Get::Download-Only",true);
    // Match the operation
    CmdL.DispatchArg(Cmds);
 
Index: apt/doc/apt-get.8.sgml
===================================================================
RCS file: /cvs/deity/apt/doc/Attic/apt-get.8.sgml,v
retrieving revision 1.1.2.4
diff -u -r1.1.2.4 apt-get.8.sgml
--- apt/doc/apt-get.8.sgml	2001/02/10 08:29:27	1.1.2.4
+++ apt/doc/apt-get.8.sgml	2001/02/12 10:27:56
@@ -210,6 +210,13 @@
      Configuration Item: <literal/APT::Get::Download-Only/.
      </VarListEntry>
 
+     <VarListEntry><term><option/--download-without-deps/</>
+     <ListItem><Para>
+     Download only the specified packages, not their dependencies - no unpack
+     or install.
+     Configuration Item: <literal/APT::Get::download-without-deps/.
+     </VarListEntry>
+     
      <VarListEntry><term><option/-f/</><term><option/--fix-broken/</>
      <ListItem><Para>
      Fix; attempt to correct a system with broken dependencies in            

Reply to: