From: "Alexey M. Tourbin" <at@altlinux.org> To: devel@lists.altlinux.org Subject: [devel] %post-script prerequisites Date: Wed, 24 Sep 2008 12:37:26 +0000 Message-ID: <20080924123726.GI839@altlinux.org> (raw) Когда в %post-скрипте пакета запускается программа, запакованная в сам этот пакет, тогда некоторые зависимости Requires пакета нужно продублировать в Requires(post). Например, если в пакете libgtk+2 запускается программа gkt-update-icon-cache, то должна появиться зависимость на новый пакет glib2 вида Requires(post): libglib-2.0.so.0(GLIB_2.18). Update of /people/at/packages/rpm.git Changes statistics since `4.0.4-alt95.M41.4-7-g3de7779' follows: scripts/find-scriptlet-requires.in | 27 +++++++++++++++++++++++++++ 1 files changed, 27 insertions(+), 0 deletions(-) Changelog since `4.0.4-alt95.M41.4-7-g3de7779' follows: commit 555b366b2df864b37878a989ce337078555316a4 Author: Alexey Tourbin <at@altlinux> Date: Wed Sep 24 12:17:39 2008 +0000 find-scriptlet-requires: describe Requires(post) problem in %post-scripts Full diff since `4.0.4-alt95.M41.4-7-g3de7779' follows: diff --git a/scripts/find-scriptlet-requires.in b/scripts/find-scriptlet-requires.in index 85d432e..6d37605 100755 --- a/scripts/find-scriptlet-requires.in +++ b/scripts/find-scriptlet-requires.in @@ -77,4 +77,31 @@ RunMethods req "$methods" RunMethod PrintDeps >"$workdir"/deps0 if [ -s "$workdir"/deps0 ]; then cat "$workdir"/deps0 +else + exit fi + +# Consider a program which is packaged into a package, and which gets +# called in %post or %preun scriptlet of the package (e.g. in libgtk+2, +# gtk-update-icon-cache might be called in %post-script). Packaged +# programs have "Requires" dependencies, and, for %post and %preun scripts, +# the dependencies on packaged programs are optimized out (as well as other +# dependencies provided by the package). This is a problem: when executing +# %post-script, its prerequisites might not be installed yet (e.g. +# gtk-update-icon-cache requires recent glib2 version installed/upgraded +# before libgtk+2). + +# The solution is: 1) to detect all packaged programs (and files), recursively, +# which are used in %post-script; and 2) to find prerequisites for such files +# and programs (which are not provided by the package itself), and add them to +# Requires(post) dependencies. Also, we want to ensure that 3) the list of +# Requires(post) additional dependencies is only a subset of original Requires. + +# The above applies only to %post and %preun scriptlets. +case "${script##*/}" in + .post:* | .preun:* ) ;; + *) exit ;; +esac + +# The above applies only if packaged programs can be used in scripts. +[ -s "$RPM_BUILD_ROOT/.files:${RPM_SUBPACKAGE_NAME:?}" ] || exit 0
next reply other threads:[~2008-09-24 12:37 UTC|newest] Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top 2008-09-24 12:37 Alexey M. Tourbin [this message] 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 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=20080924123726.GI839@altlinux.org \ --to=at@altlinux.org \ --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