2 * dpkg - main program for package management
3 * depcon.c - dependency and conflict checking
5 * Copyright © 1994,1995 Ian Jackson <ijackson@chiark.greenend.org.uk>
6 * Copyright © 2006-2014 Guillem Jover <guillem@debian.org>
7 * Copyright © 2011 Linaro Limited
8 * Copyright © 2011 Raphaël Hertzog <hertzog@debian.org>
10 * This is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program. If not, see <https://www.gnu.org/licenses/>.
27 #include <sys/types.h>
34 #include <dpkg/i18n.h>
35 #include <dpkg/dpkg.h>
36 #include <dpkg/dpkg-db.h>
37 #include <dpkg/db-ctrl.h>
38 #include <dpkg/db-fsys.h>
42 struct deppossi_pkg_iterator
{
43 struct deppossi
*possi
;
44 struct pkginfo
*pkg_next
;
45 enum which_pkgbin which_pkgbin
;
48 struct deppossi_pkg_iterator
*
49 deppossi_pkg_iter_new(struct deppossi
*possi
, enum which_pkgbin wpb
)
51 struct deppossi_pkg_iterator
*iter
;
53 iter
= m_malloc(sizeof(*iter
));
55 iter
->pkg_next
= &possi
->ed
->pkg
;
56 iter
->which_pkgbin
= wpb
;
62 deppossi_pkg_iter_next(struct deppossi_pkg_iterator
*iter
)
64 struct pkginfo
*pkg_cur
;
65 struct pkgbin
*pkgbin
;
67 while ((pkg_cur
= iter
->pkg_next
)) {
68 iter
->pkg_next
= pkg_cur
->arch_next
;
70 switch (iter
->which_pkgbin
) {
72 pkgbin
= &pkg_cur
->installed
;
75 pkgbin
= &pkg_cur
->available
;
78 if (pkg_cur
->clientdata
&&
79 pkg_cur
->clientdata
->istobe
== PKG_ISTOBE_INSTALLNEW
)
80 pkgbin
= &pkg_cur
->available
;
82 pkgbin
= &pkg_cur
->installed
;
85 internerr("unknown which_pkgbin %d", iter
->which_pkgbin
);
88 if (archsatisfied(pkgbin
, iter
->possi
))
96 deppossi_pkg_iter_free(struct deppossi_pkg_iterator
*iter
)
101 struct cyclesofarlink
{
102 struct cyclesofarlink
*prev
;
104 struct deppossi
*possi
;
107 static bool findbreakcyclerecursive(struct pkginfo
*pkg
,
108 struct cyclesofarlink
*sofar
);
111 foundcyclebroken(struct cyclesofarlink
*thislink
, struct cyclesofarlink
*sofar
,
112 struct pkginfo
*dependedon
, struct deppossi
*possi
)
114 struct cyclesofarlink
*sol
;
119 /* We're investigating the dependency ‘possi’ to see if it
120 * is part of a loop. To this end we look to see whether the
121 * depended-on package is already one of the packages whose
122 * dependencies we're searching. */
123 for (sol
= sofar
; sol
&& sol
->pkg
!= dependedon
; sol
= sol
->prev
);
125 /* If not, we do a recursive search on it to see what we find. */
127 return findbreakcyclerecursive(dependedon
, thislink
);
129 debug(dbg_depcon
,"found cycle");
130 /* Right, we now break one of the links. We prefer to break
131 * a dependency of a package without a postinst script, as
132 * this is a null operation. If this is not possible we break
133 * the other link in the recursive calling tree which mentions
134 * this package (this being the first package involved in the
135 * cycle). It doesn't particularly matter which we pick, but if
136 * we break the earliest dependency we came across we may be
137 * able to do something straight away when findbreakcycle returns. */
139 for (sol
= sofar
; !(sol
!= sofar
&& sol
->pkg
== dependedon
); sol
= sol
->prev
) {
140 if (!pkg_infodb_has_file(sol
->pkg
, &sol
->pkg
->installed
, POSTINSTFILE
))
144 /* Now we have either a package with no postinst, or the other
145 * occurrence of the current package in the list. */
146 sol
->possi
->cyclebreak
= true;
148 debug(dbg_depcon
, "cycle broken at %s -> %s",
149 pkg_name(sol
->possi
->up
->up
, pnaw_always
), sol
->possi
->ed
->name
);
155 * Cycle breaking works recursively down the package dependency tree.
157 * ‘sofar’ is the list of packages we've descended down already - if we
158 * encounter any of its packages again in a dependency we have found a cycle.
161 findbreakcyclerecursive(struct pkginfo
*pkg
, struct cyclesofarlink
*sofar
)
163 struct cyclesofarlink thislink
, *sol
;
164 struct dependency
*dep
;
165 struct deppossi
*possi
, *providelink
;
166 struct pkginfo
*provider
, *pkg_pos
;
168 if (pkg
->clientdata
->color
== PKG_CYCLE_BLACK
)
170 pkg
->clientdata
->color
= PKG_CYCLE_GRAY
;
172 if (debug_has_flag(dbg_depcondetail
)) {
173 struct varbuf str_pkgs
= VARBUF_INIT
;
175 for (sol
= sofar
; sol
; sol
= sol
->prev
) {
176 varbuf_add_str(&str_pkgs
, " <- ");
177 varbuf_add_pkgbin_name(&str_pkgs
, sol
->pkg
, &sol
->pkg
->installed
, pnaw_nonambig
);
179 varbuf_end_str(&str_pkgs
);
180 debug(dbg_depcondetail
, "findbreakcyclerecursive %s %s",
181 pkg_name(pkg
, pnaw_always
), str_pkgs
.buf
);
182 varbuf_destroy(&str_pkgs
);
185 thislink
.prev
= sofar
;
186 thislink
.possi
= NULL
;
187 for (dep
= pkg
->installed
.depends
; dep
; dep
= dep
->next
) {
188 if (dep
->type
!= dep_depends
&& dep
->type
!= dep_predepends
) continue;
189 for (possi
= dep
->list
; possi
; possi
= possi
->next
) {
190 struct deppossi_pkg_iterator
*possi_iter
;
192 /* Don't find the same cycles again. */
193 if (possi
->cyclebreak
) continue;
194 thislink
.possi
= possi
;
196 possi_iter
= deppossi_pkg_iter_new(possi
, wpb_installed
);
197 while ((pkg_pos
= deppossi_pkg_iter_next(possi_iter
)))
198 if (foundcyclebroken(&thislink
, sofar
, pkg_pos
, possi
)) {
199 deppossi_pkg_iter_free(possi_iter
);
202 deppossi_pkg_iter_free(possi_iter
);
204 /* Right, now we try all the providers ... */
205 for (providelink
= possi
->ed
->depended
.installed
;
207 providelink
= providelink
->rev_next
) {
208 if (providelink
->up
->type
!= dep_provides
) continue;
209 provider
= providelink
->up
->up
;
210 if (provider
->clientdata
->istobe
== PKG_ISTOBE_NORMAL
)
212 /* We don't break things at ‘provides’ links, so ‘possi’ is
213 * still the one we use. */
214 if (foundcyclebroken(&thislink
, sofar
, provider
, possi
))
219 /* Nope, we didn't find a cycle to break. */
220 pkg
->clientdata
->color
= PKG_CYCLE_BLACK
;
225 findbreakcycle(struct pkginfo
*pkg
)
227 struct pkg_hash_iter
*iter
;
228 struct pkginfo
*tpkg
;
230 /* Clear the visited flag of all packages before we traverse them. */
231 iter
= pkg_hash_iter_new();
232 while ((tpkg
= pkg_hash_iter_next_pkg(iter
))) {
233 ensure_package_clientdata(tpkg
);
234 tpkg
->clientdata
->color
= PKG_CYCLE_WHITE
;
236 pkg_hash_iter_free(iter
);
238 return findbreakcyclerecursive(pkg
, NULL
);
241 void describedepcon(struct varbuf
*addto
, struct dependency
*dep
) {
242 struct varbuf depstr
= VARBUF_INIT
;
244 varbufdependency(&depstr
, dep
);
245 varbuf_end_str(&depstr
);
249 varbuf_printf(addto
, _("%s depends on %s"),
250 pkg_name(dep
->up
, pnaw_nonambig
), depstr
.buf
);
253 varbuf_printf(addto
, _("%s pre-depends on %s"),
254 pkg_name(dep
->up
, pnaw_nonambig
), depstr
.buf
);
257 varbuf_printf(addto
, _("%s recommends %s"),
258 pkg_name(dep
->up
, pnaw_nonambig
), depstr
.buf
);
261 varbuf_printf(addto
, _("%s suggests %s"),
262 pkg_name(dep
->up
, pnaw_nonambig
), depstr
.buf
);
265 varbuf_printf(addto
, _("%s breaks %s"),
266 pkg_name(dep
->up
, pnaw_nonambig
), depstr
.buf
);
269 varbuf_printf(addto
, _("%s conflicts with %s"),
270 pkg_name(dep
->up
, pnaw_nonambig
), depstr
.buf
);
273 varbuf_printf(addto
, _("%s enhances %s"),
274 pkg_name(dep
->up
, pnaw_nonambig
), depstr
.buf
);
277 internerr("unknown deptype '%d'", dep
->type
);
280 varbuf_destroy(&depstr
);
284 * *whynot must already have been initialized; it need not be
285 * empty though - it will be reset before use.
287 * If depisok returns false for ‘not OK’ it will contain a description,
288 * newline-terminated BUT NOT NUL-TERMINATED, of the reason.
290 * If depisok returns true it will contain garbage.
291 * allowunconfigd should be non-zero during the ‘Pre-Depends’ checking
292 * before a package is unpacked, when it is sufficient for the package
293 * to be unpacked provided that both the unpacked and previously-configured
294 * versions are acceptable.
296 * On false return (‘not OK’), *canfixbyremove refers to a package which
297 * if removed (dep_conflicts) or deconfigured (dep_breaks) will fix
298 * the problem. Caller may pass NULL for canfixbyremove and need not
299 * initialize *canfixbyremove.
301 * On false return (‘not OK’), *canfixbytrigaw refers to a package which
302 * can fix the problem if all the packages listed in Triggers-Awaited have
303 * their triggers processed. Caller may pass NULL for canfixbytrigaw and
304 * need not initialize *canfixbytrigaw.
307 depisok(struct dependency
*dep
, struct varbuf
*whynot
,
308 struct pkginfo
**canfixbyremove
, struct pkginfo
**canfixbytrigaw
,
311 struct deppossi
*possi
;
312 struct deppossi
*provider
;
313 struct pkginfo
*pkg_pos
;
315 /* Use this buffer so that when internationalization comes along we
316 * don't have to rewrite the code completely, only redo the sprintf strings
317 * (assuming we have the fancy argument-number-specifiers).
318 * Allow 250x3 for package names, versions, &c, + 250 for ourselves. */
321 if (dep
->type
!= dep_depends
&&
322 dep
->type
!= dep_predepends
&&
323 dep
->type
!= dep_breaks
&&
324 dep
->type
!= dep_conflicts
&&
325 dep
->type
!= dep_recommends
&&
326 dep
->type
!= dep_suggests
&&
327 dep
->type
!= dep_enhances
)
328 internerr("unknown dependency type %d", dep
->type
);
331 *canfixbyremove
= NULL
;
333 *canfixbytrigaw
= NULL
;
335 /* The dependency is always OK if we're trying to remove the depend*ing*
337 switch (dep
->up
->clientdata
->istobe
) {
338 case PKG_ISTOBE_REMOVE
:
339 case PKG_ISTOBE_DECONFIGURE
:
341 case PKG_ISTOBE_NORMAL
:
342 /* Only installed packages can be made dependency problems. */
343 switch (dep
->up
->status
) {
344 case PKG_STAT_INSTALLED
:
345 case PKG_STAT_TRIGGERSPENDING
:
346 case PKG_STAT_TRIGGERSAWAITED
:
348 case PKG_STAT_HALFCONFIGURED
:
349 case PKG_STAT_UNPACKED
:
350 case PKG_STAT_HALFINSTALLED
:
351 if (dep
->type
== dep_predepends
||
352 dep
->type
== dep_conflicts
||
353 dep
->type
== dep_breaks
)
356 case PKG_STAT_CONFIGFILES
:
357 case PKG_STAT_NOTINSTALLED
:
360 internerr("unknown status depending '%d'", dep
->up
->status
);
363 case PKG_ISTOBE_INSTALLNEW
:
364 case PKG_ISTOBE_PREINSTALL
:
367 internerr("unknown istobe depending '%d'", dep
->up
->clientdata
->istobe
);
370 /* Describe the dependency, in case we have to moan about it. */
371 varbuf_reset(whynot
);
372 varbuf_add_char(whynot
, ' ');
373 describedepcon(whynot
, dep
);
374 varbuf_add_char(whynot
, '\n');
376 /* TODO: Check dep_enhances as well. */
377 if (dep
->type
== dep_depends
|| dep
->type
== dep_predepends
||
378 dep
->type
== dep_recommends
|| dep
->type
== dep_suggests
) {
379 /* Go through the alternatives. As soon as we find one that
380 * we like, we return ‘true’ straight away. Otherwise, when we get to
381 * the end we'll have accumulated all the reasons in whynot and
382 * can return ‘false’. */
384 for (possi
= dep
->list
; possi
; possi
= possi
->next
) {
385 struct deppossi_pkg_iterator
*possi_iter
;
387 possi_iter
= deppossi_pkg_iter_new(possi
, wpb_by_istobe
);
388 while ((pkg_pos
= deppossi_pkg_iter_next(possi_iter
))) {
389 switch (pkg_pos
->clientdata
->istobe
) {
390 case PKG_ISTOBE_REMOVE
:
391 sprintf(linebuf
, _(" %.250s is to be removed.\n"),
392 pkg_name(pkg_pos
, pnaw_nonambig
));
394 case PKG_ISTOBE_DECONFIGURE
:
395 sprintf(linebuf
, _(" %.250s is to be deconfigured.\n"),
396 pkg_name(pkg_pos
, pnaw_nonambig
));
398 case PKG_ISTOBE_INSTALLNEW
:
399 if (versionsatisfied(&pkg_pos
->available
, possi
)) {
400 deppossi_pkg_iter_free(possi_iter
);
403 sprintf(linebuf
, _(" %.250s is to be installed, but is version "
405 pkgbin_name(pkg_pos
, &pkg_pos
->available
, pnaw_nonambig
),
406 versiondescribe(&pkg_pos
->available
.version
, vdew_nonambig
));
408 case PKG_ISTOBE_NORMAL
:
409 case PKG_ISTOBE_PREINSTALL
:
410 switch (pkg_pos
->status
) {
411 case PKG_STAT_INSTALLED
:
412 case PKG_STAT_TRIGGERSPENDING
:
413 if (versionsatisfied(&pkg_pos
->installed
, possi
)) {
414 deppossi_pkg_iter_free(possi_iter
);
417 sprintf(linebuf
, _(" %.250s is installed, but is version "
419 pkg_name(pkg_pos
, pnaw_nonambig
),
420 versiondescribe(&pkg_pos
->installed
.version
, vdew_nonambig
));
422 case PKG_STAT_NOTINSTALLED
:
423 /* Don't say anything about this yet - it might be a virtual package.
424 * Later on, if nothing has put anything in linebuf, we know that it
425 * isn't and issue a diagnostic then. */
428 case PKG_STAT_TRIGGERSAWAITED
:
429 if (canfixbytrigaw
&& versionsatisfied(&pkg_pos
->installed
, possi
))
430 *canfixbytrigaw
= pkg_pos
;
432 case PKG_STAT_UNPACKED
:
433 case PKG_STAT_HALFCONFIGURED
:
434 if (allowunconfigd
) {
435 if (!dpkg_version_is_informative(&pkg_pos
->configversion
)) {
436 sprintf(linebuf
, _(" %.250s is unpacked, but has never been "
438 pkg_name(pkg_pos
, pnaw_nonambig
));
440 } else if (!versionsatisfied(&pkg_pos
->installed
, possi
)) {
441 sprintf(linebuf
, _(" %.250s is unpacked, but is version "
443 pkg_name(pkg_pos
, pnaw_nonambig
),
444 versiondescribe(&pkg_pos
->installed
.version
,
447 } else if (!dpkg_version_relate(&pkg_pos
->configversion
,
450 sprintf(linebuf
, _(" %.250s latest configured version is "
452 pkg_name(pkg_pos
, pnaw_nonambig
),
453 versiondescribe(&pkg_pos
->configversion
, vdew_nonambig
));
456 deppossi_pkg_iter_free(possi_iter
);
462 sprintf(linebuf
, _(" %.250s is %s.\n"),
463 pkg_name(pkg_pos
, pnaw_nonambig
),
464 gettext(statusstrings
[pkg_pos
->status
]));
469 internerr("unknown istobe depended '%d'", pkg_pos
->clientdata
->istobe
);
471 varbuf_add_str(whynot
, linebuf
);
473 deppossi_pkg_iter_free(possi_iter
);
475 /* See if the package we're about to install Provides it. */
476 for (provider
= possi
->ed
->depended
.available
;
478 provider
= provider
->rev_next
) {
479 if (provider
->up
->type
!= dep_provides
) continue;
480 if (!pkg_virtual_deppossi_satisfied(possi
, provider
))
482 if (provider
->up
->up
->clientdata
->istobe
== PKG_ISTOBE_INSTALLNEW
)
486 /* Now look at the packages already on the system. */
487 for (provider
= possi
->ed
->depended
.installed
;
489 provider
= provider
->rev_next
) {
490 if (provider
->up
->type
!= dep_provides
) continue;
491 if (!pkg_virtual_deppossi_satisfied(possi
, provider
))
494 switch (provider
->up
->up
->clientdata
->istobe
) {
495 case PKG_ISTOBE_INSTALLNEW
:
496 /* Don't pay any attention to the Provides field of the
497 * currently-installed version of the package we're trying
498 * to install. We dealt with that by using the available
499 * information above. */
501 case PKG_ISTOBE_REMOVE
:
502 sprintf(linebuf
, _(" %.250s provides %.250s but is to be removed.\n"),
503 pkg_name(provider
->up
->up
, pnaw_nonambig
),
506 case PKG_ISTOBE_DECONFIGURE
:
507 sprintf(linebuf
, _(" %.250s provides %.250s but is to be deconfigured.\n"),
508 pkg_name(provider
->up
->up
, pnaw_nonambig
),
511 case PKG_ISTOBE_NORMAL
:
512 case PKG_ISTOBE_PREINSTALL
:
513 if (provider
->up
->up
->status
== PKG_STAT_INSTALLED
||
514 provider
->up
->up
->status
== PKG_STAT_TRIGGERSPENDING
)
516 if (provider
->up
->up
->status
== PKG_STAT_TRIGGERSAWAITED
)
517 *canfixbytrigaw
= provider
->up
->up
;
518 sprintf(linebuf
, _(" %.250s provides %.250s but is %s.\n"),
519 pkg_name(provider
->up
->up
, pnaw_nonambig
),
521 gettext(statusstrings
[provider
->up
->up
->status
]));
524 internerr("unknown istobe provider '%d'",
525 provider
->up
->up
->clientdata
->istobe
);
527 varbuf_add_str(whynot
, linebuf
);
531 /* If the package wasn't installed at all, and we haven't said
532 * yet why this isn't satisfied, we should say so now. */
533 sprintf(linebuf
, _(" %.250s is not installed.\n"), possi
->ed
->name
);
534 varbuf_add_str(whynot
, linebuf
);
542 /* It's conflicts or breaks. There's only one main alternative,
543 * but we also have to consider Providers. We return ‘false’ as soon
544 * as we find something that matches the conflict, and only describe
545 * it then. If we get to the end without finding anything we return
551 if (possi
->ed
!= possi
->up
->up
->set
) {
552 struct deppossi_pkg_iterator
*possi_iter
;
554 /* If the package conflicts with or breaks itself it must mean
555 * other packages which provide the same virtual name. We
556 * therefore don't look at the real package and go on to the
559 possi_iter
= deppossi_pkg_iter_new(possi
, wpb_by_istobe
);
560 while ((pkg_pos
= deppossi_pkg_iter_next(possi_iter
))) {
561 switch (pkg_pos
->clientdata
->istobe
) {
562 case PKG_ISTOBE_REMOVE
:
564 case PKG_ISTOBE_INSTALLNEW
:
565 if (!versionsatisfied(&pkg_pos
->available
, possi
))
567 sprintf(linebuf
, _(" %.250s (version %.250s) is to be installed.\n"),
568 pkgbin_name(pkg_pos
, &pkg_pos
->available
, pnaw_nonambig
),
569 versiondescribe(&pkg_pos
->available
.version
, vdew_nonambig
));
570 varbuf_add_str(whynot
, linebuf
);
571 if (!canfixbyremove
) {
572 deppossi_pkg_iter_free(possi_iter
);
576 *canfixbyremove
= pkg_pos
;
578 case PKG_ISTOBE_DECONFIGURE
:
579 if (dep
->type
== dep_breaks
)
580 break; /* Already deconfiguring this. */
582 case PKG_ISTOBE_NORMAL
:
583 case PKG_ISTOBE_PREINSTALL
:
584 switch (pkg_pos
->status
) {
585 case PKG_STAT_NOTINSTALLED
:
586 case PKG_STAT_CONFIGFILES
:
588 case PKG_STAT_HALFINSTALLED
:
589 case PKG_STAT_UNPACKED
:
590 case PKG_STAT_HALFCONFIGURED
:
591 if (dep
->type
== dep_breaks
)
592 break; /* No problem. */
594 case PKG_STAT_INSTALLED
:
595 case PKG_STAT_TRIGGERSPENDING
:
596 case PKG_STAT_TRIGGERSAWAITED
:
597 if (!versionsatisfied(&pkg_pos
->installed
, possi
))
599 sprintf(linebuf
, _(" %.250s (version %.250s) is present and %s.\n"),
600 pkg_name(pkg_pos
, pnaw_nonambig
),
601 versiondescribe(&pkg_pos
->installed
.version
, vdew_nonambig
),
602 gettext(statusstrings
[pkg_pos
->status
]));
603 varbuf_add_str(whynot
, linebuf
);
604 if (!canfixbyremove
) {
605 deppossi_pkg_iter_free(possi_iter
);
609 *canfixbyremove
= pkg_pos
;
613 internerr("unknown istobe conflict '%d'", pkg_pos
->clientdata
->istobe
);
616 deppossi_pkg_iter_free(possi_iter
);
619 /* See if the package we're about to install Provides it. */
620 for (provider
= possi
->ed
->depended
.available
;
622 provider
= provider
->rev_next
) {
623 if (provider
->up
->type
!= dep_provides
) continue;
624 if (provider
->up
->up
->clientdata
->istobe
!= PKG_ISTOBE_INSTALLNEW
)
626 if (provider
->up
->up
->set
== dep
->up
->set
)
627 continue; /* Conflicts and provides the same. */
628 if (!pkg_virtual_deppossi_satisfied(possi
, provider
))
630 sprintf(linebuf
, _(" %.250s provides %.250s and is to be installed.\n"),
631 pkgbin_name(provider
->up
->up
, &provider
->up
->up
->available
,
632 pnaw_nonambig
), possi
->ed
->name
);
633 varbuf_add_str(whynot
, linebuf
);
634 /* We can't remove the one we're about to install: */
636 *canfixbyremove
= NULL
;
640 /* Now look at the packages already on the system. */
641 for (provider
= possi
->ed
->depended
.installed
;
643 provider
= provider
->rev_next
) {
644 if (provider
->up
->type
!= dep_provides
) continue;
646 if (provider
->up
->up
->set
== dep
->up
->set
)
647 continue; /* Conflicts and provides the same. */
649 if (!pkg_virtual_deppossi_satisfied(possi
, provider
))
652 switch (provider
->up
->up
->clientdata
->istobe
) {
653 case PKG_ISTOBE_INSTALLNEW
:
654 /* Don't pay any attention to the Provides field of the
655 * currently-installed version of the package we're trying
656 * to install. We dealt with that package by using the
657 * available information above. */
659 case PKG_ISTOBE_REMOVE
:
661 case PKG_ISTOBE_DECONFIGURE
:
662 if (dep
->type
== dep_breaks
)
663 continue; /* Already deconfiguring. */
665 case PKG_ISTOBE_NORMAL
:
666 case PKG_ISTOBE_PREINSTALL
:
667 switch (provider
->up
->up
->status
) {
668 case PKG_STAT_NOTINSTALLED
:
669 case PKG_STAT_CONFIGFILES
:
671 case PKG_STAT_HALFINSTALLED
:
672 case PKG_STAT_UNPACKED
:
673 case PKG_STAT_HALFCONFIGURED
:
674 if (dep
->type
== dep_breaks
)
675 break; /* No problem. */
677 case PKG_STAT_INSTALLED
:
678 case PKG_STAT_TRIGGERSPENDING
:
679 case PKG_STAT_TRIGGERSAWAITED
:
681 _(" %.250s provides %.250s and is present and %s.\n"),
682 pkg_name(provider
->up
->up
, pnaw_nonambig
), possi
->ed
->name
,
683 gettext(statusstrings
[provider
->up
->up
->status
]));
684 varbuf_add_str(whynot
, linebuf
);
688 *canfixbyremove
= provider
->up
->up
;
693 internerr("unknown istobe conflict provider '%d'",
694 provider
->up
->up
->clientdata
->istobe
);
701 *canfixbyremove
= NULL
;
704 } /* if (dependency) {...} else {...} */