vpac / src / upgrade_deps.v
17 lines · 15 sloc · 829 bytes · 841315c100c81d9e6b14c4b55a25d4e3d12db762
Raw
1module main
2
3import nspkg
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
12fn prepare_error(handle &nspkg.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