This rudimentary patch catches this situation where aptitude would otherwise just install the latest available version of the package - even though you requested a specific version - and with this patch applied, it aborts when it finds out this is the case, instead of installing "latest version" of the requested package.

IMHO the correct thing to do.

You probably want to stop the processing in some other way than using abort() - and the printf may or may not need to be there (it does print out the error earlier on as well).

--
Regards,
Klavs Klavsen, GSEC - k...@vsen.dk - http://www.vsen.dk

"Those who do not understand Unix are condemned to reinvent it, poorly."
  --Henry Spencer


--- aptitude-0.4.9.orig/src/cmdline/cmdline_action.cc   2007-11-16 06:07:58.000000000 +0100
+++ aptitude-0.4.9/src/cmdline/cmdline_action.cc        2010-08-05 13:35:25.000000000 +0200
@@ -85,6 +85,11 @@
   if(action==cmdline_install)
     ver=cmdline_find_ver(pkg, source, sourcestr);
 
+       if (!ver)
+               {
+               printf("Requested version not found in repositories: %s\n", sourcestr.c_str());
+               abort();
+               }
   switch(action)
     {
     case cmdline_installauto:

Reply via email to