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

Bug#143610: Ingnoring missing packages with apt



Package: apt
Version: 0.5.4

Fai and maybe others who want to install packages 
automatically with apt need a feature, to add lists of 
packages to apt-get on the commandline for installing, 
while apt has to ignore or atleast not stop if it cannot 
find an appropriate Package.
Perhaps this could be managed through a command line option/
config option.

For me worked the following patch, which does only the trivial 
thing: ignoring any error. Please ignore, that I messed up 
the version numbers...


Yours,
	Thorsten Wilmer

diff -ru apt-1.5.4/cmdline/apt-get.cc apt-0.5.4/cmdline/apt-get.cc
--- apt-1.5.4/cmdline/apt-get.cc        Fri Apr 19 18:14:31 2002
+++ apt-0.5.4/cmdline/apt-get.cc        Mon Jul  2 00:59:04 2001
@@ -927,8 +927,8 @@
    {
       /* We want to continue searching for regex hits, so we return false here
          otherwise this is not really an error. */
-       if (AllowFail == false)
-           return false;
+      if (AllowFail == false)
+        return false;      
       ioprintf(c1out,_("Package %s is not installed, so not removed\n"),Pkg.Nam
e());
       return true;
    }
@@ -982,9 +982,8 @@
         }          
         ShowList(c1out,_("However the following packages replace it:"),List);
       }
-     ioprintf(c1out, _("Package %s has no installation candidate ERROR"),Pkg.Na
me());
-
-      /*_error->Error(_("Package %s has no installation candidate"),Pkg.Name())
;*/
+      
+      _error->Error(_("Package %s has no installation candidate"),Pkg.Name());
       return false;
    }
 
@@ -1318,11 +1317,8 @@
         for (I = S; *I != 0; I++)
            if (*I == '.' || *I == '?' || *I == '*' || *I == '|')
               break;
-        if (*I == 0){
-
-      ioprintf(c1out,_("Couldn't find package %s ERROR\n"),S);
-          /* return _error->Error(_("Couldn't find package %s"),S);*/
-       }
+        if (*I == 0)
+           return _error->Error(_("Couldn't find package %s"),S);
 
         // Regexs must always be confirmed
         ExpectedInst += 1000;
@@ -1354,8 +1350,8 @@
         }
         regfree(&Pattern);
         
-        /*if (Hit == false)
-           return _error->Error(_("Couldn't find package %s"),S);*/
+        if (Hit == false)
+           return _error->Error(_("Couldn't find package %s"),S);
       }
       else
       {

-- 
------------------------------------------------------------
Thorsten Wilmer           twi@irb.informatik.uni-dortmund.de

Universitaet Dortmund                               UNI DO//
FB Informatik, IRB         Tel.: +49 231 755 2422  ___ ////
D-44221 Dortmund           Fax.: +49 231 755 2386  \*\\///  
Germany                                             \\\\/  
------------------------------------------------------------




-- 
To UNSUBSCRIBE, email to deity-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org



Reply to: