Mailinglist Archive: opensuse-packaging (105 mails)

< Previous Next >
[opensuse-packaging] Incompatibility between info_del macro and 06-check-installtest post-build-check
  • From: Cristian Morales Vega <cmorve69@xxxxxxxx>
  • Date: Thu, 28 May 2009 23:11:00 +0200
  • Message-id: <8235e6f40905281411n6d574e61sc5347efb9b498780@xxxxxxxxxxxxxx>
The OBS defines a cross-distribution macro, info_del, to call
install-info --delete

%info_del(:-:) test -x /sbin/install-info -a ! -f
%{?2}%{?!2:%{_infodir}}/%{1}%ext_info && /sbin/install-info --quiet
--delete --info-dir=%{?2}%{?!2:%{_infodir}}
%{?2}%{?!2:%{_infodir}}/%{1}%ext_info \
%{nil}

The important part is the "! -f %{?2}%{?!2:%{_infodir}}/%{1}%ext_info"
that makes sure it is called in postun and no in preun.

The problem is that the 06-check-installtest script executes all the
{pre,post}[un] scriptlets without really uninstalling the package so,
when executing info_del, "%{?2}%{?!2:%{_infodir}}/%{1}%ext_info" still
exists and the test fails.


All the docs in the wiki, even those that use the openSUSE specific
macro instead of info_del, use the macros unconditionally and always
in post and postun, never in preun. Fedora, instead, uninstalls in
preun and only when the package is going to be removed, not in
upgrades.
Since 06-check-installtest executes all the scriplets like an
upgrade, the Fedora way works.



So, options:

Use the macros as the openSUSE wiki says:
%post -n %{name}
%info_add %{name}.info

%postun -n %{name}
%info_del %{name}.info

...needs fixing 06-check-installtest or info_del

OR

Use the Fedora way:
%post -n %{name}
%info_add %{name}.info

%preun -n %{name}
if [ $1 -eq 0 ] ; then
%info_del %{name}.info
fi

In any case... preun or postun? install-info needs the file to remove
it from the index? And, if it should be called only in upgrades,
shouldn't be

%post -n %{name}
if [ $1 -eq 1 ] ; then
%info_add %{name}.info
fi

%preun -n %{name}
if [ $1 -eq 0 ] ; then
%info_del %{name}.info
fi

?
--
To unsubscribe, e-mail: opensuse-packaging+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-packaging+help@xxxxxxxxxxxx

< Previous Next >
List Navigation
Follow Ups