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

Re: argh



On Fri, Jun 16, 2000 at 07:17:56AM -0400, Ben Collins wrote:
> On Thu, Jun 15, 2000 at 07:18:27PM +0200, Wichert Akkerman wrote:
> > 
> > Remind me to test something before I announce it next time. Versioned
> > provides do not work yet, I'll fix it tomorrow.
> 
> I almost have this working. Just a minor addition of code to depcon.c in
> deppossi_ok_found(). I'll commit and post the patch when I'm done.

Ok, patch is commited, and is working. Attached for convenience.

-- 
 -----------=======-=-======-=========-----------=====------------=-=------
/  Ben Collins  --  ...on that fantastic voyage...  --  Debian GNU/Linux   \
`  bcollins@debian.org  --  bcollins@openldap.org  --  bcollins@linux.com  '
 `---=========------=======-------------=-=-----=-===-======-------=--=---'
? temp.diff
Index: enquiry.c
===================================================================
RCS file: /cvs/dpkg/dpkg/main/enquiry.c,v
retrieving revision 1.20
diff -u -r1.20 enquiry.c
--- enquiry.c	2000/06/09 14:11:41	1.20
+++ enquiry.c	2000/06/16 13:04:32
@@ -603,7 +603,6 @@
       if (trypkg->files && versionsatisfied(&trypkg->available,possi)) {
         if (trypkg->clientdata->istobe == itb_normal) { pkg= trypkg; break; }
       }
-      if (possi->verrel != dvr_none) continue;
       for (provider=possi->ed->available.depended;
            !pkg && provider;
            provider=provider->next) {
Index: packages.c
===================================================================
RCS file: /cvs/dpkg/dpkg/main/packages.c,v
retrieving revision 1.4
diff -u -r1.4 packages.c
--- packages.c	1999/10/30 01:44:55	1.4
+++ packages.c	2000/06/16 13:04:33
@@ -252,7 +252,8 @@
                              int *matched,
                              struct deppossi *checkversion,
                              int *interestingwarnings,
-                             struct varbuf *oemsgs) {
+                             struct varbuf *oemsgs,
+			     struct deppossi *provider) {
   int thisf;
   
   if (ignore_depends(possdependee)) {
@@ -278,18 +279,42 @@
   case stat_unpacked:
   case stat_halfconfigured:
     assert(possdependee->installed.valid);
-    if (checkversion && !versionsatisfied(&possdependee->installed,checkversion)) {
-      varbufaddstr(oemsgs,_("  Version of "));
-      varbufaddstr(oemsgs,possdependee->name);
-      varbufaddstr(oemsgs,_(" on system is "));
-      varbufaddstr(oemsgs,versiondescribe(&possdependee->installed.version,
-                                          vdew_nonambig));
-      varbufaddstr(oemsgs,".\n");
-      assert(checkversion->verrel != dvr_none);
-      if (fc_depends) thisf= (dependtry >= 3) ? 2 : 1;
-      debug(dbg_depcondetail,"      bad version, returning %d",thisf);
-      (*interestingwarnings)++;
-      return thisf;
+    if (checkversion) {
+      if (!provider) {
+	debug(dbg_depcondetail,"      checking non-provided pkg %s",possdependee->name);
+	if (versionsatisfied(&possdependee->installed,checkversion)) {
+          varbufaddstr(oemsgs,_("  Version of "));
+          varbufaddstr(oemsgs,possdependee->name);
+          varbufaddstr(oemsgs,_(" on system is "));
+          varbufaddstr(oemsgs,versiondescribe(&possdependee->installed.version,
+                                              vdew_nonambig));
+          varbufaddstr(oemsgs,".\n");
+          assert(checkversion->verrel != dvr_none);
+          if (fc_depends) thisf= (dependtry >= 3) ? 2 : 1;
+          debug(dbg_depcondetail,"       bad version, returning %d",thisf);
+          (*interestingwarnings)++;
+          return thisf;
+        }
+      } else {
+	debug(dbg_depcondetail,"      checking package %s provided by pkg %s",
+	      checkversion->ed->name,possdependee->name);
+        if (versionsatisfied3(&checkversion->version,&provider->version,
+                              checkversion->verrel)) {
+          varbufaddstr(oemsgs,_("  Version of "));
+	  varbufaddstr(oemsgs,checkversion->ed->name);
+	  varbufaddstr(oemsgs,_(" on system, provided by "));
+	  varbufaddstr(oemsgs,possdependee->name);
+	  varbufaddstr(oemsgs,_(", is "));
+	  varbufaddstr(oemsgs,versiondescribe(&provider->version,
+					      vdew_nonambig));
+	  varbufaddstr(oemsgs,".\n");
+	  assert(checkversion->verrel != dvr_none);
+	  if (fc_depends) thisf= (dependtry >= 3) ? 2 : 1;
+	  debug(dbg_depcondetail,"      bad version, returning %d",thisf);
+	  (*interestingwarnings)++;
+	  return thisf;
+	}
+      }
     }
     if (possdependee->status == stat_installed) {
       debug(dbg_depcondetail,"      is installed, ok and found");
@@ -357,17 +382,21 @@
         found= 3; break;
       }
       thisf= deppossi_ok_found(possi->ed,pkg,removing,0,
-                               &matched,possi,&interestingwarnings,&oemsgs);
+                               &matched,possi,&interestingwarnings,&oemsgs,NULL);
       if (thisf > found) found= thisf;
-      if (found != 3 && possi->verrel == dvr_none) {
+      if (found != 3) {
         if (possi->ed->installed.valid) {
           for (provider= possi->ed->installed.depended;
                found != 3 && provider;
                provider= provider->nextrev) {
             if (provider->up->type != dep_provides) continue;
             debug(dbg_depcondetail,"     checking provider %s",provider->up->up->name);
-            thisf= deppossi_ok_found(provider->up->up,pkg,removing,possi->ed,
-                                     &matched,0,&interestingwarnings,&oemsgs);
+	    if (possi->verrel == dvr_none)
+	      thisf= deppossi_ok_found(provider->up->up,pkg,removing,possi->ed,
+				       &matched,NULL,&interestingwarnings,&oemsgs,NULL);
+	    else
+              thisf= deppossi_ok_found(provider->up->up,pkg,removing,possi->ed,
+                                       &matched,possi,&interestingwarnings,&oemsgs,provider);
             if (thisf > found) found= thisf;
           }
         }

Reply to: