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: Wed, 24 Sep 2008 15:43:54 +0000
Message-ID: <20080924154354.GK839@altlinux.org> (raw)
In-Reply-To: <20080924131612.GA22319@wo.int.altlinux.org>

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

On Wed, Sep 24, 2008 at 05:16:13PM +0400, Dmitry V. Levin wrote:
> On Wed, Sep 24, 2008 at 12:37:26PM +0000, Alexey M. Tourbin wrote:
> > Когда в %post-скрипте пакета запускается программа, запакованная
> > в сам этот пакет, тогда некоторые зависимости Requires пакета нужно
> > продублировать в Requires(post).  Например, если в пакете libgtk+2
> > запускается программа gkt-update-icon-cache, то должна появиться
> > зависимость на новый пакет glib2 вида
> > Requires(post): libglib-2.0.so.0(GLIB_2.18).
> 
> Зачем должна появляться такая зависимость?

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-скрипт
обломится.

Единственное решение состоит в том, что подмножество зависимостей
пакета foo, необходимых для запуска /usr/bin/update-foo (то есть,
в частности, libglib-2.0.so.0(GLIB_2.18)) необходимо дополнительно
указать в Requires(post).

[*] Правда есть ещё одно решение, которое только что мне пришло в
голову.  В пункте 3 можно не оптимизировать зависимость "Requires(post):
/usr/bin/update-foo"; тогда нужно модифицировать алгоритм топологической
сортировки пакетов следующим образом: если в пакете есть зависимость
Requires(post), которая разрешается в сам этот пакет, то все зависимости
Requires *должны* быть установлены до выполнения %post-скрипта (то есть
это неявная полная трансляция зависимостей Requires -> Requires(post),
вместо частичной и явной).

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

  reply	other threads:[~2008-09-24 15:43 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 [this message]
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
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=20080924154354.GK839@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