Notes from GeorgiosZarkadas
I found that using a higher than 500 value to pin testing/unstable resulted in apt-get upgrade wanting to upgrade all packages with a newer version to testing/unstable even while I had stable pinned with a higher value than testing/unstable.
After, querying the outcome of apt-cache policy <some-package> for a number of the packages that apt-get upgrade considered that they should be upgraded, I concluded that if there are multiple versions with candidates pinned to 500 or higher, then pinning is considered after the version number. Thus the highest version with the highest pin weight among the candidates of that (and only that) version is selected.
For example (having stable pinned to 700, testing to 650 and unstable to 600):
Код: Выделить всё
root@freedom:/etc/apt# apt-cache policy deborphan deborphan: Εγκατεστημένα: 1.7.28.3+squeeze1 Υποψήφιο: 1.7.28.5 Πίνακας Έκδοσης: 1.7.28.5 0 650 http://ftp.gr.debian.org/debian/ wheezy/main amd64 Packages 600 http://ftp.gr.debian.org/debian/ sid/main amd64 Packages *** 1.7.28.3+squeeze1 0 500 http://ftp.gr.debian.org/debian/ squeeze-proposed-updates/main amd64 Packages 100 /var/lib/dpkg/status 1.7.28.3 0 500 cdrom://[Debian GNU/Linux 6.0.1a _Squeeze_ - Official amd64 DVD Binary-1 20110322-16:05]/ squeeze/main amd64 Packages 700 http://ftp.gr.debian.org/debian/ squeeze/main amd64 Packages
Since my aim for using multiple sources and pinning was to be able to occasionally install a package from testing or unstable and not upgrade all my packages, pinning testing / unstable to values equal or greater than 500 is clearly an insuitable method for the stated cause.
However, I found that using a value less than 500 for testing/unstable has the desired effect. For example (removed stable pin and set testing to 450 and unstable to 400):
Код: Выделить всё
root@freedom:/etc/apt# apt-cache policy deborphan deborphan: Εγκατεστημένα: 1.7.28.3+squeeze1 Υποψήφιο: 1.7.28.3+squeeze1 Πίνακας Έκδοσης: 1.7.28.5 0 450 http://ftp.gr.debian.org/debian/ wheezy/main amd64 Packages 400 http://ftp.gr.debian.org/debian/ sid/main amd64 Packages *** 1.7.28.3+squeeze1 0 500 http://ftp.gr.debian.org/debian/ squeeze-proposed-updates/main amd64 Packages 100 /var/lib/dpkg/status 1.7.28.3 0 500 cdrom://[Debian GNU/Linux 6.0.1a _Squeeze_ - Official amd64 DVD Binary-1 20110322-16:05]/ squeeze/main amd64 Packages 500 http://ftp.gr.debian.org/debian/ squeeze/main amd64 Packages
Насколько я понимаю, в его примере все должно выглядеть примерно так:
Сначала apt берет версию из squeeze/main и сравнивает ее с установленной
Код: Выделить всё
sgf@shilvana:~$ dpkg --compare-versions 1.7.28.3 lt '1.7.28.3+squeeze1' ; echo $?
0но видит, что она меньше установленной, а тк приоритет 700 недостаточен для downgrade, то apt продолжает поиск кандидата. Тогда она берет версию из wheezy/main и видит, что она больше.
Код: Выделить всё
sgf@shilvana:~$ dpkg --compare-versions '1.7.28.3+squeeze1' lt 1.7.28.5 ; echo $?
0Кандидат найден, его она и предлагает.
Т.е, насколько я понимаю, вывод, который он сделал
I concluded that if there are multiple versions with candidates pinned to 500 or higher, then pinning is considered after the version number.
неправильный. А причина такой работы в том, что у него установлена более поздняя версия, чем в stable. И, если бы у него стояла версия 1.7.28.3, то все бы работало, как он хочет.
Итак, кто же из нас прав, и стоит ли править wiki? -)