You do know that bash --rpm-requires will extract
dependencies for all scriptlets, not just %post and %preun,
automagically for several years now?
If you don't like the executable(...) probe, as in
Requires: executable(grep)
form of the scriptlet dependencies, then reformat the dependencies
however you wish
in the extraction script.
And if you really want control over automagic extraction from__ONLY__
%post and %preun, well add some control bits to the macro
that enables/disables
%_use_internal_dependency_generator
hth
73 de Jeff
On Sep 24, 2008, at 12:14 PM, Alexey M. Tourbin wrote:
> Update of git://git.altlinux.org/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.ru>
> 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
> ______________________________________________________________________
> RPM Package Manager http://rpm5.org
> Developer Communication List rpm-devel@rpm5.org
Received on Wed Sep 24 18:26:45 2008