Mailinglist Archive: opensuse-buildservice (239 mails)

< Previous Next >
Re: [opensuse-buildservice] perhaps OT spec file question
  • From: Marcus Meissner <meissner@xxxxxxx>
  • Date: Wed, 27 May 2009 11:08:36 +0200
  • Message-id: <20090527090836.GA7061@xxxxxxx>
On Wed, May 27, 2009 at 11:05:31AM +0200, Christian wrote:
Hi,

I tried to define a "var" in %pre, hoping that this "var" is then known
in %post.

Example:
%pre
if [ ${1:-0} -gt 1 ]; then
# get version of previuos installed package
pre_version=`rpm -q --qf "%{VERSION}" %{name}`
fi


%post
if [ ${1:-0} -gt 1 ]; then
if [ -n $pre_version ]; then
if [ "$pre_version" = "%{version}" ]; then
do stuff
fi
fi
fi

but "$pre_version" is not known in %post.
I also tried "export pre_version=`.....` with no success.

Any Idea ?

You cannot test for this, you might have more than 1 or random previous
versions...

What do you actually _want_ to do?

Ciao, Marcus
--
To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-buildservice+help@xxxxxxxxxxxx

< Previous Next >
References