[Rpm-maint] [rpm-software-management/rpm] Defining %global macro in %pre results empty in %post (#1440)

Giovanni Bertoncelli notifications at github.com
Mon Nov 16 09:59:51 UTC 2020

I have to retrieve in the SPEC file the previous installed version of the package. I'm trying to define this custom macro inside %pre:
  PREVIOUS_VERSION=$(/path/to/executable --version)
  %global _prevver $(echo $PREVIOUS_VERSION)
I will use it in the %post phase:
  export PREVIOUS_VERSION=%{_prevver}
but sadly the %{_prevver} macro is empty inside %post... Is there anything I'm missing? The %global macro should be global and therefore defined also in the %post phase...

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20201116/f6bc9bcd/attachment-0001.html>

More information about the Rpm-maint mailing list