Hi Robert, this is what I did: %pre #echo "PARAM_pre: "$1 # on `rpm -ivh` PARAM is 1 # on `rpm -Uvh` PARAM is 2 if [ ${1:-0} -gt 1 ]; then # get version of previuos installed package pre_version=`rpm -q --qf "%{VERSION}" %{name}` echo $pre_version > /var/run/rpm_%{name} fi %post #echo "PARAM_pre: "$1 # on `rpm -ivh` PARAM is 1 # on `rpm -Uvh` PARAM is 2 # are we on update for a newer version ? if [ ${1:-0} -gt 1 ]; then if [ -f /var/run/rpm_%{name} ]; then pre_version=`head -n 1 /var/run/rpm_%{name}` if [ "$pre_version" != "%{version}" ]; then %{__cp} -a /srv/%{name}/www/install-default /srv/%{name}/www/install %{__rm} /var/run/rpm_%{name} fi fi fi Regards Chris Robert Schweikert schrieb:
Hi,
The question is somewhat of topic, but not completely in left field.
Is there a way to figure out the version of a previously installed package with the same base name in the %pre and %post sections of the spec.
The idea is that if a release upgrade is being performed command A needs to be run and if a version upgrade is performed command B needs to be run.
Thanks, Robert
-- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org