]> err.no Git - dpkg/commitdiff
Created branch point for versioned provides, reverted changes from HEAD for it too
authorBen Collins <bcollins@debian.org>
Sun, 5 Nov 2000 15:06:48 +0000 (15:06 +0000)
committerBen Collins <bcollins@debian.org>
Sun, 5 Nov 2000 15:06:48 +0000 (15:06 +0000)
ChangeLog
debian/changelog
dselect/pkgdepcon.cc
dselect/pkgsublist.cc
main/depcon.c
main/enquiry.c
main/main.c
main/main.h
main/packages.c

index 812186e84da61bd94b3ff5faacd10b40e0794b32..03e25197774ded16b30ef42877159a6fdab27b5c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Sun Nov  5 10:00:31 EST 2000 Ben Collins <bcollins@debian.org>
+
+  * Create branch point for versioned provides
+  * Revert patches for it from the HEAD
+
 Sun 29 Oct 23:33:48 CET 2000 peter karlsson <peterk@debian.org>
 
   * po/sv.po: some corrections
index 9517fb951253b65c978c8e80e34366acbf5e1515..1e2da83fd869241e3deefb466af7b96e221190ca 100644 (file)
@@ -17,7 +17,6 @@ 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
   * Check COLUMNS environment for dpkg -l output. Closes: Bug#65536
   * Add Origin, Bugs-Submit-To, Bugs-Submit-Style
   * Corrections and updates to Swedish translation.
@@ -39,7 +38,7 @@ dpkg (1.7.0) unstable; urgency=low
   * Update formating of start-stop-daemon manpage. Closes: Bug#75110
   * Make a missing package a warning instead of an error in dpkg-genchanges
 
- -- Wichert Akkerman <wakkerma@debian.org>  UNRELEASED
+ -- Wichert Akkerman <wakkerma@debian.org>  Mon,  8 May 2000 16:08:53 +0200
 
 dpkg (1.6.13) frozen unstable; urgency=low
 
index 2a0a129d99a6db97a62665cfc952178793da79af..ad80a63f5b98861a4ae747f04d3cb07a671b7c72 100644 (file)
@@ -404,8 +404,9 @@ int packagelist::deppossatisfied(deppossi *possi, perpackagestate **fixbyupgrade
       return 0;
     }
   }
+  if (possi->verrel != dvr_none) return 0;
   deppossi *provider;
-  if (possi->ed->installed.valid && possi->verrel == dvr_none) {
+  if (possi->ed->installed.valid) {
     for (provider= possi->ed->installed.depended;
          provider;
          provider= provider->nextrev) {
index 77ca806e28c9a470dbfa34032c1de62393f02e55..71d18ffbb0b03db4a98bdac9e61349097778f0f9 100644 (file)
@@ -137,8 +137,9 @@ 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 (depends->type != dep_provides) {
-      // providers aren't relevant if we're looking at a provider relationship already
+    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
       deppossi *provider;
       for (provider= possi->ed->available.valid ? possi->ed->available.depended : 0;
            provider;
index 3ff097f81f8548413c2af3735f57e3d3d1e53a5d..b64f5218c8cfda1f322eb1e9a389ca49049e0496 100644 (file)
@@ -268,54 +268,58 @@ int depisok(struct dependency *dep, struct varbuf *whynot,
       }
       varbufaddstr(whynot, linebuf);
 
-      /* 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;
-      }
+      /* 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;
+        }
 
-      /* 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;
+        /* 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);
+        }
         
-        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.
+        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.
            */
-          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");
+          sprintf(linebuf, _("  %.250s is not installed.\n"), possi->ed->name);
+          varbufaddstr(whynot, linebuf);
         }
-        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);
       }
     }
 
@@ -373,56 +377,60 @@ int depisok(struct dependency *dep, struct varbuf *whynot,
       }
     }
 
-    /* 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;
-    }
+    /* 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;
+      }
 
-    /* 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;
+      /* 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 */
         
-      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:
+        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;
-        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;
+        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");
         }
-        break;
-      default:
-        internerr("unknown istobe conflict provider");
       }
     }
 
index 494cad32efa42398948a69eaa47b73a369e0a8ae..a352bc00ea9e65358a7d6417bb491016ce22b6e6 100644 (file)
@@ -555,11 +555,6 @@ void assertmulticonrep(const char *const *argv) {
   assertversion(argv,&epochversion,"1.4.1.19");
 }
 
-void assertverprov(const char *const *argv) {
-  static struct versionrevision epochversion = {~0UL,0,0};
-  assertversion(argv,&epochversion,"1.7.0");
-}
-
 void predeppackage(const char *const *argv) {
   /* Print a single package which:
    *  (a) is the target of one or more relevant predependencies.
@@ -616,6 +611,7 @@ void predeppackage(const char *const *argv) {
       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 70054a29c55a3deec658e02fc1295e07a524348c..2648a9812852ba543eaa16abda04229a1cc9caee 100644 (file)
@@ -86,8 +86,7 @@ Use dpkg -b|--build|-c|--contents|-e|--control|-I|--info|-f|--field|\n\
  -x|--extract|-X|--vextract|--fsys-tarfile  on archives (type %s --help.)\n\
 \n\
 For internal use: dpkg --assert-support-predepends | --predep-package |\n\
-  --assert-working-epoch | --assert-long-filenames | --assert-multi-conrep |\n\
-  --assert-versioned-provides\n\
+  --assert-working-epoch | --assert-long-filenames | --assert-multi-conrep\n\
 \n\
 Options:\n\
   --admindir=<directory>     Use <directory> instead of %s\n\
@@ -347,7 +346,6 @@ static const struct cmdinfo cmdinfos[]= {
   ACTION( "assert-working-epoch",            0,  act_assertepoch,          assertepoch     ),
   ACTION( "assert-long-filenames",           0,  act_assertlongfilenames,  assertlongfilenames ),
   ACTION( "assert-multi-conrep",             0,  act_assertmulticonrep,    assertmulticonrep ),
-  ACTION( "assert-versioned-provides",       0,  act_assertverprov,        assertverprov   ),
   ACTION( "print-installation-architecture", 0,  act_printinstarch,        printinstarch   ),
   ACTION( "predep-package",                  0,  act_predeppackage,        predeppackage   ),
   ACTION( "compare-versions",                0,  act_cmpversions,          cmpversions     ),
index 7cee11f9f2e5d0de9452de1a570fd828e811bf07..24ee4c69111b24a50c7456b62b69fb4e88c2420f 100644 (file)
@@ -54,8 +54,7 @@ enum action { act_unset, act_install, act_unpack, act_avail, act_configure,
               act_assertpredep, act_printarch, act_predeppackage, act_cmpversions,
               act_printinstarch, act_compareversions, act_printavail, act_avclear,
               act_forgetold, act_getselections, act_setselections, act_printgnuarch,
-              act_assertepoch, act_assertlongfilenames, act_assertmulticonrep,
-              act_assertverprov };
+              act_assertepoch, act_assertlongfilenames, act_assertmulticonrep };
 
 enum conffopt {
   cfof_prompt        =     001,
@@ -119,7 +118,6 @@ void assertepoch(const char *const *argv);
 void assertpredep(const char *const *argv);
 void assertlongfilenames(const char *const *argv);
 void assertmulticonrep(const char *const *argv);
-void assertverprov(const char *const *argv);
 void predeppackage(const char *const *argv);
 void printarch(const char *const *argv);
 void printinstarch(const char *const *argv);
index 5ca0eb380895280cbd105a6d5a56a6fcc95eebad..0cb6aaaa3dafaa054642b50c3fcc4dc7c93c6a77 100644 (file)
@@ -252,8 +252,7 @@ static int deppossi_ok_found(struct pkginfo *possdependee,
                              int *matched,
                              struct deppossi *checkversion,
                              int *interestingwarnings,
-                             struct varbuf *oemsgs,
-                            struct deppossi *provider) {
+                             struct varbuf *oemsgs) {
   int thisf;
   
   if (ignore_depends(possdependee)) {
@@ -279,42 +278,18 @@ static int deppossi_ok_found(struct pkginfo *possdependee,
   case stat_unpacked:
   case stat_halfconfigured:
     assert(possdependee->installed.valid);
-    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 (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 (possdependee->status == stat_installed) {
       debug(dbg_depcondetail,"      is installed, ok and found");
@@ -378,59 +353,21 @@ int dependencies_ok(struct pkginfo *pkg, struct pkginfo *removing,
     for (possi= dep->list; found != 3 && possi; possi= possi->next) {
       debug(dbg_depcondetail,"    checking possibility  -> %s",possi->ed->name);
       if (possi->cyclebreak) {
-        debug(dbg_depcondetail,"      break cycle, so ok and found");
+        debug(dbg_depcondetail,"      break cycle so ok and found");
         found= 3; break;
       }
       thisf= deppossi_ok_found(possi->ed,pkg,removing,0,
-                               &matched,possi,&interestingwarnings,&oemsgs,NULL);
+                               &matched,possi,&interestingwarnings,&oemsgs);
       if (thisf > found) found= thisf;
-      if (found != 3) {
+      if (found != 3 && possi->verrel == dvr_none) {
         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);
-           if (possi->verrel == dvr_none) {
-             /* A simple package dep, no version */
-             thisf= deppossi_ok_found(provider->up->up,pkg,removing,possi->ed,
-                                      &matched,NULL,&interestingwarnings,&oemsgs,NULL);
-           } else if (provider->verrel == dvr_exact) {
-             /* For versioned depends, we only check providers with
-              * dvr_exact. It doesn't make sense to check ones without a
-              * version since we have nothing to verify it. Also, it is
-              * way too complex to allow anything but exact in a provided
-              * version. A few examples below to deter you from
-              * trying:
-              *
-              *  - foo depends on pkg1 (>= 0.6), bar provides pkg1 (<= 1.0).
-              *    Should pass (easy enough)
-              *
-              *  - foo depends on pkg1 (>= 0.7) and (<= 1.1), bar
-              *    provides pkg1 (>= 1.2). Should fail (little harder)
-              *
-              *  - foo depends on pkg1 (>= 0.4), bar provides pkg1 (<= 1.0)
-              *    and (>= 0.5), IOW, inclusive of only those versions.
-              *    This would require backchecking the other provided
-              *    versions in the possi, which would make things sickly
-              *    complex and overly time consuming. Should fail (very
-              *    hard to implement).
-              *
-              *  There's probably some miracle formula to do this, but I
-              *  don't see it, and there's little to gain, IMNHO. Also,
-              *  packages can get around most of these by providing
-              *  multiple dvr_exact versions. -- Ben
-              */
-             thisf= deppossi_ok_found(provider->up->up,pkg,removing,possi->ed,
-                                      &matched,possi,&interestingwarnings,&oemsgs,provider);
-           }
-           if (thisf == 1 && provider->up->up == pkg && !removing) {
-             /* IOW, if the pkg satisfies it's own dep (via a provide),
-              * then we let it pass, even if it isn't configured yet
-              * (duh, we're installing it!) -- Ben
-              */
-              thisf = 3;
-           }
+            thisf= deppossi_ok_found(provider->up->up,pkg,removing,possi->ed,
+                                     &matched,0,&interestingwarnings,&oemsgs);
             if (thisf > found) found= thisf;
           }
         }