Is there a way to turn off %pretrans?

Thierry Vignaud thierry.vignaud at gmail.com
Mon Apr 4 09:42:42 UTC 2016


On 3 April 2016 at 03:21, doc <drplastic99 at yahoo.com> 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.
(unless there's a dependency cycle, in which case rpm will randomly
break a dep when ordering packages)
Else you cannot guaranty that bash will be installed first.

But here, I don't see that's the issue.
Actually I don't see the point in this %pretrans:
- is VERBOSE set in the KS ?
  Debugging should be done by packager, not in KS...
- set -x will ony be valid for the %pretrans, not for other scriptlets
  (and not for other packages)
  Basically, each scriptlet runs its own interpreter (either /bin/sh,
 perl, python, lua, ... whatever you choose)
 What's the purpose here? to see what happen with %pretrans?
 Debugging should be done by packager, not in KS...

So:
- What version of RHEL is used?
- What's the actual failure?
- What's the actual error message?
- Is that the whole %pretrans ?


More information about the Rpm-list mailing list