Mailinglist Archive: opensuse-packaging (105 mails)

< Previous Next >
Re: [opensuse-packaging] Incompatibility between info_del macro and 06-check-installtest post-build-check
  • From: Cristian Morales Vega <cmorve69@xxxxxxxx>
  • Date: Fri, 29 May 2009 12:52:25 +0200
  • Message-id: <8235e6f40905290352s676eebd3rd6e78bd1a459e63c@xxxxxxxxxxxxxx>
2009/5/29 Ludwig Nussel <ludwig.nussel@xxxxxxx>:
Cristian Morales Vega wrote:
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.

Who invented that macro and why? Obviously the use of .. && .. is
wrong. %install_info_delete however will do the right thing.

From http://files.opensuse.org/opensuse/en/5/57/FOSDEM_building.pdf it
seems was added to avoid conditional parts in the spec file. Not sure
if there is a video of the presentation with more details... anyway
I'm totally unable to understand talked english.
But, if that was the objective, it would have made more sense to make
%info_del a wrapper to whatever the distro already does.

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

The check doesn't make sense. The description of the new info page
could have changed so you want to call info_add always.

Ok. I don't really know exactly what install-info does, I though it
was only saying "new file available".

Something off-topic... openSUSE has a cron job to run mandb from time
to time. I disabled it since when run the system was slowed by the
high hard driver usage of mandb. ...I have never seen any difference,
what exactly mandb does? The manual page of mandb is a little vague.

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

The check should be made by %info_del itself so the packager doesn't
have to care. Since arguments to %preun and %postun are the same it
doesn't matter where you call it.

But it should be there in the opensuse macro? Isn't 100% safe, it is?
That test can make upgrades faster but If the updated package hasn't
the info page available anymore then install-info --delete will never
be called for than info page.

Also I wonder why one has to add the '.info' suffix there. The macro
could take care of that as well.

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

< Previous Next >
List Navigation
Follow Ups