| 1 | module main |
| 2 | |
| 3 | import alpm |
| 4 | |
| 5 | // prepare_error explains a failed transaction when the upgrade of outdated |
| 6 | // dependencies was switched off. a dependency too old for a target is not |
| 7 | // the cause then: libalpm's prepare pulls the newer one in by itself. what |
| 8 | // fails is the other direction — an installed package that needs the very |
| 9 | // version this transaction replaces — which the walk (broken_dependents) |
| 10 | // would have upgraded along. the hint goes on a line of its own, below the |
| 11 | // broken dependencies prepare listed |
| 12 | fn prepare_error(handle &alpm.Handle, msg string, no_upgrade_deps bool) string { |
| 13 | if no_upgrade_deps && handle.errno() == .unsatisfied_deps { |
| 14 | return '${msg}\nwithout --no-upgrade-deps, the installed packages this breaks are upgraded along with it when the repos have a version that fits' |
| 15 | } |
| 16 | return msg |
| 17 | } |
| 18 | |