From 99d4896c1c4a276619daa446969c5fff01c11499 Mon Sep 17 00:00:00 2001 From: Ben Collins Date: Thu, 15 Jun 2000 14:19:28 +0000 Subject: [PATCH] versioned provides --- ChangeLog | 6 ++ debian/changelog | 1 + dselect/pkgsublist.cc | 5 +- main/depcon.c | 186 ++++++++++++++++++++---------------------- 4 files changed, 98 insertions(+), 100 deletions(-) diff --git a/ChangeLog b/ChangeLog index c330e78c..699764f4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Thu Jun 15 10:09:03 EDT 2000 Ben Collins + + * 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 * po/sv.po: Updated Swedish translation diff --git a/debian/changelog b/debian/changelog index 07bc2605..337bde69 100644 --- a/debian/changelog +++ b/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 UNRELEASED diff --git a/dselect/pkgsublist.cc b/dselect/pkgsublist.cc index 71d18ffb..77ca806e 100644 --- a/dselect/pkgsublist.cc +++ b/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; diff --git a/main/depcon.c b/main/depcon.c index b64f5218..3ff097f8 100644 --- a/main/depcon.c +++ b/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"); } } -- 2.39.5