On 04/04/2016 12:42 PM, Thierry Vignaud wrote:
On 3 April 2016 at 03:21, doc <drplastic99@xxxxxxxxx> wrote:
A customer is using RedHat Kickstart to install packages on bare metal
machines. Unfortunately, the %pretrans in the first package fails because
/bin/sh hasn't been installed. What I'm being told is that the following
%pretrans scriptlet is not supported by RedHat Kickstart.
%pretrans
[ -n "$VERBOSE" ] && set -x ; :
Am I missing something?
If's RHEL7, then using sg like "Requires(pretrans): coreutils bash" should work.
(actually anything using rpm-4.9+ would support this)
Though rpm should emits such requires automatically (well for the
shell, not for the commands you'll actually be using)
eg:
$ rpm -qpR -v RPMS/x86_64/foobar-1-1.x86_64.rpm
interp,posttrans: /bin/sh
interp,pretrans: /bin/sh
With that, rpmlib should order packages installation such as bash is
installed prior to this package.
No amount of ordering can satisfy Requires(pretrans) dependencies that
are not already installed. By definition, pretrans scriptlets run before
the transaction has started, so Requires(pretrans) provider has to be
already installed, it cannot come from the transaction that is about to
start.
Newer rpm can correctly express this: a pretrans dependency on a
non-installed package will simply always fail on dependency check. Older
versions just ignore the unsatisfiable dependency.
In practise this means that something like "Requires(pretrans): /bin/sh"
can only ever work on an already installed system (including system
upgrade), but never on a fresh installation. Which of course is rather
useless, and which is why all %pretrans scriptlets have to be written
using the embedded Lua interpreter (ie %pretrans -p <lua>) in practise.
- Panu -
_______________________________________________
Rpm-list mailing list
Rpm-list@xxxxxxxxxxxxx
http://lists.rpm.org/mailman/listinfo/rpm-list