ALT Linux Team development discussions
 help / color / mirror / Atom feed
From: Alexey Tourbin <at@altlinux.ru>
To: ALT Devel discussion list <devel@lists.altlinux.org>
Subject: Re: [devel] %post-script prerequisites
Date: Mon, 6 Oct 2008 00:18:40 +0400
Message-ID: <20081005201840.GS6399@altlinux.org> (raw)
In-Reply-To: <20081005152000.GO6399@altlinux.org>

[-- Attachment #1: Type: text/plain, Size: 4008 bytes --]

On Sun, Oct 05, 2008 at 07:20:00PM +0400, Alexey Tourbin wrote:
> @@ -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

> Бинарные зависимости появляются из-за /usr/sbin/postmap, который
> слинкован с libpostfix и libpostfix_dict, так что даже появляется
> зависимость Requires(post) на libdb-4.7.so.  Выглядит чудно,
> но вроде правильно.

К сожалению, во многих других (типичных) случаях обнаружить файловые
зависимости гораздо сложнее.  Например, из кода "/usr/sbin/post_service foo"
сейчас никак нельзя вывести требование не файл "/etc/rc.d/init.d/foo".
И, значит, никак нельзя добавить Requires(post) зависимости, которые
соответствовали бы потребностям /etc/rc.d/init.d/foo.

А файл /etc/rc.d/init.d/foo в свою очередь содержит ещё одну обёртку:
как правило, демон запускается через start_daemon.  Так что из скрипта
/etc/rc.d/init.d/foo не удастся просто так извлечь зависимость на
бинарик демона.  А если бы мы извлекли зависимость на этот бинарик,
тогда все бинарные зависимости этого бинарика продублировались бы в
Requires(post).  Тогда это получается ближе ко второму сценирю: если
обнаруживается, что в %post-скритпе вызывается какая либо программа,
запакованная в том же самом пакете, тогда *все* Requires зависимости
пакета неоходимо продублирова (точнее, как бы "сдвинуть") на
Requires(post).

Но, опять же, нельзя достаточно надёжно засечь, дёргается ли
в %post-скрипте какая-либо запакованная программа или нет.

Что-то я прямо не знаю что делать.  С одной стороны, реализован
правильный механизм, который в принципе может работать.  С другой
стороны, он не будет работать в типичных (унифицированных) случаях.
А если бы он хорошо работал во всех случаях, тогда бы мы получили
простое дублирование ("сдвиг") зависимостей Requires -> Requires(post).

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

  reply	other threads:[~2008-10-05 20:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-24 12:37 Alexey M. Tourbin
2008-09-24 13:16 ` Dmitry V. Levin
2008-09-24 15:43   ` Alexey Tourbin
2008-09-24 19:28     ` Dmitry V. Levin
2008-09-25  6:19       ` Alexey Tourbin
2008-10-05 15:20         ` Alexey Tourbin
2008-10-05 20:18           ` Alexey Tourbin [this message]
2008-09-27 16:51       ` Alexey Tourbin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20081005201840.GS6399@altlinux.org \
    --to=at@altlinux.ru \
    --cc=devel@lists.altlinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

ALT Linux Team development discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \
		devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
	public-inbox-index devel

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git