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

Re: Ignore dependencies while download only (feature request?)



Thanks, however it seems that aptitude can't be given a conf file as an
argument and it reads only the predefined files in /etc and ~/.aptitude (I
might be wrong about this, as I'm not really familiar with aptitude). I tried a
-oDir::Etc::Main=... option, but it doesn't seem to work either. 

In the meanwhile, I made a simple patch so I use my special version of apt to
download files :)

Regards,
    Yair.


Julian Andres Klode <jak@debian.org> writes:

> On Wed, Jul 08, 2009 at 12:03:28PM +0300, Yair Yarom wrote:
>> 
>> Hi,
>> 
>> Is there a way to tell apt-get to ignore dependencies when in download-only
>> mode? 
>> 
>> I want to use apt to download deb files from several sources
>> (e.g. snapshot.debian.org) without changing the main sources.list, where I'll
>> install them manually using dpkg. I've set up an alternative apt.conf with
>> different directories and different config files for that, but it won't let me
>> download anything as nothing is installed...
>> 
>> Is there a better solution other than recompiling apt with an "ignore
>> dependencies" patch? 
> Use "aptitude download <package>"  instead.

--- cmdline/apt-get.cc.orig	2009-07-08 11:10:18.000000000 +0300
+++ cmdline/apt-get.cc	2009-07-08 11:29:13.000000000 +0300
@@ -767,7 +767,8 @@
    Stats(c1out,Cache);
 
    // Sanity check
-   if (Cache->BrokenCount() != 0)
+   if (Cache->BrokenCount() != 0 && ((_config->FindB("APT::Get::Download-only",false) == false) ||
+                                     (_config->FindB("APT::Get::IgnoreBrokenIfDownloadOnly",false) == false)))
    {
       ShowBroken(c1out,Cache,false);
       return _error->Error(_("Internal error, InstallPackages was called with broken packages!"));
@@ -1444,7 +1445,8 @@
       c1out << _("Use 'apt-get autoremove' to remove them.") << std::endl;
 
    // Now see if we destroyed anything
-   if (Cache->BrokenCount() != 0)
+   if (Cache->BrokenCount() != 0 && ((_config->FindB("APT::Get::Download-only",false) == false) ||
+                                     (_config->FindB("APT::Get::IgnoreBrokenIfDownloadOnly",false) == false)))
    {
       c1out << _("Hmm, seems like the AutoRemover destroyed something which really\n"
 	         "shouldn't happen. Please file a bug report against apt.") << endl;
@@ -1721,7 +1723,8 @@
 	 _error->Discard();
 
       // Now we check the state of the packages,
-      if (Cache->BrokenCount() != 0)
+      if (Cache->BrokenCount() != 0 && ((_config->FindB("APT::Get::Download-only",false) == false) ||
+                                        (_config->FindB("APT::Get::IgnoreBrokenIfDownloadOnly",false) == false)))
       {
 	 c1out << 
 	    _("Some packages could not be installed. This may mean that you have\n" 
@@ -1944,7 +1947,8 @@
 
    /* Resolve any problems that dselect created, allupgrade cannot handle
       such things. We do so quite agressively too.. */
-   if (Cache->BrokenCount() != 0)
+   if (Cache->BrokenCount() != 0 && ((_config->FindB("APT::Get::Download-only",false) == false) ||
+                                     (_config->FindB("APT::Get::IgnoreBrokenIfDownloadOnly",false) == false)))       
    {      
       pkgProblemResolver Fix(Cache);
 
@@ -2676,6 +2680,7 @@
    _config->Set("quiet",0);
    _config->Set("help",false);
    _config->Set("APT::Get::Download-Only",false);
+   _config->Set("APT::Get::IgnoreBrokenIfDownloadOnly",false);
    _config->Set("APT::Get::Simulate",false);
    _config->Set("APT::Get::Assume-Yes",false);
    _config->Set("APT::Get::Fix-Broken",false);

Reply to: