[opensuse-packaging] Incompatibility between info_del macro and 06-check-installtest post-build-check
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@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
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.
In any case... preun or postun? install-info needs the file to remove it from the index?
Looks like it doesn't need the file so preun or postun doesn't matter
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.
%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. Also I wonder why one has to add the '.info' suffix there. The macro could take care of that as well. cu Ludwig -- (o_ Ludwig Nussel //\ V_/_ http://www.suse.de/ SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg) -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
2009/5/29 Ludwig Nussel <ludwig.nussel@suse.de>:
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@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
Cristian Morales Vega wrote:
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.
Except for the info page suffix (bz2 vs gz) the Fedora way albeit inconvenient should just work everywhere as it doesn't use extra macros.
Ok. I don't really know exactly what install-info does, I though it was only saying "new file available".
It maintains the entries in /usr/share/info/dir
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.
It creates an index for use by whatis(1). I also already wondered if a similar system as install-info could be used for that purpose. The install-info mechnism was introduced to replace a cron job that indexed all info pages and created the dir file in the past. So gettings rid of that mandb cron job is overdue.
%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.
Ah, well, that's true. Fedora will fail in this regard then. OTOH I'm not sure whether that situation actually happens in practice. cu Ludwig -- (o_ Ludwig Nussel //\ V_/_ http://www.suse.de/ SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg) -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
participants (2)
-
Cristian Morales Vega
-
Ludwig Nussel