소스 검색

dpkg: Ignore conflict with one's own virtual package within a package set

It's common for packages to “Provides: foo” and “Conflicts: foo”
when taking over another package. This self-conflict is explicitly
ignored by dpkg.

Now if multiple instances of a “Multi-Arch: same” package do this,
it should still be allowed. Update the checks accordingly both in
dpkg and in dselect.

Sponsored-by: Linaro Limited

Signed-off-by: Guillem Jover <guillem@debian.org>
Raphaël Hertzog 15 년 전
부모
커밋
ae61affca4
2개의 변경된 파일6개의 추가작업 그리고 2개의 파일을 삭제
  1. 4 0
      dselect/pkgdepcon.cc
  2. 2 2
      src/depcon.c

+ 4 - 0
dselect/pkgdepcon.cc

@@ -404,6 +404,8 @@ packagelist::deppossatisfied(deppossi *possi, perpackagestate **fixbyupgrade)
        provider;
        provider = provider->rev_next) {
     if (provider->up->type == dep_provides &&
+        ((possi->up->type != dep_conflicts && possi->up->type != dep_breaks) ||
+         provider->up->up->set != possi->up->up->set) &&
         provider->up->up->clientdata &&
         !useavailable(provider->up->up) &&
         would_like_to_install(provider->up->up->clientdata->selected,
@@ -414,6 +416,8 @@ packagelist::deppossatisfied(deppossi *possi, perpackagestate **fixbyupgrade)
        provider;
        provider = provider->rev_next) {
     if (provider->up->type != dep_provides ||
+        ((possi->up->type == dep_conflicts || possi->up->type == dep_breaks) &&
+         provider->up->up->set == possi->up->up->set) ||
         !provider->up->up->clientdata ||
         !would_like_to_install(provider->up->up->clientdata->selected,
                                provider->up->up))

+ 2 - 2
src/depcon.c

@@ -493,7 +493,7 @@ depisok(struct dependency *dep, struct varbuf *whynot,
            provider = provider->rev_next) {
         if (provider->up->type != dep_provides) continue;
         if (provider->up->up->clientdata->istobe != itb_installnew) continue;
-        if (provider->up->up == dep->up)
+        if (provider->up->up->set == dep->up->set)
           continue; /* Conflicts and provides the same. */
         sprintf(linebuf, _("  %.250s provides %.250s and is to be installed.\n"),
                 provider->up->up->set->name, possi->ed->name);
@@ -510,7 +510,7 @@ depisok(struct dependency *dep, struct varbuf *whynot,
            provider = provider->rev_next) {
         if (provider->up->type != dep_provides) continue;
 
-        if (provider->up->up == dep->up)
+        if (provider->up->up->set == dep->up->set)
           continue; /* Conflicts and provides the same. */
 
         switch (provider->up->up->clientdata->istobe) {