From 7df7d53a57b9913f4a20b2c9dcd554a2d88ff9f3 Mon Sep 17 00:00:00 2001 From: Ben Collins Date: Sun, 5 Nov 2000 15:06:48 +0000 Subject: [PATCH] Created branch point for versioned provides, reverted changes from HEAD for it too --- ChangeLog | 5 ++ debian/changelog | 3 +- dselect/pkgdepcon.cc | 3 +- dselect/pkgsublist.cc | 5 +- main/depcon.c | 186 ++++++++++++++++++++++-------------------- main/enquiry.c | 6 +- main/main.c | 4 +- main/main.h | 4 +- main/packages.c | 99 ++++------------------ 9 files changed, 129 insertions(+), 186 deletions(-) diff --git a/ChangeLog b/ChangeLog index 812186e8..03e25197 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sun Nov 5 10:00:31 EST 2000 Ben Collins + + * Create branch point for versioned provides + * Revert patches for it from the HEAD + Sun 29 Oct 23:33:48 CET 2000 peter karlsson * po/sv.po: some corrections diff --git a/debian/changelog b/debian/changelog index 9517fb95..1e2da83f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 UNRELEASED + -- Wichert Akkerman Mon, 8 May 2000 16:08:53 +0200 dpkg (1.6.13) frozen unstable; urgency=low diff --git a/dselect/pkgdepcon.cc b/dselect/pkgdepcon.cc index 2a0a129d..ad80a63f 100644 --- a/dselect/pkgdepcon.cc +++ b/dselect/pkgdepcon.cc @@ -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) { diff --git a/dselect/pkgsublist.cc b/dselect/pkgsublist.cc index 77ca806e..71d18ffb 100644 --- a/dselect/pkgsublist.cc +++ b/dselect/pkgsublist.cc @@ -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; diff --git a/main/depcon.c b/main/depcon.c index 3ff097f8..b64f5218 100644 --- a/main/depcon.c +++ b/main/depcon.c @@ -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"); } } diff --git a/main/enquiry.c b/main/enquiry.c index 494cad32..a352bc00 100644 --- a/main/enquiry.c +++ b/main/enquiry.c @@ -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) { diff --git a/main/main.c b/main/main.c index 70054a29..2648a981 100644 --- a/main/main.c +++ b/main/main.c @@ -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= Use 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 ), diff --git a/main/main.h b/main/main.h index 7cee11f9..24ee4c69 100644 --- a/main/main.h +++ b/main/main.h @@ -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); diff --git a/main/packages.c b/main/packages.c index 5ca0eb38..0cb6aaaa 100644 --- a/main/packages.c +++ b/main/packages.c @@ -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; } } -- 2.39.5