[devel] gcc-common
Alexey Tourbin
=?iso-8859-1?q?at_=CE=C1_altlinux=2Eru?=
Вс Мар 23 23:39:07 MSK 2008
On Sat, Mar 22, 2008 at 11:05:45PM +0300, Alexey Tourbin wrote:
> Вот buildreq теперь будет путаться.
>
> $ /usr/share/buildreqs/optimize_package_list gcc-c++-common gcc4.1-c++
> tsort: -: input contains a loop:
> tsort: gcc-c++-common
> tsort: gcc4.1-c++
> gcc-c++-common
> $
Урро! Я реализовал разрыв циклов, типичных для -common пакетов,
в пользу не-common пакета.
commit c43c3bc22120846b84560aa83bb18fb8276037ae
Author: Alexey Tourbin <at на altlinux>
Date: Sun Mar 23 23:30:16 2008 +0300
optimize_package_list: detect simple RV-loops, select the package with non-virtual dependency
$ ./rpm-utils/optimize_package_list gcc-common gcc4.1
optimize_package_list: simple RV-loop (first package takes precedence):
gcc4.1 <-> gcc-common
gcc4.1
$ ./rpm-utils/optimize_package_list sendmail-common postfix
optimize_package_list: simple RV-loop (first package takes precedence):
postfix <-> sendmail-common
postfix
$
diff --git a/rpm-utils/optimize_package_list b/rpm-utils/optimize_package_list
index cdf6b99..3311e77 100755
--- a/rpm-utils/optimize_package_list
+++ b/rpm-utils/optimize_package_list
@@ -66,8 +66,29 @@ if [ -s R-amb ]; then
sed -e 's/ / -> /g' <nRn-amb
fi >&2
+# Assist loop breaks. Consider this:
+# gcc-common /usr/bin/i586-alt-linux-gcc gcc4.1
+# gcc4.1 gcc-common gcc-common
+# We would like gcc4.1 to take precedence, because gcc4.1 explicitly
+# requires gcc-common.
+awk '$2==$3{print$1,$3}' <nRn |sort -u >nn-real
+awk '$2!=$3{print$1,$3}' <nRn |sort -u >nn-virt
+comm -23 nn-virt nn-real >nn-virt-only
+mv -f nn-virt-only nn-virt
+# nn-real: gcc4.1 gcc-common
+# nn-virt: gcc-common gcc4.1
+awk '{print$2,$1}' <nn-virt |sort -u >reverse-nn-virt
+comm -12 reverse-nn-virt nn-real >nn-real-virt-loop
+if [ -s nn-real-virt-loop ]; then
+ echo "$PROG: simple RV-loop (first package takes precedence):"
+ sed -e 's/ / <-> /g' <nn-real-virt-loop
+ awk '{print$2,$1}' <nn-real-virt-loop |sort -u >nn-virt-bad
+ comm -23 nn-virt nn-virt-bad >nn-virt-good
+ mv -f nn-virt-good nn-virt
+fi >&2
+
# make list of package pairs where first depends on second
-cut -d' ' -f1,3 <nRn |sort -u >nn
+sort -u nn-real nn-virt >nn
# tsort this list of pairs
tsort <nn >t || [ -s t ]
----------- следующая часть -----------
Было удалено вложение не в текстовом формате...
Имя : =?iso-8859-1?q?=CF=D4=D3=D5=D4=D3=D4=D7=D5=C5=D4?=
Тип : application/pgp-signature
Размер : 197 байтов
Описание: =?iso-8859-1?q?=CF=D4=D3=D5=D4=D3=D4=D7=D5=C5=D4?=
Url : <http://lists.altlinux.org/pipermail/devel/attachments/20080323/bfa628e2/attachment-0002.bin>
Подробная информация о списке рассылки Devel