Ben Collins лет назад: 26
Родитель
Сommit
99d4896c1c
4 измененных файлов с 98 добавлено и 100 удалено
  1. 6 0
      ChangeLog
  2. 1 0
      debian/changelog
  3. 2 3
      dselect/pkgsublist.cc
  4. 89 97
      main/depcon.c

+ 6 - 0
ChangeLog

@@ -1,3 +1,9 @@
+Thu Jun 15 10:09:03 EDT 2000 Ben Collins <bcollins@debian.org>
+
+  * main/depcon.c: remove if() that prevented versioned deps from checking
+    provides to satisfy them
+  * dselect/pkgsublist.cc: Same
+
 Tue Jun 13 22:11:22 CEST 2000 peter karlsson <peter@softwolves.pp.se>
 
   * po/sv.po: Updated Swedish translation

+ 1 - 0
debian/changelog

@@ -12,6 +12,7 @@ dpkg (1.7.0) unstable; urgency=low
   * dpkg-genchanges: allow a space between # and a to-be-closed bugnumber
   * dpkg-deb: reorder files when building a package
   * dpkg-statoverride: new tool to override ownership and modes for files
+  * Modify dpkg and dselect to allow versioned provides
 
  -- Wichert Akkerman <wakkerma@debian.org>  UNRELEASED
 

+ 2 - 3
dselect/pkgsublist.cc

@@ -137,9 +137,8 @@ int packagelist::add(dependency *depends, showpriority displayimportance) {
   add(depends->up,info.string(),displayimportance);
   for (possi=depends->list; possi; possi=possi->next) {
     add(possi->ed,info.string(),displayimportance);
-    if (possi->verrel == dvr_none && depends->type != dep_provides) {
-      // providers aren't relevant if a version was specified, or
-      // if we're looking at a provider relationship already
+    if (depends->type != dep_provides) {
+      // providers aren't relevant if we're looking at a provider relationship already
       deppossi *provider;
       for (provider= possi->ed->available.valid ? possi->ed->available.depended : 0;
            provider;

+ 89 - 97
main/depcon.c

@@ -268,58 +268,54 @@ int depisok(struct dependency *dep, struct varbuf *whynot,
       }
       varbufaddstr(whynot, linebuf);
 
-      /* If there was no version specified we try looking for Providers. */
-      if (possi->verrel == dvr_none) {
-        
-        /* See if the package we're about to install Provides it. */
-        for (provider= possi->ed->available.depended;
-             provider;
-             provider= provider->nextrev) {
-          if (provider->up->type != dep_provides) continue;
-          if (provider->up->up->clientdata->istobe == itb_installnew) return 1;
-        }
+      /* See if the package we're about to install Provides it. */
+      for (provider= possi->ed->available.depended;
+           provider;
+           provider= provider->nextrev) {
+        if (provider->up->type != dep_provides) continue;
+        if (provider->up->up->clientdata->istobe == itb_installnew) return 1;
+      }
 
-        /* Now look at the packages already on the system. */
-        for (provider= possi->ed->installed.depended;
-             provider;
-             provider= provider->nextrev) {
-          if (provider->up->type != dep_provides) continue;
-          
-          switch (provider->up->up->clientdata->istobe) {
-          case itb_installnew:
-            /* Don't pay any attention to the Provides field of the
-             * currently-installed version of the package we're trying
-             * to install.  We dealt with that by using the available
-             * information above.
-             */
-            continue; 
-          case itb_remove:
-            sprintf(linebuf, _("  %.250s provides %.250s but is to be removed.\n"),
-                    provider->up->up->name, possi->ed->name);
-            break;
-          case itb_deconfigure:
-            sprintf(linebuf, _("  %.250s provides %.250s but is to be deconfigured.\n"),
-                    provider->up->up->name, possi->ed->name);
-            break;
-          case itb_normal: case itb_preinstall:
-            if (provider->up->up->status == stat_installed) return 1;
-            sprintf(linebuf, _("  %.250s provides %.250s but is %s.\n"),
-                    provider->up->up->name, possi->ed->name,
-                    gettext(statusstrings[provider->up->up->status]));
-            break;
-          default:
-            internerr("unknown istobe provider");
-          }
-          varbufaddstr(whynot, linebuf);
-        }
+      /* Now look at the packages already on the system. */
+      for (provider= possi->ed->installed.depended;
+           provider;
+           provider= provider->nextrev) {
+        if (provider->up->type != dep_provides) continue;
         
-        if (!*linebuf) {
-          /* If the package wasn't installed at all, and we haven't said
-           * yet why this isn't satisfied, we should say so now.
+        switch (provider->up->up->clientdata->istobe) {
+        case itb_installnew:
+          /* Don't pay any attention to the Provides field of the
+           * currently-installed version of the package we're trying
+           * to install.  We dealt with that by using the available
+           * information above.
            */
-          sprintf(linebuf, _("  %.250s is not installed.\n"), possi->ed->name);
-          varbufaddstr(whynot, linebuf);
+          continue; 
+        case itb_remove:
+          sprintf(linebuf, _("  %.250s provides %.250s but is to be removed.\n"),
+                  provider->up->up->name, possi->ed->name);
+          break;
+        case itb_deconfigure:
+          sprintf(linebuf, _("  %.250s provides %.250s but is to be deconfigured.\n"),
+                  provider->up->up->name, possi->ed->name);
+          break;
+        case itb_normal: case itb_preinstall:
+          if (provider->up->up->status == stat_installed) return 1;
+          sprintf(linebuf, _("  %.250s provides %.250s but is %s.\n"),
+                  provider->up->up->name, possi->ed->name,
+                  gettext(statusstrings[provider->up->up->status]));
+          break;
+        default:
+          internerr("unknown istobe provider");
         }
+        varbufaddstr(whynot, linebuf);
+      }
+      
+      if (!*linebuf) {
+        /* If the package wasn't installed at all, and we haven't said
+         * yet why this isn't satisfied, we should say so now.
+         */
+        sprintf(linebuf, _("  %.250s is not installed.\n"), possi->ed->name);
+        varbufaddstr(whynot, linebuf);
       }
     }
 
@@ -377,60 +373,56 @@ int depisok(struct dependency *dep, struct varbuf *whynot,
       }
     }
 
-    /* If there was no version specified we try looking for Providers. */
-    if (possi->verrel == dvr_none) {
-        
-      /* See if the package we're about to install Provides it. */
-      for (provider= possi->ed->available.depended;
-           provider;
-           provider= provider->nextrev) {
-        if (provider->up->type != dep_provides) continue;
-        if (provider->up->up->clientdata->istobe != itb_installnew) continue;
-        if (provider->up->up == dep->up) continue; /* conflicts and provides the same */
-        sprintf(linebuf, _("  %.250s provides %.250s and is to be installed.\n"),
-                provider->up->up->name, possi->ed->name);
-        varbufaddstr(whynot, linebuf);
-        /* We can't remove the one we're about to install: */
-        if (canfixbyremove) *canfixbyremove= 0;
-        return 0;
-      }
+    /* See if the package we're about to install Provides it. */
+    for (provider= possi->ed->available.depended;
+         provider;
+         provider= provider->nextrev) {
+      if (provider->up->type != dep_provides) continue;
+      if (provider->up->up->clientdata->istobe != itb_installnew) continue;
+      if (provider->up->up == dep->up) continue; /* conflicts and provides the same */
+      sprintf(linebuf, _("  %.250s provides %.250s and is to be installed.\n"),
+              provider->up->up->name, possi->ed->name);
+      varbufaddstr(whynot, linebuf);
+      /* We can't remove the one we're about to install: */
+      if (canfixbyremove) *canfixbyremove= 0;
+      return 0;
+    }
 
-      /* Now look at the packages already on the system. */
-      for (provider= possi->ed->installed.depended;
-           provider;
-           provider= provider->nextrev) {
-        if (provider->up->type != dep_provides) continue;
-          
-        if (provider->up->up == dep->up) continue; /* conflicts and provides the same */
+    /* Now look at the packages already on the system. */
+    for (provider= possi->ed->installed.depended;
+         provider;
+         provider= provider->nextrev) {
+      if (provider->up->type != dep_provides) continue;
         
-        switch (provider->up->up->clientdata->istobe) {
-        case itb_installnew:
-          /* Don't pay any attention to the Provides field of the
-           * currently-installed version of the package we're trying
-           * to install.  We dealt with that package by using the
-           * available information above.
-           */
-          continue; 
-        case itb_remove:
+      if (provider->up->up == dep->up) continue; /* conflicts and provides the same */
+      
+      switch (provider->up->up->clientdata->istobe) {
+      case itb_installnew:
+        /* Don't pay any attention to the Provides field of the
+         * currently-installed version of the package we're trying
+         * to install.  We dealt with that package by using the
+         * available information above.
+         */
+        continue; 
+      case itb_remove:
+        continue;
+      case itb_normal: case itb_deconfigure: case itb_preinstall:
+        switch (provider->up->up->status) {
+        case stat_notinstalled: case stat_configfiles:
           continue;
-        case itb_normal: case itb_deconfigure: case itb_preinstall:
-          switch (provider->up->up->status) {
-          case stat_notinstalled: case stat_configfiles:
-            continue;
-          default:
-            sprintf(linebuf, _("  %.250s provides %.250s and is %s.\n"),
-                    provider->up->up->name, possi->ed->name,
-                    gettext(statusstrings[provider->up->up->status]));
-            varbufaddstr(whynot, linebuf);
-            if (!canfixbyremove) return 0;
-            nconflicts++;
-            *canfixbyremove= provider->up->up;
-            break;
-          }
-          break;
         default:
-          internerr("unknown istobe conflict provider");
+          sprintf(linebuf, _("  %.250s provides %.250s and is %s.\n"),
+                  provider->up->up->name, possi->ed->name,
+                  gettext(statusstrings[provider->up->up->status]));
+          varbufaddstr(whynot, linebuf);
+          if (!canfixbyremove) return 0;
+          nconflicts++;
+          *canfixbyremove= provider->up->up;
+          break;
         }
+        break;
+      default:
+        internerr("unknown istobe conflict provider");
       }
     }