On Thu, Sep 25, 2008 at 06:19:14AM +0000, Alexey Tourbin wrote: > On Wed, Sep 24, 2008 at 11:28:41PM +0400, Dmitry V. Levin wrote: > > > 1) пакет foo содержит программу /usr/bin/update-foo. > > > 2) /usr/bin/update-foo запускается в %post-срипте пакета foo. > > > 3) зависимость Requires(post): /usr/bin/update-foo естественным > > > образом оптимизируется (*), потому что на стадии выполнения %post-скрипта > > > файл /usr/bin/update-foo уже распакован (в любом случае, эта зависимость > > > ничего не дала бы). > > > 4) файл /usr/bin/update-foo слинкован с libglib-2.0.so.0(GLIB_2.18). > > > > > > Тогда rpm имеет право установить/обновить пакет glib2 после пакета foo. > > > Остается полагаться на топологическую сортировку пакетов при установке > > > или обновлении, но она может не сработать (rpm всё ещё имеет право > > > переупорядочить пакеты невыгодным нам образом), и тогда %post-скрипт > > > обломится. > > > > rpm пытается упорядочить установку пакетов согласно зависимостям. > > Невыгодное упорядочение может возникнуть только в случае, если имеет > > место цикл зависимостей, который был разорван неудачно. Насколько > > это реально, в применении к описываемой ситуации с %post-скриптом? > > На практике дублирование зависимостей Requires(post), скорее всего, > ничего не даст, кроме *гарантии*, что упорядочение всегда будет > правильным. Но как раз нужна именно гарантия, иначе можно договориться > до того, что на практике зависимости Requires(pre) и Requires(post) > вообще не нужны. 4.0.4-alt95.M41.4-14-g9b2294d Пересборка пакета postfix. $ grep -C1 find-scriptlet-requires: log2 + /usr/lib/rpm/find-scriptlet-requires /usr/src/tmp/postfix-buildroot/.post:postfix find-scriptlet-requires: self-packaged files used in this scriptlet: /etc/chroot.d/postfix.all /etc/postfix/post-install /etc/rc.d/init.d/postfix find-scriptlet-requires: more self-packaged files: /etc/chroot.d/postfix.conf /etc/chroot.d/postfix.lib /usr/lib64/libpostfix-2.4.9.so /usr/lib64/libpostfix_dict-2.4.9.so /usr/sbin/postmap find-scriptlet-requires: additional dependencies for self-packaged files: /etc/chroot.d /etc/chroot.d(Fatal) /etc/chroot.d(copy_resolv_conf) /etc/chroot.d(copy_resolv_lib) /etc/chroot.d/functions /etc/rc.d/init.d(SourceIfNotEmpty) /etc/rc.d/init.d(action) /etc/rc.d/init.d(failure) /etc/rc.d/init.d(is_yes) /etc/rc.d/init.d(msg_usage) /etc/rc.d/init.d(status) /etc/rc.d/init.d(success) /etc/rc.d/init.d/functions /lib64/ld-linux-x86-64.so.2 /usr/bin/newaliases ed findutils glibc-utils grep libc.so.6(GLIBC_2.2.5)(64bit) libc.so.6(GLIBC_2.3)(64bit) libc.so.6(GLIBC_2.3.2)(64bit) libc.so.6(GLIBC_2.3.4)(64bit) libc.so.6(GLIBC_2.4)(64bit) libcdb.so.1()(64bit) libdb-4.7.so()(64bit) libdl.so.2(GLIBC_2.2.5)(64bit) libnsl.so.1(GLIBC_2.2.5)(64bit) libresolv.so.2(GLIBC_2.2.5)(64bit) rtld(GNU_HASH) sed + exit 0 -- + /usr/lib/rpm/find-scriptlet-requires /usr/src/tmp/postfix-buildroot/.preun:postfix find-scriptlet-requires: self-packaged files used in this scriptlet: /etc/rc.d/init.d/postfix find-scriptlet-requires: additional dependencies for self-packaged files: /etc/rc.d/init.d(SourceIfNotEmpty) /etc/rc.d/init.d(action) /etc/rc.d/init.d(failure) /etc/rc.d/init.d(is_yes) /etc/rc.d/init.d(msg_usage) /etc/rc.d/init.d(status) /etc/rc.d/init.d(success) /etc/rc.d/init.d/functions glibc-utils + exit 0 $ $ sh -c '. buildlog.sh ; buildlog_deps $1' -c log1 >.1 $ sh -c '. buildlog.sh ; buildlog_deps $1' -c log2 >.2 $ diff -U1 .1 .2 --- .1 2008-10-05 19:12:20 +0400 +++ .2 2008-10-05 19:12:23 +0400 @@ -14,2 +14,3 @@ postfix-2.4.9-alt1 Provides smtpdaemon +postfix-2.4.9-alt1 Requires /bin/sh postfix-2.4.9-alt1 Requires /etc/chroot.d @@ -32,2 +33,3 @@ postfix-2.4.9-alt1 Requires /usr/bin/perl +postfix-2.4.9-alt1 Requires coreutils postfix-2.4.9-alt1 Requires diffutils @@ -56,4 +58,19 @@ postfix-2.4.9-alt1 Requires(post) /bin/sh +postfix-2.4.9-alt1 Requires(post) /etc/chroot.d +postfix-2.4.9-alt1 Requires(post) /etc/chroot.d(Fatal) +postfix-2.4.9-alt1 Requires(post) /etc/chroot.d(copy_resolv_conf) +postfix-2.4.9-alt1 Requires(post) /etc/chroot.d(copy_resolv_lib) +postfix-2.4.9-alt1 Requires(post) /etc/chroot.d/functions +postfix-2.4.9-alt1 Requires(post) /etc/rc.d/init.d(SourceIfNotEmpty) +postfix-2.4.9-alt1 Requires(post) /etc/rc.d/init.d(action) +postfix-2.4.9-alt1 Requires(post) /etc/rc.d/init.d(failure) +postfix-2.4.9-alt1 Requires(post) /etc/rc.d/init.d(is_yes) +postfix-2.4.9-alt1 Requires(post) /etc/rc.d/init.d(msg_usage) +postfix-2.4.9-alt1 Requires(post) /etc/rc.d/init.d(status) +postfix-2.4.9-alt1 Requires(post) /etc/rc.d/init.d(success) +postfix-2.4.9-alt1 Requires(post) /etc/rc.d/init.d/functions +postfix-2.4.9-alt1 Requires(post) /lib64/ld-linux-x86-64.so.2 postfix-2.4.9-alt1 Requires(post) /sbin/chkconfig postfix-2.4.9-alt1 Requires(post) /sbin/ldconfig +postfix-2.4.9-alt1 Requires(post) /usr/bin/newaliases postfix-2.4.9-alt1 Requires(post) /usr/sbin/control @@ -61,2 +78,18 @@ postfix-2.4.9-alt1 Requires(post) coreutils +postfix-2.4.9-alt1 Requires(post) ed +postfix-2.4.9-alt1 Requires(post) findutils +postfix-2.4.9-alt1 Requires(post) glibc-utils +postfix-2.4.9-alt1 Requires(post) grep +postfix-2.4.9-alt1 Requires(post) libc.so.6(GLIBC_2.2.5)(64bit) +postfix-2.4.9-alt1 Requires(post) libc.so.6(GLIBC_2.3)(64bit) +postfix-2.4.9-alt1 Requires(post) libc.so.6(GLIBC_2.3.2)(64bit) +postfix-2.4.9-alt1 Requires(post) libc.so.6(GLIBC_2.3.4)(64bit) +postfix-2.4.9-alt1 Requires(post) libc.so.6(GLIBC_2.4)(64bit) +postfix-2.4.9-alt1 Requires(post) libcdb.so.1()(64bit) +postfix-2.4.9-alt1 Requires(post) libdb-4.7.so()(64bit) +postfix-2.4.9-alt1 Requires(post) libdl.so.2(GLIBC_2.2.5)(64bit) +postfix-2.4.9-alt1 Requires(post) libnsl.so.1(GLIBC_2.2.5)(64bit) +postfix-2.4.9-alt1 Requires(post) libresolv.so.2(GLIBC_2.2.5)(64bit) +postfix-2.4.9-alt1 Requires(post) rtld(GNU_HASH) +postfix-2.4.9-alt1 Requires(post) sed postfix-2.4.9-alt1 Requires(postun) /sbin/postun_ldconfig @@ -69,4 +102,13 @@ postfix-2.4.9-alt1 Requires(preun) /bin/sh +postfix-2.4.9-alt1 Requires(preun) /etc/rc.d/init.d(SourceIfNotEmpty) +postfix-2.4.9-alt1 Requires(preun) /etc/rc.d/init.d(action) +postfix-2.4.9-alt1 Requires(preun) /etc/rc.d/init.d(failure) +postfix-2.4.9-alt1 Requires(preun) /etc/rc.d/init.d(is_yes) +postfix-2.4.9-alt1 Requires(preun) /etc/rc.d/init.d(msg_usage) +postfix-2.4.9-alt1 Requires(preun) /etc/rc.d/init.d(status) +postfix-2.4.9-alt1 Requires(preun) /etc/rc.d/init.d(success) +postfix-2.4.9-alt1 Requires(preun) /etc/rc.d/init.d/functions postfix-2.4.9-alt1 Requires(preun) /sbin/chkconfig postfix-2.4.9-alt1 Requires(preun) coreutils +postfix-2.4.9-alt1 Requires(preun) glibc-utils postfix-2.4.9-alt1 Requires(rpmlib) rpmlib(CompressedFileNames) <= 3.0.4-1 Бинарные зависимости появляются из-за /usr/sbin/postmap, который слинкован с libpostfix и libpostfix_dict, так что даже появляется зависимость Requires(post) на libdb-4.7.so. Выглядит чудно, но вроде правильно.